Dynamic adjustment method based on error correction code and chip
By dynamically adjusting the error correction strategy level in the storage device according to the data importance level and operating environment, it solves the problem that fixed error correction codes cannot adapt to different data types and environments, improves the reliability and error correction capabilities of data storage, and reduces costs. Encoding and decoding time and power consumption.
Patent Information
- Application Number
- CN202410607056.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-09-13
AI Technical Summary
Existing storage devices cause data errors due to factors such as stray radiation and electrical interference when processing data, and the fixed error correction code strategy cannot be dynamically adjusted and cannot adapt to different data types and operating environments, affecting the reliability of data storage.
The memory controller dynamically adjusts the error correction strategy level according to the data importance level, operating load and data error flag information, and calls the corresponding error correction code for verification and correction, realizing multiple error detection and adaptive adjustment of the error correction code.
It improves the reliability of data storage in the memory module, reduces encoding and decoding time and power load, adapts to different encoding and decoding time and load environments, and enhances error correction capabilities and storage security.
Smart Images

Figure CN118642885A
Abstract
Description
Technical Field
[0001] The present application relates to the field of fault tolerance of storage devices, and to a dynamic adjustment method and chip based on error correction codes. Background Art
[0002] With the development of information technology, the requirements for data processing speed and data accuracy of storage devices are constantly increasing. Among many storage devices, memory is one of the most critical components. However, memory is affected by various factors such as stray radiation and electrical interference, and data errors are prone to occur. A method of self-testing the memory inside the chip disclosed in an MBIST circuit system of Chinese invention patent CN202011496194.0 includes obtaining test results by comparing test stimulus data and test response data read from the built-in SRAM. Although the MBIST circuit system can be reused for testing different types of SRAM memories, it lacks an application mechanism for error correction code (ECC), and it is impossible to overcome the aforementioned data errors by performing error correction check on the read data.
[0003] In order to reduce these errors, memory usually uses error correcting code (ECC) technology to detect and correct bit errors, but the current memory controller uses a fixed error correction code for data error correction, or requires the reliability of data storage and the electrical state of the operating device to jointly determine the only error correction scheme selection result. Therefore, the error correction strategy applied to the same chip is relatively simple, and the error correction capability cannot be dynamically adjusted according to the type of data stored or the actual reading and writing of the data. It may not adapt to the time and required working power of different data encoding methods, which is not conducive to using chip memory resources to correctly store data. Summary of the invention
[0004] This application discloses a dynamic adjustment method and chip based on error correction code, and the specific technical solution is as follows: A dynamic adjustment method based on error correction codes includes: a memory controller adjusts a current error correction strategy level according to data importance level, operating load and / or data error flag information, so as to verify by calling the error correction code corresponding to the adjusted current error correction strategy level; wherein the data importance level, operating load and data error flag information respectively support adjustment of the current error correction strategy level, so as to select different error correction strategy levels in turn as the adjusted current error correction strategy level, and realize conversion between error correction codes corresponding to the current error correction strategy level and error correction codes corresponding to different error correction strategy levels; wherein the operating load and data importance level are both externally fed back to the memory controller; the memory controller is configured to obtain the data error flag information during multiple error checks according to the error correction strategy level adopted by the data pre-written into the memory module.
[0005] Compared with the prior art, the present application can adjust the current error correction strategy level a limited number of times based on some or all of the conditions among the data importance level, the operating load and the data error flag information, and the data importance level, the operating load and the data error flag information can adjust the current error correction strategy level in sequence, so that when a limited number of conditions undergo limited changes, the memory controller disclosed in the present application automatically switches the error correction strategy level and its corresponding error correction code, constrains the level type, switching time and encoding and decoding time of the current error correction strategy level switching, speeds up the automatic switching of the error correction code and reduces the power load relative to a single environmental factor, and the present application supports multiple adaptive adjustments to the current error correction strategy level within a relatively close period of time when data is written to the memory module, meets the storage security requirements of the memory module under different encoding and decoding times or different load operating environments, improves the reliability of data storage in the memory module, and ensures that the error correction code can reliably perform automatic verification of data.
[0006] Furthermore, the method for the memory controller to adjust the current error correction strategy level according to the data importance level, operating load and / or data error flag information includes: if the data importance level fed back to the memory controller by the central processing unit increases, the memory controller will increase the current error correction strategy level, so that the error correction code corresponding to the increased error correction strategy level is converted into an error correction code for correcting more erroneous data bits; and / or, if the operating load fed back to the memory controller by the central processing unit decreases, the memory controller will increase the current error correction strategy level, so that the error correction code corresponding to the increased error correction strategy level is converted into an error correction code for correcting more erroneous data bits; and / or, if the memory controller detects that the data error flag information is set to a valid flag, the memory controller will increase the current error correction strategy level, so that the error correction code corresponding to the increased error correction strategy level is converted into an error correction code for correcting more erroneous data bits.
[0007] Furthermore, before the memory controller writes data to the memory module, if the central processing unit determines that the data importance level of the data to be written to the memory module has increased, the importance flag is set to a valid flag and fed back to the memory controller, triggering the memory controller to control the current error correction strategy level to be increased by one level; if the central processing unit determines that the data importance level of the data to be written has decreased, the importance flag is set to an invalid flag and fed back to the memory controller, triggering the memory controller to control the current error correction strategy level to be decreased by one level; and / or, when the operating load fed back by the central processing unit to the memory controller is reduced, the load flag is set to a valid flag and fed back to the memory controller, triggering the memory controller to control the current error correction strategy level to be increased by one level; the central processing unit feeds back to the memory controller When the running load fed back by the controller increases, the load flag is set to an invalid flag and fed back to the memory controller, triggering the memory controller to control the current error correction strategy level to be reduced by one level; and / or, the memory controller reads data from the memory module and detects whether erroneous data occurs; when erroneous data is detected, the data error flag information is set to a valid flag, and the current error correction strategy level is controlled to be increased once; after detecting the occurrence of erroneous data once, if no erroneous data is detected during the process of continuously reading data for a certain number of times, the data error flag information is set to an invalid flag, triggering the memory controller to control the current error correction strategy level to be reduced, so that after the data error flag information is flipped from an invalid flag to a valid flag, the current error correction strategy level is adjusted once for each continuous reading of data for a certain number of times.
[0008] To sum up, the higher the data importance level, the smaller the operating load, the more necessary it is to improve the current error correction strategy level to improve the security of data stored in the memory module; and the lower the data importance level, the greater the operating load, the more necessary it is to reduce the current error correction strategy level. The lower the current error correction strategy level, the fewer redundant data bits in the data that the corresponding error correction code needs to process, the shorter the encoding and decoding time, the lower the operating power, and can also ensure a certain degree of data storage security; and, after detecting the occurrence of erroneous data, the number of times the current error correction strategy level is increased is constrained by setting a process of continuously reading data for a certain number of times, so as to ensure the security of data stored in the memory module while also reducing the encoding and decoding time and operating power.
[0009] Furthermore, the method for detecting whether erroneous data occurs includes: the memory controller controls the encoding of the data to be written according to the encoding rules corresponding to the current error correction strategy level, obtains the encoded data, and then writes the encoded data into the memory module; if the memory controller reads the encoded data from the memory module, the encoded data is decoded according to the decoding rules corresponding to the current error correction strategy level to obtain a decoding result; if the decoding result is equal to the data to be written, it is detected that no erroneous data occurs; if the decoding result is not equal to the data to be written, it is detected that erroneous data occurs.
[0010] Further, before the memory controller starts writing data to the memory module for the first time, it first sets a reference error correction strategy level, wherein the encoding rule corresponding to the reference error correction strategy level is predetermined; then the encoding rule corresponding to the reference error correction strategy level is called to encode the data, and then the encoded data is written to the memory module to complete the first writing of data to the memory module; if the memory controller reads data from the memory module for the first time, the data read for the first time is decoded according to the decoding rule corresponding to the reference error correction strategy level to obtain a decoding result; then the decoding result is detected whether erroneous data appears, and the reference error correction strategy level is updated to the current error correction strategy level; then the current error correction strategy level is adjusted according to the data importance level, the operating load and / or the data error flag information; wherein the write address for writing data to the memory module for the first time and the read address for reading data from the memory module for the first time are the same; wherein the encoding rule corresponding to the reference error correction strategy level is called to encode the data, and the encoded data obtained is an error correction code corresponding to the reference error correction strategy level, and the error correction code corresponding to the reference error correction strategy level is configured to correct at least one erroneous data bit. Therefore, after the first read and write operation is performed on the memory module, the current error correction strategy level is adjusted starting from the reference error correction strategy level according to the data importance level, the operating load and / or the data error flag information.
[0011] Furthermore, in the process of the memory controller adjusting the current error correction strategy level according to the data error flag information, it includes: each time the memory controller reads data from the memory module, if erroneous data is detected, the data error flag information is set to a valid flag bit and maintained as a valid flag bit to trigger the memory controller to upgrade the current error correction strategy level by one level, and the number of times that no erroneous data appears is cleared to zero; then, if it is detected that no data error occurs and the data error flag information is set to a valid flag bit, the number of times that no erroneous data appears is counted, until the number of consecutive times that no erroneous data appears reaches a preset test number, then it is determined that after a certain number of consecutive reads, the error correction strategy level has been increased by one level. In the process of continuously reading a certain number of data, it is detected that no erroneous data occurs, and the data error flag information is set to an invalid flag bit, and the current error correction strategy level is controlled to be reduced, and the number of times that no erroneous data occurs is stopped; wherein, the certain number of times is greater than or equal to the preset test number; whenever the data error flag information is flipped from the invalid flag bit to the valid flag bit, in the process of continuously reading a certain number of data, if it is detected that no erroneous data occurs, the memory controller keeps the current error correction strategy level unchanged; wherein, the data read from the memory module by the memory controller is encoded in advance according to the encoding rules corresponding to the current error correction strategy level.
[0012] Further, after detecting the occurrence of erroneous data, if the memory controller detects the occurrence of erroneous data again during the process of continuously reading data for a certain number of times, the data error flag information is set to a valid flag bit but the current error correction strategy level is kept unchanged, and the number of times that no erroneous data occurs that needs to be counted is cleared to zero, and then, when it is detected that no data error occurs and the data error flag information is set to a valid flag bit, the number of times no erroneous data occurs is counted until the number of consecutive times no erroneous data occurs reaches a preset test number, and the data error flag information is set to an invalid flag bit, and the current error correction strategy level is controlled to be reduced by one level, and the number of times no erroneous data occurs is stopped at the same time, until the occurrence of erroneous data is detected again, and then the data error flag information is set to a valid flag bit, and the number of times no erroneous data occurs is cleared to zero, so as to start detecting whether erroneous data occurs in the next round of continuous reading of data for a certain number of times.
[0013] Therefore, after the first occurrence of erroneous data and marking the data error flag information as a valid flag, the current error correction strategy level can be increased once, and the number of times that no erroneous data occurs can be counted; if no erroneous data occurs after a round of multiple error detections according to the error correction strategy level called by the data pre-written into the memory module, the data error flag information can be marked as an invalid flag, and the current error correction strategy level can be reduced by one level; if erroneous data is detected again during a round of multiple error detections according to the error correction strategy level called by the data pre-written into the memory module (or in the process of continuously reading data for a certain number of times), the current error correction strategy level can be controlled to remain unchanged, and the number of times that no erroneous data occurs can be cleared, and a round of multiple error detections can be performed again. In this way, the probability of data storage errors occurring in the memory module, that is, the probability of failure of the memory module, can be estimated by a cycle, and the memory controller records the error events of the memory module in the recent period of time, and adaptively adjusts the current error correction strategy level to automatically complete the conversion between error correction codes corresponding to different error correction strategy levels, thereby ensuring the reliability of data storage, shortening the encoding and decoding time, reducing the encoding and decoding power, and improving the read and write throughput of the memory module.
[0014] Furthermore, the method for adjusting the current error correction strategy level according to the data importance level, operation load and / or data error flag information includes: when the memory controller writes data to the memory module, the memory controller adjusts the current error correction strategy level at most three times according to the data importance level, operation load and the data error flag information, so that the memory controller calls the encoding rule corresponding to the adjusted current error correction strategy level to encode the data, and then stores the encoded data into the memory module; wherein the data importance level, operation load and the data error flag information only support adjusting the current error correction strategy level at most once. Dynamic calling of different error correction codes is realized.
[0015] Furthermore, the method in which the memory controller adjusts the current error correction strategy level three times in sequence according to the data importance level, the operating load and the data error flag information includes: first, when it is detected that the data importance level has increased, the current error correction strategy level is increased by one level from the initial error correction strategy level to obtain a first error correction strategy level; wherein the initial error correction strategy level is a pre-set level and is the lowest error correction strategy level; then, when it is detected that the operating load has decreased, the first error correction strategy level is increased by one level to obtain a second error correction strategy level; then, when it is detected that the data error flag information is set to a valid flag bit, the second error correction strategy level is increased by one level to obtain a third error correction strategy level, thereby achieving three adjustments to the current error correction strategy level.
[0016] Furthermore, the error correction code corresponding to the initial error correction strategy level is a parity check code; the error correction code corresponding to the first error correction strategy level is a Hamming check code; the error correction code corresponding to the second error correction strategy level is a Reed-Slolmon code; and the error correction code corresponding to the third error correction strategy level is an LDPC code or an MDS code. Thus, error correction codes corresponding to three error correction strategy levels (three error correction strategy levels with different coding strengths) are provided, which are suitable for the memory module to safely and reliably store and verify data in three different risk environments.
[0017] A chip is used to execute the dynamic adjustment method; the chip at least comprises a central processing unit and a memory controller, and a memory module is arranged inside or outside the chip; the memory controller is connected to the central processing unit, and the memory controller is used to receive the data importance level and operation load fed back by the central processing unit; the memory controller is connected to the memory module, and the memory controller is used to perform data reading and writing operations on the memory module; the memory controller is used to adjust the current error correction strategy level according to the data importance level, operation load and / or data error flag information respectively. The chip disclosed in the present application uses some or all of the monitored data importance levels, operating loads, and data error flag information to perform multiple adjustments to the current error correction strategy level, thereby adaptively adjusting various error correction strategy levels for encoding storage and error detection feedback, which can free up a period of reading time when the chip memory storage is unstable to detect data errors in the data to be written, thereby taking the change frequency of the data error flag information as a benchmark to avoid frequent changes of multiple error correction codes when the memory storage data is unstable. Instead, the current error correction strategy level is dynamically adjusted in conjunction with the data importance level and operating load, thereby alleviating failures of the memory module during data storage, and also improving the application flexibility of the error correction strategy level and its corresponding error correction code, and enhancing the environmental adaptability of the error correction and detection capabilities.
[0018] Furthermore, the memory controller includes an ECC encoding unit and an ECC decoding unit; the ECC encoding unit is used to call the corresponding encoding rules to encode the valid storage data according to the adjusted current error correction strategy level to obtain the encoded data, and then transmit the valid storage data, the encoded data block and the error correction strategy information to the memory module; wherein the error correction strategy information is used to represent the adjusted current error correction strategy level and its corresponding encoding rules, and the encoded data is the error correction code corresponding to the adjusted current error correction strategy level; the ECC decoding unit is used to read the error correction strategy information, the encoded data and the valid storage data from the memory module , and then based on the error correction strategy information, call the decoding rule corresponding to the adjusted current error correction strategy level, and then decode the encoded data according to the decoding rule corresponding to the adjusted current error correction strategy level to obtain decoded data; the ECC decoding unit is also used to determine whether the decoded data is the same as the valid stored data; when it is determined that the decoded data is the same as the valid stored data, the decoded data is transmitted to the central processing unit; when it is determined that the decoded data is not the same as the valid stored data, the decoded data is corrected according to the error correction code corresponding to the adjusted current error correction strategy level to obtain reliable data, and then the reliable data is transmitted to the central processing unit. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 The present application discloses a flow chart of a dynamic adjustment method based on an error correction code.
[0020] Figure 2 The present application discloses a connection relationship diagram of a memory controller. DETAILED DESCRIPTION
[0021] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings: "Data" as described herein may refer to a digital signal containing a certain number of valid data bits (also referred to as "data bits"), flag bits, and (optionally) a certain number of ECC bits (also referred to as "parity bits" or "overhead bits") (used to perform encoding, decoding, error detection and correction). According to rules mutually predetermined for the transmitter and the receiver, a plurality of data bits may be visualized as / organized into "data blocks". Thus, a continuous signal may constitute a bit stream, which is periodically organized into data blocks by an encoder or a decoder.
[0022] Further, the signal / data may be viewed as a sequence of data blocks that are transmitted and / or received, even if the constituent bits are transmitted and / or received as a linear sequence of bits. For example, a sequence of data blocks may be transmitted starting with an initial data block, and subsequent data blocks in the same sequence of data blocks may then be transmitted; thus, the initial data block may be viewed as a "previous" data block in the same sequence of data blocks relative to the subsequent data blocks, and this relationship of previous and subsequent data blocks continues to be maintained as each other subsequent data block is encoded, decoded, transmitted and / or received.
[0023] The error correcting code (ECC) used in this article is a code used for error correction / verification. Different types of ECC are encoded and decoded according to different ECC encoding rules and decoding rules. The encoding rules and decoding rules corresponding to the various error correction strategy levels described in this article can be manually formulated rules obtained based on past experience, or they can be automatically obtained with the help of machine learning algorithms, where the encoding rules contain conditional information organized into error correction codes, including at least the number of storage bits occupied by the data bits required to constitute the rules and the meaning of each storage bit.
[0024] "Bit error", "erroneous data" may refer to a data bit that is corrupted by noise or other impairments when transmitted over a communication channel, thereby producing a bit value detected at a receiver that is different from the corresponding bit value set by the transmitter.
[0025] Examples of ECC include Hamming check code, BCH code, RS code, LDPC code and MDS code, which are all special terms in the field of error correction codes. There is no other way to explain them, and people in this field can understand them.
[0026] As an embodiment, the present application discloses a dynamic adjustment method based on an error correction code, which is applied to a memory controller. The prior art is that there is a risk of data error when reading and writing data in the memory space, and the dynamic adjustment error correction capability is insufficient, and it cannot reduce the power and encoding and decoding time brought by various data encoding methods, because most chips waste a lot of time on the path of transporting data. The dynamic adjustment method disclosed in the present application can improve the dynamic adjustment error correction capability and overcome the problem that the greater the error correction capability, the greater the power consumption.
[0027] Therefore, a plurality of error correction strategies are predefined in the memory controller disclosed in the present application, and are divided into a plurality of levels of error correction strategies according to the role of the memory controller in the system and the expected use mode, and each uses an error correction strategy level identifier and supports calling the corresponding encoding rules to encode the corresponding error correction code. These error correction strategies can be dynamically called in the memory controller; therefore, the dynamic adjustment method includes that the memory controller adjusts the current error correction strategy level according to the data importance level, the operating load and / or the data error flag information to reduce the risk of data storage errors in the memory module, and then verifies by calling the error correction code corresponding to the adjusted current error correction strategy level. It can be understood that the memory controller realizes dynamic calling of different error correction strategy levels by adjusting the same current error correction strategy level, specifically, adaptively obtaining a required error correction strategy level and its corresponding error correction code according to the data importance level, the operating load and / or the data error flag information, and then calling the corresponding error correction code for error correction / verification, thereby improving the security of real-time data storage in the memory module and reducing the storage of erroneous data due to the instability of the memory space.
[0028] The operating load and data importance level are both fed back to the memory controller by the central processing unit. It can be understood that the memory controller monitors the real-time operating status such as the operating load and data importance level through the central processing unit, which can be used to adaptively adjust the current error correction strategy level.
[0029] The data importance level is the importance of the data that needs to be written to the memory module. The data importance level reflects the storage security level assigned by the central processing unit to the data written to the memory module. It can be used as a pre-determined data type. The central processing unit can simply divide it into two levels of "important" and "unimportant" and feed it back to the memory controller to adjust the corresponding error correction strategy level; of course, the data importance level can be divided into several levels, but the corresponding error correction and error detection control is also more complicated.
[0030] The operating load can be understood as the system load, which can be divided into two levels: overloaded and not overloaded. The operating load reflects the real-time working status of the chip where the central processing unit is located (including chip temperature, operating memory, number of cores that can be run, etc.). The higher the operating load, the higher the power required.
[0031] The data error flag information is configured by the memory controller during multiple error detections based on the error correction code called by the data pre-written into the memory module; it can be understood that in the process of reading data multiple times in a row, the data error flag information is updated and configured through multiple consecutive error detections to identify the risk of erroneous data in the memory module. During the multiple consecutive data readings, the memory controller will configure the data error flag information according to the error correction type corresponding to the data pre-written into the memory module, and then adjust the current error correction strategy level once. During a round of multiple consecutive data readings, it can be defined as the instability of the memory module during this period, and adjusting the current error correction strategy level based on this can prevent the stored data from being stored as erroneous data when it is unstable. Therefore, the data error flag information reflects the situation of reading data from the memory module for error detection (including the probability of memory failure, the number of times no erroneous data appears, etc.).
[0032] In this embodiment, each time data is written to the memory module, relevant information of the error correction strategy level and its encoding rules are attached. Therefore, each time data is read from the memory module, it is decoded and detected whether erroneous data occurs according to the decoding rules corresponding to the error correction strategy level called when the data is written.
[0033] In this embodiment, the data importance level, the operation load, and the data error flag information respectively support the adjustment of the current error correction strategy level. The data importance level, the operation load, and the data error flag information constitute three conditions for independently controlling the transformation of the current error correction strategy level, corresponding to three error correction strategies respectively. The memory controller analyzes these conditions to determine whether it is necessary to adjust the error correction strategy applicable to the current error correction strategy level, and can be divided into encoding rules and decoding rules. Each condition independently adjusts the current error correction strategy level, and each condition is a condition for the current error correction strategy level to advance the strategy, that is, each time a condition is met, the current error correction strategy level will be upgraded by at least one level, and it can be adjusted again on the basis of the error correction strategy level that has been adjusted once, so as to select different error correction strategy levels in turn as the adjusted current error correction strategy level, and realize the conversion between the error correction code corresponding to the current error correction strategy level and the error correction code corresponding to the different error correction strategy levels.
[0034] Compared with the prior art, the present application can adjust the current error correction strategy level a limited number of times based on some or all of the conditions among the data importance level, the operating load and the data error flag information, and the data importance level, the operating load and the data error flag information can adjust the current error correction strategy level in sequence, so that when a limited number of conditions undergo limited changes, the memory controller disclosed in the present application automatically switches the error correction strategy level and its corresponding error correction code, constrains the level type, switching time and encoding and decoding time of the current error correction strategy level switching, speeds up the automatic switching of the error correction code and reduces the power load relative to a single environmental factor, and the present application supports multiple adaptive adjustments to the current error correction strategy level within a relatively close period of time when data is written to the memory module, meets the storage security requirements of the memory module under different encoding and decoding times or different load operating environments, improves the reliability of data storage in the memory module, and ensures that the error correction code can reliably perform automatic verification of data.
[0035] As an embodiment, the method for the memory controller to adjust the current error correction strategy level according to the data importance level, the operation load and / or the data error flag information is as follows: The method for the memory controller to adjust the current error correction strategy level according to the data importance level includes: if the data importance level fed back to the memory controller by the central processing unit is increased, the memory controller will increase the current error correction strategy level, so that the error correction code corresponding to the increased error correction strategy level is converted into an error correction code for correcting more erroneous data bits; specifically, before the memory controller writes data to the memory module, if the central processing unit determines that the data importance level of the data used to write the memory module is increased, the central processing unit controls the data used to write the memory module to be increased from a non-important level to an important level, then the central processing unit sets the importance flag to a valid flag and feeds it back to the memory controller, in order to reduce the error correction strategy level switching time and encoding and decoding time and prevent the system power from suddenly increasing, the memory controller is triggered to control the current error correction strategy level to be increased by one level, and the error correction code encoded by the corresponding encoding rule is switched to an error correction code corresponding to the current error correction strategy level before the increase by one level, and corrects more erroneous data bits.
[0036] It is worth noting that if the current error correction strategy level has been upgraded according to the data importance level (corresponding to the memory controller being triggered to control the current error correction strategy level to be upgraded once when the importance flag position is a valid flag position), the current error correction strategy level will not be allowed to directly reach the preset maximum level. Instead, it is necessary to consider whether the running load can afford a higher power error correction strategy and the error situation of the memory module to further adjust the current error correction strategy level and its corresponding error correction code.
[0037] The method for the memory controller to adjust the current error correction strategy level according to the data importance level also includes: if the central processing unit determines that the data importance level of the data block to be written is reduced, the central processing unit controls the data used to write the memory module to be reduced from the importance level to the non-important level, then the importance flag is set to an invalid flag and fed back to the memory controller, triggering the memory controller to control the current error correction strategy level to be reduced by one level, thereby preventing the error correction strategy level switching time and encoding and decoding time from being too long, and the corresponding encoded error correction code is switched to an error correction code corresponding to the current error correction strategy level before being reduced once, which corrects fewer erroneous data bits, and reduces the redundant data bits that need to be processed.
[0038] The method for the memory controller to adjust the current error correction strategy level according to the data importance level also includes: if the central processing unit determines that the data importance level of the data block to be written has not changed, the central processing unit controls the data used to write to the memory module to remain unchanged by the importance level, and then does not feedback the importance flag to the memory controller, triggering the memory controller to control the current error correction strategy level to remain unchanged.
[0039] The method for adjusting the current error correction strategy level according to the operation load of the memory controller includes: if the operation load fed back by the central processing unit to the memory controller is reduced, the memory controller will increase the current error correction strategy level, so that the error correction code corresponding to the increased error correction strategy level is converted into an error correction code for correcting more erroneous data bits; specifically, when the operation load fed back by the central processing unit to the memory controller is reduced, for example, when it is reduced from the first load to the second load, the load flag is set as a valid flag and fed back to the memory controller, in order to control the error correction strategy level to switch in a short time and call the corresponding encoding and decoding rules for encoding and decoding and prevent the system power from suddenly increasing, the memory controller is triggered to control the current error correction strategy level to increase by one level, and the corresponding encoded error correction code is switched to an error correction code corresponding to the current error correction strategy level before the increase by one level, and corrects more erroneous data bits. It should be noted that since the operation load fed back by the central processing unit to the memory controller is reduced, the redundant data bits to be processed are reduced, so the problem of excessive working power / temperature caused by the increase of the current error correction strategy level can be suppressed.
[0040] The method for the memory controller to adjust the current error correction strategy level according to the operating load also includes: when the operating load fed back by the central processing unit to the memory controller increases, the load flag is set to an invalid flag and fed back to the memory controller, triggering the memory controller to control the current error correction strategy level to be reduced, and reducing the redundant data bits to be processed; specifically, when the operating load fed back by the central processing unit to the memory controller increases from the second load to the first load, in order to reduce power and encoding and decoding time and ensure a certain error correction security level, the memory controller is triggered to control the current error correction strategy level to be reduced by one level, instead of choosing to reduce too many levels so as not to damage the data storage security level of the memory module, the corresponding encoded error correction code is switched to an error correction code that corrects fewer erroneous data bits relative to the error correction code corresponding to the current error correction strategy level before being reduced by one level, and the redundant data bits to be processed are reduced, thereby reducing the operating power burden of the central processing unit.
[0041] It should be noted that the operating load can be collected at regular intervals, including monitoring and collecting the occupancy rate of the central processing unit in the system, the operating memory occupancy rate of the central processing unit, the number of currently running processor cores, the number of write / erase operation cycles and the temperature of the central processing unit, so as to feed back the operating status of the central processing unit; in some embodiments, temperature or power is used to quantify the operating load; when the temperature or power is greater than the corresponding threshold, it means that the operating load is too heavy, then the load flag is set to an invalid flag and fed back to the memory controller, triggering the memory controller to control the current error correction strategy level to be reduced once when the load is too heavy (the power temperature of the central processing unit is relatively high); when the temperature or power is less than or equal to the corresponding threshold, it means that the operating load is not too heavy, then the load flag is set to a valid flag and fed back to the memory controller, triggering the memory controller to control the current error correction strategy level to be increased once when the load is not too heavy (the power temperature of the central processing unit is relatively low).
[0042] The method for the memory controller to adjust the current error correction strategy level according to data error flag information includes: if the memory controller detects that the data error flag information is set to a valid flag bit, specifically, the invalid flag bit is flipped to a valid flag bit, the memory controller will increase the current error correction strategy level, and the increase and decrease frequency here is related to the time that the data error flag information is continuously kept set to a valid flag bit. In order to reflect the stable state of the memory module storing data in a recent period of time, the current error correction strategy level is controlled to be increased by only one level during the period when the data error flag information is set to a valid flag bit, so that the error correction code corresponding to the increased error correction strategy level is converted into an error correction code for correcting more erroneous data bits, thereby improving the security of the data stored in the memory module, allowing the memory module to subsequently store more reliable data, and reducing the error rate of reading data from the memory module at least in the recent period of time.
[0043] The method for the memory controller to adjust the current error correction strategy level according to data error flag information specifically includes: the memory controller reads data from the memory module, and then calls the decoding rule corresponding to the error correction strategy level (which may be the lowest error correction strategy level preset) based on which the read data was first stored in the memory module for decoding, and the encoding rule based on the same error correction strategy level was used when the data was first stored in the memory module; during decoding, it is detected whether erroneous data occurs, generally by comparing the data read and decoded at the same memory address with the data encoded according to the encoding rule corresponding to the same error correction strategy level. If the data bits involved in the comparison are different, it is detected that erroneous data occurs.
[0044] When the memory controller detects the occurrence of erroneous data, the data error flag information is set to a valid flag bit. Specifically, the data error flag information is flipped from an invalid flag bit to a valid flag bit. In order to shorten the encoding and decoding time and prevent the system power from suddenly increasing and increasing the operating load, the memory controller controls the current error correction strategy level to be upgraded by one level. After detecting the occurrence of erroneous data once, if no erroneous data is detected during the process of continuously reading data for a certain number of times, it can be understood that the number of consecutive detections of no erroneous data reaches the preset test number, then the data error flag information is set to an invalid flag bit, triggering the memory controller to control the current error correction strategy level to be lowered, and the redundant data bits that need to be processed are reduced.
[0045] Among them, in order to prevent the current error correction strategy level from being raised too high and thus increasing the operating burden and working power, in this embodiment, after detecting the occurrence of error data once, no matter how many times error data is detected in the process of continuously reading data for a certain number of times, the memory controller controls the current error correction strategy level to be raised by only one level, and then the memory controller controls the current error correction strategy level to remain unchanged, and can record the number of times that no error data appears within the reference error detection time. Thus, when the data error flag information is set to the valid flag bit, the current error correction strategy level is adjusted once every time the data is continuously read for a certain number of times, avoiding frequent changes in multiple error correction codes when the memory storage data is unstable (referring to a period of time from the time when the data error flag information changes from the invalid flag position to the valid flag position).
[0046] In some embodiments, the process of continuously reading data a certain number of times uses time quantified as a reference error detection time, and the reference error detection time is a time period closest to the latest read operation or write operation on the memory module, or the latest read operation or write operation on the memory module is within the reference error detection time (or understood as a period of time before the latest read operation or write operation). The time starting point of the reference error detection time is the moment when the data error flag information changes from an invalid flag position to a valid flag position.
[0047] Illustratively, when the certain number of times in the process of continuously reading data is 1000, the time consumed for continuously reading 1000 data bits is set as the reference error detection time, and the reference error detection time can be 10s. If no erroneous data is detected during multiple consecutive readings and error detections within 10s, the data error flag information is set to binary 0, and there is no need to control the current error correction strategy level to be increased; if erroneous data is detected during multiple consecutive readings and error detections within 10s, the data error flag information is kept set to binary 1, indicating that an error event exists in the 1000 data bits most recently read, and the memory module is currently unstable. In order to prevent the data transmitted during instability from being stored as erroneous data, the memory controller controls the current error correction strategy level to be increased.
[0048] To sum up, the higher the data importance level, the smaller the operating load, the more necessary it is to improve the current error correction strategy level to improve the security of data stored in the memory module; and the lower the data importance level, the greater the operating load, the more necessary it is to reduce the current error correction strategy level. The lower the current error correction strategy level, the fewer redundant data bits in the data that the corresponding error correction code needs to process, the shorter the encoding and decoding time, the lower the operating power, and can also ensure a certain degree of data storage security; and, after detecting the occurrence of erroneous data, the number of times the current error correction strategy level is increased is constrained by setting a process of continuously reading data for a certain number of times, so as to ensure the security of data stored in the memory module while also reducing the encoding and decoding time and operating power.
[0049] It should be noted that the method for detecting whether erroneous data occurs includes: the memory controller controls the encoding of the data to be written according to the encoding rules corresponding to the current error correction strategy level to obtain the encoded data, that is, the error correction code corresponding to the current error correction strategy level, wherein the current error correction strategy level may be obtained through the last adjustment or pre-set. Then the encoded data is written into the memory module, and the data to be written is also written into the memory module to facilitate comparison with the data subsequently read out.
[0050] If the memory controller reads the coded data from the memory module, the coded data is decoded according to the decoding rules corresponding to the current error correction strategy level to obtain a decoding result, wherein the read address of the coded data read from the memory module is the write address of the coded data written into the memory module; while reading the coded data from the memory module, it also supports reading the data to be written from the memory module. Then, the decoding result is compared to determine whether it is the same as the data to be written to determine whether erroneous data occurs, that is, to determine whether the decoding result is erroneous data.
[0051] If the decoding result is equal to the data to be written, it is detected that no erroneous data occurs, and it is determined that the memory module stores the data to be written without error; at this time, erroneous data is detected, indicating that the memory module already has risks in the process of storing / writing data in advance, so it is necessary to increase the current error correction strategy level to prevent subsequent data storage errors.
[0052] If the decoding result is not equal to the data to be written, it is detected that erroneous data occurs, and it is determined that an error occurs when the memory module stores the data to be written.
[0053] Based on the above embodiments, combined with Figure 2 It can be seen that the dynamic adjustment method is basically divided into the following steps: In step A, the memory controller receives the data importance level and operating load fed back by the central processing unit, and configures the data error flag information in the process of multiple error detections according to the error correction code called by the data pre-written into the memory module, and then enters step B. Therefore, each time step B is executed, the data importance level, operating load and data error flag information are determined in advance; wherein, the data importance level and operating load can both be obtained by real-time feedback from the central processing unit, and the specific influencing factors include one or more of the temperature, radiation dose, number of operating cores, number of read and write operation cycles, and operating occupancy rate during the operation of the central processing unit connected to the memory controller.
[0054] It should be noted that the data error flag information can be understood as repeatedly updating and configuring the data error flag information in step A through multiple consecutive error detections within a previously determined reference error detection time to identify the risk of erroneous data in the memory module. For example, within the previously determined reference error detection time, if no erroneous data appears in 1024 consecutive reads, it means that the memory module has no error risk, and there is no need to increase the current error correction strategy level, but rather choose to downgrade the current error correction strategy level.
[0055] Step B, the memory controller adjusts the current error correction strategy level according to the data importance level, the operating load and / or the data error flag information; then calls the encoding rule corresponding to the adjusted current error correction strategy level to encode the data to obtain the encoded data, wherein the error correction code corresponding to the adjusted current error correction strategy level is the encoded data; then writes the encoded data into the memory module, at which time, all associated information corresponding to the adjusted current error correction strategy level (which can be stored in each data bit in the form of additional information) can be written into the memory module; then executes step C.
[0056] Step C, the memory controller reads the coded data from the memory module, then decodes the coded data by calling the decoding rule corresponding to the adjusted current error correction strategy level, and detects whether erroneous data occurs to update the data error flag information, and then returns to execute step A. Specifically, while the memory controller reads the coded data from the memory module, it also calls the corresponding decoding rule according to the adjusted current error correction strategy level, so that it enters the corresponding decoding circuit in the memory controller, thereby selecting the corresponding decoding rule according to the adjusted current error correction strategy level, decoding the coded data, and detecting whether erroneous data occurs in the decoding result. If erroneous data occurs, it is corrected according to the error correction code corresponding to the adjusted current error correction strategy level to obtain reliable data and then transmit the reliable data to the central processing unit.
[0057] As for returning from step C to step A to repeatedly detect the data importance level, the operating load and the data error flag information, because the data importance level, the operating load and the data error flag information may change from time to time, and will change with the change of the data sequence / data block (collectively referred to as "data") sent by the central processing unit to the memory controller, it is necessary to return to step A for repeated judgment. Preferably, before returning to step B each time to adjust the current error correction strategy level to select the error correction strategy level required for the data to be written, the current error correction strategy level is first classified as an initial error correction strategy level, such as level 0, and then the current error correction strategy level is controlled to be raised or lowered from the initial error correction strategy level according to the data importance level, the operating load and / or the data error flag information, so that the subsequent step C performs data decoding and error detection by calling the error correction code corresponding to the adjusted current error correction strategy level.
[0058] In summary, by repeatedly executing steps A to C, based on real-time operating conditions such as the monitoring data importance level, operating load and the data error flag information, the current error correction strategy level is dynamically adjusted to adaptively select the most suitable error correction code for encoding and decoding, error correction and detection, thereby reducing the encoding and decoding time and the operating power of the central processing unit, and improving data storage security performance, thereby balancing system performance.
[0059] Preferably, before the memory controller starts writing data to the memory module for the first time, it is necessary to first set a reference error correction strategy level so as to subsequently adjust the error correction strategy level according to the data importance level, operating load and / or data error flag information, wherein the encoding rule corresponding to the reference error correction strategy level is predetermined, and the encoding rule corresponding to the reference error correction strategy level can be understood as being determined using historical data or empirical rule schemes, the error correction code corresponding to the reference error correction strategy level is configured to correct at least one erroneous data bit, and the error correction code corresponding to the reference error correction strategy level can select a Hamming check code.
[0060] Then, the encoding rules corresponding to the reference error correction strategy level are called to encode the data, and the encoded data is written into the memory module. The information corresponding to the reference error correction strategy level (recorded as strategy data) and the data (recorded as original data) can also be written into the memory module together to complete the first writing of data to the memory module. At this time, the reference error correction strategy level is equivalent to the current error correction strategy level before adjustment (before adjustment in step B).
[0061] After the memory controller starts writing data to the memory module for the first time, it needs to perform error detection by reading data; if the memory controller reads data from the memory module for the first time, the data read for the first time is decoded according to the decoding rules corresponding to the reference error correction strategy level to obtain the decoding result, and the original data is also read for comparison; it should be noted that the write address of the first writing of data to the memory module and the read address of the first reading of data from the memory module are the same. Then detect whether there is erroneous data in the decoding result, and update the reference error correction strategy level to the current error correction strategy level; also configure the data error flag information during the first writing and reading of data, and let the central processing unit monitor the data importance level and the operating load; then adjust the current error correction strategy level according to the data importance level, the operating load and / or the data error flag information respectively; so that after the first reading and writing operation is performed on the memory module, the current error correction strategy level is adjusted from the reference error correction strategy level according to the data importance level, the operating load and / or the data error flag information respectively.
[0062] As an embodiment, in the process in which the memory controller adjusts the current error correction strategy level according to the data error flag information, the embodiment includes: each time the memory controller reads data from the memory module, if error data is detected, the data error flag information is set to a valid flag bit and maintained as a valid flag bit to trigger the memory controller to upgrade the current error correction strategy level by one level, and the number of times no error data appears is cleared to zero, which means counting the number of times no error data appears starting from the value 0, and then, if no data error is detected and the data error flag information is set to a valid flag bit, the number of times no error data appears is counted, so that the memory controller starts counting the number of times no error data appears from zero in a round of multiple error detection stages, and during the counting of the number of times no error data appears, the data error flag information is maintained as a valid flag bit to indicate The memory module is prone to errors when storing data during this period, and does not continue to trigger the memory controller to upgrade the current error correction strategy level; until the number of consecutive times without erroneous data is counted to reach the preset test number, it is determined that the detection of no erroneous data is maintained during the process of reading data for a certain number of consecutive times, and the data error flag information is set to an invalid flag bit, and the current error correction strategy level is controlled to be lowered, that is, the current error correction strategy level after being upgraded by one level is controlled to be lowered, wherein the certain number of times is greater than or equal to the preset test number; at the same time, the number of times without erroneous data is stopped; until a data error is detected when other data bits are read subsequently, the number of times without erroneous data is cleared, and then the number of times without erroneous data is set to a valid flag bit, the above-mentioned statistical operations can be performed by a counter in the memory controller.
[0063] Whenever the data error flag information is flipped from an invalid flag bit to a valid flag bit, in the process of continuously reading data for a certain number of times, if no error data is detected, the memory controller keeps the current error correction strategy level unchanged. After counting the number of consecutive times when no error data appears reaches a preset test number, the current error correction strategy level is controlled to be lowered, that is, the current error correction strategy level after being raised by one level is controlled to be lowered, and can be further initialized to the initial error correction strategy level, so that the preset initial error correction strategy level is updated to the current error correction strategy level and is subsequently raised from the initial error correction strategy level when error data is re-detected.
[0064] It should be noted that the data read by the memory controller from the memory module is obtained by pre-encoding according to the encoding rules corresponding to the current error correction strategy level, and is regarded as the error correction code corresponding to the current error correction strategy level; wherein, the initial error correction strategy level is a pre-set error correction strategy level with the lowest level, so that each time the method of adjusting the current error correction strategy level according to the data importance level, operating load and / or data error flag information is executed, the adjustment starts from the initial error correction strategy level.
[0065] In schematic, 32 bits are set to correspond to an error correction code, then each time 32 bits are read from the memory module, it is a data bit reading event, and 1024 consecutive readings are 32Kb, that is, a 32Kb data block. If the preset test number is set to 1024 times, when the number of consecutive non-erroneous data reaches the preset test number, it is determined that no erroneous data appears in the read 32Kb data block, and then it is determined that no erroneous data is detected in the process of continuously reading data for a certain number of times; and in the process of continuously reading data for a certain number of times (corresponding to the time of continuously reading 32 bits for 1024 times), if erroneous data is detected, the data error flag information is set to a valid flag bit and maintained as a valid flag bit to trigger the memory controller to upgrade the current error correction strategy level once, and the number of times that no erroneous data appears is cleared. Among them, the data error flag information is a register flag bit, which can be stored in the form of a data bit. After error detection, each read data / data bit is attached with an error mark signal.
[0066] As an embodiment, based on the specific operations provided in the above-mentioned embodiments, this embodiment, in the process of adjusting the current error correction strategy level according to the data error flag information, also includes: after detecting the occurrence of erroneous data, the memory controller continues to detect errors in the process of continuously reading data for a certain number of times, and when erroneous data is detected, the data error flag information is set to a valid flag bit, but the memory controller can be triggered to control the current error correction strategy level to remain unchanged, wherein the data error flag information is set to an invalid flag bit in advance, and the corresponding current error correction strategy level is the initial error correction strategy level; and the number of times that no erroneous data occurs that needs to be counted is cleared to zero, and then, when it is detected that no data error occurs and the data error flag information is set to a valid flag bit, the number of times that no erroneous data occurs is counted, and the memory controller is not further triggered to upgrade the current error correction strategy level. Instead, it remains unchanged; until the number of consecutive times when no erroneous data appears reaches a preset number of tests, the data error flag information is set to an invalid flag bit, and the current error correction strategy level is controlled to be reduced by at least one level, and the current error correction strategy level can be further initialized to the initial error correction strategy level; at the same time, the number of times when no erroneous data appears is stopped; until erroneous data is detected again, the data error flag information is set to a valid flag bit, and the memory controller is triggered to increase the current error correction strategy level by one level, and the number of times when no erroneous data appears is cleared to zero, so as to start detecting whether erroneous data appears in the next round of continuous reading of data for a certain number of times, specifically, repeatedly executing the method of adjusting the current error correction strategy level according to the data importance level, the operating load and / or the data error flag information, corresponding to the aforementioned related embodiments, or equivalent to repeatedly executing Figure 2 Steps A to C described in .
[0067] Therefore, after the first occurrence of erroneous data and marking the data error flag information as a valid flag, the current error correction strategy level can be increased once, and the number of times that no erroneous data occurs can be counted; if no erroneous data occurs after a round of multiple error detections according to the error correction strategy level called by the data pre-written into the memory module, the data error flag information can be marked as an invalid flag, and the current error correction strategy level can be reduced by one level; if erroneous data is detected again during a round of multiple error detections according to the error correction strategy level called by the data pre-written into the memory module (or in the process of continuously reading data for a certain number of times), the current error correction strategy level can be controlled to remain unchanged, and the number of times that no erroneous data occurs can be cleared, and a round of multiple error detections can be performed again. In this way, the probability of data storage errors occurring in the memory module, that is, the probability of failure of the memory module, can be estimated by a cycle, and the memory controller records the error events of the memory module in the recent period of time, and adaptively adjusts the current error correction strategy level to automatically complete the conversion between error correction codes corresponding to different error correction strategy levels, thereby ensuring the reliability of data storage, shortening the encoding and decoding time, reducing the encoding and decoding power, and improving the read and write throughput of the memory module.
[0068] As an embodiment, the method for adjusting the current error correction strategy level according to the data importance level, the operation load and / or the data error flag information includes: when the memory controller writes data to the memory module, the memory controller adjusts the current error correction strategy level up to three times according to the data importance level, the operation load and the data error flag information, so that the memory controller calls the encoding rule corresponding to the adjusted current error correction strategy level to encode the data, and then stores the encoded data into the memory module; wherein the data importance level, the operation load and the data error flag information only support adjusting the current error correction strategy level at most once, then the current error correction strategy level is adjusted up to three times according to the data importance level, the operation load and the data error flag information; the adjustment is one increase, one unchanged or one decrease, and the specific action of the adjustment is selected according to the data importance level, the operation load and the data error flag information. Then, different error correction codes are dynamically called.
[0069] In some embodiments, if the current error correction strategy level is the initial error correction strategy level, after the memory controller reads data from the memory module, if erroneous data is detected, the initial error correction strategy level is controlled to be upgraded at most three times in succession according to the importance level of the data, the operating load and the data error flag information; if no erroneous data is detected, the data error flag information is set to an invalid flag, and then the initial error correction strategy level is controlled to be upgraded at most twice in succession according to the importance level of the data and the operating load; thereby increasing the current error correction strategy level incrementally between the three error correction strategy levels.
[0070] Specifically, the method in which the memory controller adjusts the current error correction strategy level three times according to the data importance level, the operating load and the data error flag information includes: first detecting that the data importance level has increased, for example, the central processing unit monitors that the data to be written has been upgraded from "non-important level" to "important level", then controlling the current error correction strategy level to increase by one level from the initial error correction strategy level to obtain the first error correction strategy level, otherwise choosing not to upgrade the initial error correction strategy level.
[0071] Then, if it is detected that the operating load has decreased, for example, the central processing unit monitors that its operating status has changed from "overloaded" to "not overloaded", the first error correction strategy level is increased by one level to obtain the second error correction strategy level, and excessive power consumption will not be increased due to the improvement of the security of data storage. Otherwise, it is chosen not to increase the first error correction strategy level, but to reduce the first error correction strategy level by one level.
[0072] Then, if it is detected that the data error flag information is set to a valid flag, the second error correction strategy level is increased by one level, which can be understood as an increase by one level after a period of time when no error occurs during the reference error detection time, and a third error correction strategy level is obtained. Otherwise, the second error correction strategy level is not increased, but is decreased by one level. In summary, the current error correction strategy level is adjusted three times.
[0073] It should be noted that the initial error correction strategy level is a preset lowest error correction strategy level.
[0074] The coding strength corresponding to the third error correction strategy level is greater than the coding strength corresponding to the second error correction strategy level, the coding strength corresponding to the second error correction strategy level is greater than the coding strength corresponding to the first error correction strategy level, and the coding strength corresponding to the first error correction strategy level is greater than the coding strength corresponding to the initial error correction strategy level. Therefore, the number of data bits supported for correction by the error correction code is, in order from small to large, the number of data bits supported for correction by the error correction code corresponding to the initial error correction strategy level, the number of data bits supported for correction by the error correction code corresponding to the first error correction strategy level, the number of data bits supported for correction by the error correction code corresponding to the second error correction strategy level, and the number of data bits supported for correction by the error correction code corresponding to the third error correction strategy level.
[0075] Preferably, the error correction code corresponding to the initial error correction strategy level is a parity check code; wherein, the parity check can only determine whether the data is erroneous, therefore, the current error correction strategy level applicable to the first execution of step B is the initial error correction strategy level, and when the parity check code is called to perform data encoding, at least the error detection result can be fed back for configuring and updating the data error flag information; although error correction cannot be performed, based on the stability problem of the memory module, starting from the second execution of step B, the initial error correction strategy level can be improved according to the data importance level, operating load and / or data error flag information to obtain an error correction code with stronger error correction capability, including an error correction code corresponding to the first error correction strategy level or a higher level of error correction strategy level.
[0076] The error correction code corresponding to the first error correction strategy level is the Hamming check code; the Hamming check code can correct 1-bit erroneous data. In an operating environment with a low level of weak radiation dose and write / erase operation cycles determined by the operating load, if the proportion of the number of error bits within the reference error detection time is less than 2 bits is 100%, the Hamming check code is used first.
[0077] The error correction code corresponding to the second error correction strategy level is the Reed-Slomon code (RS code for short); the Reed-Solomon code is a block code based on finite field polynomial operations, which can correct multiple erroneous data bits. Within a limited error range, the Reed-Solomon code can repair multiple types of error patterns, including a specific number of random or continuous burst errors. For example, in the case of needing to correct large-area misalignment in block-arranged data, in terms of the error correction capability of the error correction code used, the Reed-Slomon code is a higher-capability error correction code than the error correction code corresponding to the first error correction strategy level.
[0078] The error correction code corresponding to the third error correction strategy level is LDPC code or MDS code. The two error correction codes can be selected according to user needs; among them, LDPC code is a linear error correction code, and LDPC is suitable for image data storage and low-density data storage. LDPC code is mainly used to correct bit-level and random errors in codewords. LDPC code has strong error correction capabilities, especially in low signal-to-noise ratio environments, close to the Shannon limit. If the data to be written is general data and does not have sparsity, the error correction code uses MDS, which can correct random errors and continuous burst errors, but the data read at one time is large, and it needs to be operated with low operating load and without error data.
[0079] It should be noted that the error correction strategies corresponding to the aforementioned error correction strategy levels include different levels of coding strength, which are specifically used for the memory module to correct errors that occur during data storage. Therefore, this preferred example provides error correction codes corresponding to three error correction strategy levels (three error correction strategy levels with different coding strengths), which are suitable for the memory module to safely and reliably store and verify data in three different risk environments.
[0080] In combination with the method mentioned in the above embodiment, the memory controller adjusts the current error correction strategy level three times according to the data importance level, the operation load and the data error flag information, it can be known that the above selection method of the error correction code realizes the automatic conversion of the error correction code during the reading and writing process of the memory module, and can adaptively adjust the use of the error correction code according to the real-time monitored data importance level, the operation load and the data error flag information. Specifically, when the central processing unit monitors that the data to be written is at the "important level", it is equivalent to being in a low-risk stage, and the Hamming check code (low-complexity error correction code) corresponding to the first error correction strategy level is selected for data encoding and verification; or, when the central processing unit monitors that its operating state is "not too heavy" and the central processing unit monitors that the data to be written is at the "important level", it is equivalent to being in a low-risk stage, and the Reed-Slolmon code (an error correction code with higher error correction capability than the Hamming check code) corresponding to the second error correction strategy level can be selected for data encoding and verification. However, when the central processing unit detects that the data error flag information is set to a valid flag, based on the fact that the central processing unit monitors that its operating state is "not too heavy" and the central processing unit monitors that the data to be written is at an "important level", it is equivalent to being in a high-risk stage, and an LDPC code with higher error correction capability and relatively high complexity can be selected for data encoding and verification, thereby ensuring the reliability of stored data while reducing time and resource redundancy, and being able to ensure a certain data throughput rate.
[0081] The present application discloses a chip, which is used to execute the dynamic adjustment method; Figure 1As shown, the chip at least includes a central processing unit and a memory controller, and a memory module is arranged inside or outside the chip. The memory controller is connected to the central processing unit, and the memory controller is used to receive the data importance level and operation load fed back by the central processing unit; the memory controller is connected to the memory module, and the memory controller is used to perform data read and write operations on the memory module, and the data is from the central processing unit and the central processing unit detects the data importance level. The memory controller is used to adjust the current error correction strategy level according to the data importance level, the operation load and / or the data error flag information, so that the memory controller performs data verification by calling the error correction code corresponding to the adjusted current error correction strategy level; wherein the data error flag information is obtained by the memory controller through multiple data decoding and multiple error detection according to the error correction strategy level adopted by the data pre-written into the memory module, and whenever the data error flag information remains set as a valid flag bit within a period of the reference error detection time, the current error correction strategy level is adjusted once, and the current error correction strategy level can be reduced by one level, wherein the data error flag information is first set as a valid flag bit within a period of the reference error detection time. In combination with the embodiments related to the aforementioned dynamic adjustment method, the chip disclosed in the present application uses some or all of the monitored data importance level, operating load and data error flag information to perform multiple adjustments to the current error correction strategy level, thereby adaptively adjusting various error correction strategy levels for encoding storage and error detection feedback, which can free up a period of reading time when the chip memory storage is unstable to detect data errors in the data to be written, thereby taking the change frequency of the data error flag information as a benchmark to avoid frequent changes of multiple error correction codes when the memory storage data is unstable. Instead, the current error correction strategy level is dynamically adjusted in accordance with the data importance level and operating load, thereby alleviating failures of the memory module during data storage, and also improving the application flexibility of the error correction strategy level and its corresponding error correction code, and enhancing the environmental adaptability of the error correction and detection capabilities.
[0082] It should be noted that the process of the memory controller calling the encoding rule corresponding to the current error correction strategy level to encode data can be implemented in hardware through an error correction code encoding circuit, or an encoding program implemented in software. The memory module can be a storage device external to the chip or a memory space embedded in the chip, and is classified into flash memory, non-volatile memory, etc. in the memory type.
[0083] Inside the chip, Figure 2As shown, the memory controller includes an ECC encoding unit and an ECC decoding unit. The ECC encoding unit is used to encode the valid storage data according to the adjusted current error correction strategy level and call the corresponding encoding rules to obtain the encoded data, and then transmit the valid storage data, the encoded data block and the error correction strategy information to the memory module; wherein the error correction strategy information is used to represent the adjusted current error correction strategy level and its corresponding encoding rules, and the encoded data is the error correction code corresponding to the adjusted current error correction strategy level.
[0084] An ECC decoding unit is used to read the error correction strategy information, the encoded data block and the target payload data bit from the memory module, and then call the decoding rule corresponding to the adjusted current error correction strategy level based on the error correction strategy information, and then decode the encoded data block according to the decoding rule corresponding to the adjusted current error correction strategy level to obtain the decoded data bit.
[0085] The ECC decoding unit is also used to determine whether the decoded data bit is the same as the target payload data bit; when it is determined that the decoded data bit is the same as the target payload data bit, the decoded data bit is transmitted to the central processing unit; when it is determined that the decoded data bit is not the same as the target payload data bit, the decoded data bit is corrected according to the error correction code corresponding to the adjusted current error correction strategy level to obtain reliable data, and then the reliable data is transmitted to the central processing unit.
[0086] The error correction strategies corresponding to each error correction strategy level have encoding rules and decoding rules respectively; the error correction strategy used in the process of decoding a data is the error correction strategy used in encoding when storing the data.
[0087] It can be known from the embodiments related to the dynamic adjustment method that the timing process of writing data to the memory module schematically includes: At time T1, the importance flag Wd=0, the load flag Ws=1, the data error flag information We=0, and the current error correction strategy level adjusted at this time is 1 (corresponding to the first error correction strategy level disclosed in the aforementioned embodiment), and the strategy information is TACO1; the address ADDR1 to be written to the memory module is determined in advance; the ECC encoding unit in the memory controller encodes the data WDATA1 into the encoded data BM1, and the memory controller stores TACO1, BM1 and WDATA1 in the address ADDR1.
[0088] At time T2, the importance flag Wd=0, the load flag Ws=1, the data error flag information We=0, and the current error correction strategy level adjusted at this time is 1 (corresponding to the first error correction strategy level disclosed in the aforementioned embodiment), and the strategy information is TACO1; the address ADDR2 to be written to the memory module is determined in advance; the ECC encoding unit in the memory controller encodes the data WDATA2 into encoded data BM2, and the memory controller stores TACO1, BM2 and WDATA2 in the address ADDR2.
[0089] At time Tn, the importance flag Wd=1, the load flag Ws=1, the data error flag information We=0, and the current error correction strategy level adjusted at this time is 2 (corresponding to the second error correction strategy level disclosed in the aforementioned embodiment, which can be understood as the importance flag Wd is set from 0 to 1, and the first error correction strategy level is controlled to be increased by one level to obtain the second error correction strategy level), and the obtained strategy information is TACO2; the address ADDRN to be written to the memory module is determined in advance; the ECC encoding unit in the memory controller encodes the data WDATAN into the encoded data BMN, and the memory controller stores TACO2, BMN and WDATAN in the address ADDRN.
[0090] It can be known from the embodiments related to the dynamic adjustment method that the timing process of reading data from the memory module schematically includes: At time Tm, the address ADDR1 that the memory controller needs to read is determined in advance, and the memory controller reads TACO1, BM1 and WDATA1 from the address ADDR1 of the memory module, and determines that the current error correction strategy level required for decoding is 1 according to TACO1, that is, the first error correction strategy level is determined; the ECC decoding unit decodes BM1 according to the first error correction strategy level, and obtains DATA1 through decoding. During decoding, it determines whether DATA1 is the same as WDATA1 to determine whether erroneous data occurs; if DATA1 is different from WDATA1, the data error flag information We is set to 1.
[0091] At time Tm+1, the address ADDR2 that the memory controller needs to read is determined in advance, and the memory controller reads TACO1, BM2 and WDATA2 from the address ADDR2 of the memory module, and determines that the current error correction strategy level required for decoding is 1 according to TACO1, that is, the first error correction strategy level is determined; the ECC decoding unit decodes BM2 according to the first error correction strategy level, and decodes to obtain DATA2. During decoding, it determines whether DATA2 is the same as WDATA2 to determine whether erroneous data occurs; if DATA2 is not the same as WDATA2, the data error flag information We is set to 1.
[0092] At time Tm+N, the address ADDRN that the memory controller needs to read is determined in advance, and the memory controller reads TACO2, BMN and WDATAN from the address ADDRN of the memory module, and determines that the current error correction strategy level required for decoding is 2 according to TACO1, that is, the second error correction strategy level is determined; the ECC decoding unit decodes BMN according to the second error correction strategy level, and obtains DATAN through decoding. During decoding, it is determined whether DATAN is the same as WDATAN to determine whether erroneous data occurs; if DATAN is different from WDATAN, the data error flag information We is set to 1.
[0093] The device implementation described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present implementation scheme. Those of ordinary skill in the art may understand and implement it without creative work.
Claims
1. A dynamic adjustment method based on error correction code, characterized in that: include: The memory controller adjusts the current error correction strategy level according to the data importance level, the operation load and / or the data error flag information, so as to perform verification by calling the error correction code corresponding to the adjusted current error correction strategy level; wherein the data importance level, the operation load and the data error flag information respectively support adjusting the current error correction strategy level, so as to select different error correction strategy levels in turn as the adjusted current error correction strategy level, and realize conversion between the error correction code corresponding to the current error correction strategy level and the error correction code corresponding to the different error correction strategy levels; Among them, the operating load and data importance level are both fed back externally to the memory controller; The memory controller is configured to obtain the data error flag information during multiple error detection processes according to the error correction strategy level adopted by the data pre-written into the memory module.
2. The dynamic adjustment method according to claim 1, characterized in that: The method for the memory controller to adjust the current error correction strategy level according to the data importance level, the operation load and / or the data error flag information includes: If the importance level of the data fed back by the central processing unit to the memory controller increases, the memory controller increases the current error correction strategy level, so that the error correction code corresponding to the increased error correction strategy level is converted into an error correction code for correcting more erroneous data bits; and / or, if the operating load fed back by the central processing unit to the memory controller is reduced, the memory controller increases the current error correction strategy level, so that the error correction code corresponding to the increased error correction strategy level is converted into an error correction code for correcting more erroneous data bits; And / or, if the memory controller detects that the data error flag information is set to a valid flag, the memory controller upgrades the current error correction strategy level so that the error correction code corresponding to the upgraded error correction strategy level is converted into an error correction code for correcting more erroneous data bits.
3. The dynamic adjustment method according to claim 2, characterized in that: Before the memory controller writes data to the memory module, if the central processing unit determines that the data importance level of the data to be written into the memory module is increased, the importance flag is set to a valid flag and fed back to the memory controller, triggering the memory controller to control the current error correction strategy level to be increased by one level; If the central processing unit determines that the data importance level of the data to be written is reduced, the importance flag is set to an invalid flag and fed back to the memory controller, triggering the memory controller to control the current error correction strategy level to be reduced by one level; And / or, when the operating load fed back by the central processing unit to the memory controller decreases, the load flag is set to a valid flag and fed back to the memory controller, triggering the memory controller to control the current error correction strategy level to increase by one level; when the operating load fed back by the central processing unit to the memory controller increases, the load flag is set to an invalid flag and fed back to the memory controller, triggering the memory controller to control the current error correction strategy level to decrease by one level; and / or, the memory controller reads data from the memory module and detects whether erroneous data occurs; When erroneous data is detected, the data error flag information is set to a valid flag bit, and the current error correction strategy level is controlled to be increased once; after erroneous data is detected once, if no erroneous data is detected during a certain number of consecutive data readings, the data error flag information is set to an invalid flag bit, triggering the memory controller to control the current error correction strategy level to be lowered, so that after the data error flag information is flipped from an invalid flag bit to a valid flag bit, the current error correction strategy level is adjusted once every certain number of consecutive data readings.
4. The dynamic adjustment method according to claim 3, characterized in that: The method for detecting whether erroneous data occurs comprises: The memory controller controls the encoding of the data to be written according to the encoding rule corresponding to the current error correction strategy level, obtains the encoded data, and then writes the encoded data into the memory module; if the memory controller reads the encoded data from the memory module, the memory controller decodes the read encoded data according to the decoding rule corresponding to the current error correction strategy level to obtain a decoding result; If the decoding result is equal to the data to be written, it is detected that no erroneous data occurs; If the decoding result is not equal to the data to be written, it is detected that erroneous data occurs.
5. The dynamic adjustment method according to claim 3, characterized in that: Before the memory controller starts writing data to the memory module for the first time, the memory controller first sets a reference error correction strategy level, wherein the encoding rule corresponding to the reference error correction strategy level is predetermined; then the encoding rule corresponding to the reference error correction strategy level is called to encode the data, and then the encoded data is written to the memory module to complete the first writing of data to the memory module; If the memory controller reads data from the memory module for the first time, the data read for the first time is decoded according to the decoding rule corresponding to the reference error correction strategy level to obtain a decoding result; then the decoding result is detected whether erroneous data appears, and the reference error correction strategy level is updated to the current error correction strategy level; then the current error correction strategy level is adjusted according to the data importance level, the operating load and / or the data error flag information; Wherein, a write address for writing data to the memory module for the first time and a read address for reading data from the memory module for the first time are the same; Among them, the encoding rules corresponding to the reference error correction strategy level are called to encode the data, and the encoded data obtained is the error correction code corresponding to the reference error correction strategy level, and the error correction code corresponding to the reference error correction strategy level is configured to correct at least one erroneous data bit.
6. The dynamic adjustment method according to claim 3, characterized in that: The process in which the memory controller adjusts the current error correction strategy level according to the data error flag information includes: Each time the memory controller reads data from the memory module, if error data is detected, the data error flag information is set to a valid flag bit and maintained as a valid flag bit to trigger the memory controller to upgrade the current error correction strategy level by one level, and the number of times that no error data appears is cleared to zero; then, if no data error is detected and the data error flag information is set to a valid flag bit, the number of times that no error data appears is counted until the number of consecutive times that no error data appears reaches a preset test number, then it is determined that no error data is detected in the process of continuously reading data for a certain number of times, and the data error flag information is set to an invalid flag bit, and the current error correction strategy level is controlled to be lowered, and the number of times that no error data appears is stopped; wherein the certain number of times is greater than or equal to the preset test number; Whenever the data error flag information is flipped from an invalid flag bit to a valid flag bit, if no error data is detected during the process of continuously reading data for a certain number of times, the memory controller keeps the current error correction strategy level unchanged; The data read by the memory controller from the memory module is pre-encoded according to the encoding rules corresponding to the current error correction strategy level.
7. The dynamic adjustment method according to claim 6, characterized in that: After detecting the occurrence of erroneous data, if the memory controller detects the occurrence of erroneous data again during the process of continuously reading data for a certain number of times, the data error flag information is set to a valid flag bit but the current error correction strategy level is kept unchanged, and the number of times that no erroneous data occurs that needs to be counted is cleared to zero. Then, when it is detected that no data error occurs and the data error flag information is set to a valid flag bit, the number of times that no erroneous data occurs is counted until the number of consecutive times that no erroneous data occurs reaches a preset test number, the data error flag information is set to an invalid flag bit, and the current error correction strategy level is controlled to be reduced by one level, and the number of times that no erroneous data occurs is stopped at the same time, until the occurrence of erroneous data is detected again, and then the data error flag information is set to a valid flag bit, and the number of times that no erroneous data occurs is cleared to zero, so as to start detecting whether erroneous data occurs in the next round of continuous reading of data for a certain number of times.
8. The dynamic adjustment method according to claim 1, characterized in that: The method for the memory controller to adjust the current error correction strategy level according to the data importance level, the operation load and / or the data error flag information includes: When the memory controller writes data to the memory module, the memory controller adjusts the current error correction strategy level at most three times according to the data importance level, the operating load and the data error flag information, so that the memory controller calls the encoding rule corresponding to the adjusted current error correction strategy level to encode the data, and then stores the encoded data into the memory module; Among them, the data importance level, the operation load and the data error flag information only support adjusting the current error correction strategy level at most once; The encoding rule corresponding to the adjusted current error correction strategy level is called to encode the data, and the encoded data is an error correction code corresponding to the adjusted current error correction strategy level.
9. The dynamic adjustment method according to claim 8, characterized in that: The method for the memory controller to adjust the current error correction strategy level three times according to the data importance level, the operation load and the data error flag information successively includes: First, if the importance level of the data is increased, the current error correction strategy level is increased by one level from the initial error correction strategy level to obtain a first error correction strategy level; wherein the initial error correction strategy level is a preset level and is the lowest error correction strategy level; Then, if it is detected that the operating load is reduced, the first error correction strategy level is increased by one level to obtain a second error correction strategy level; Then, if it is detected that the data error flag information is set to a valid flag, the second error correction strategy level is increased by one level to obtain a third error correction strategy level, thereby achieving three adjustments to the current error correction strategy level.
10. The dynamic adjustment method according to claim 9, characterized in that: The error correction code corresponding to the initial error correction strategy level is a parity check code; The error correction code corresponding to the first error correction strategy level is a Hamming check code; The error correction code corresponding to the second error correction strategy level is the Reed-Slolmon code; The error correction code corresponding to the third error correction strategy level is an LDPC code or an MDS code.
11. A chip, characterized in that: The chip is used to execute the dynamic adjustment method according to any one of claims 1 to 10; The chip at least includes a central processing unit and a memory controller, and a memory module is arranged inside or outside the chip; The memory controller is connected to the central processing unit, and the memory controller is used to receive the data importance level and operation load fed back by the central processing unit; The memory controller is connected to the memory module, and the memory controller is used to perform data reading and writing operations on the memory module; The memory controller is used to adjust the current error correction strategy level according to the data importance level, the operation load and / or the data error flag information.
12. The chip according to claim 11, characterized in that: The memory controller includes an ECC encoding unit and an ECC decoding unit; An ECC encoding unit, configured to encode valid storage data according to the adjusted current error correction strategy level by calling corresponding encoding rules to obtain encoded data, and then transmit the valid storage data, the encoded data block and the error correction strategy information to the memory module; wherein the error correction strategy information is used to indicate the adjusted current error correction strategy level and its corresponding encoding rules, and the encoded data is the error correction code corresponding to the adjusted current error correction strategy level; An ECC decoding unit, configured to read the error correction strategy information, the encoded data, and the valid storage data from a memory module, and then call a decoding rule corresponding to the adjusted current error correction strategy level based on the error correction strategy information, and then decode the encoded data according to the decoding rule corresponding to the adjusted current error correction strategy level to obtain decoded data; The ECC decoding unit is also used to determine whether the decoded data is the same as the valid stored data; when it is determined that the decoded data is the same as the valid stored data, the decoded data is transmitted to the central processing unit; when it is determined that the decoded data is not the same as the valid stored data, the decoded data is corrected according to the error correction code corresponding to the adjusted current error correction strategy level to obtain reliable data, and then the reliable data is transmitted to the central processing unit.
Citation Information
Cited By
Vehicle configuration word writing method and device
CN119046996A
Error correction method and device of NAND FLASH controller and flash memory
CN119645306A
Hard disk data processing method and device, electronic equipment and storage medium
CN120832100A
Processing method for resisting single event upset for avionics equipment
CN121785836A
Data verification method based on error correction code
CN121996467A
