Dynamic data error correction method and system for single-chip microcomputer Flash memory
Patent Information
- Application Number
- CN202511120880.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2045-08-12
AI Technical Summary
[0003]申请号为202311089214.6的发明专利申请中公开了一种Flash存储器的存储空间管理方法,存储空间等分为N个扇区,N个扇区被划分为数据区、数据隔离区、索引区和系统参数区,数据隔离区设置于数据区、索引区之间,索引区的总存储容量与数据区的扇区数的地址量相匹配;在启动所述F1ash存储器时,执行以下步骤:步骤201:从索引区最大地址开始逆向查找数据区存储最后一次数据包时使用的扇区步骤202:根据扇区号确定对应的扇区,并从扇区的最后地址开始逆向查找最后一次存储数据包的存储地址;步骤203:根据接收到的指令,判断待执行操作;若确定待执行操作是写入数据,则执行写入数据程序;若确定待执行操作是读取数据,则执行读取数据程序,该申请旨在解决“目前的Flash存储方案采用内部Flash剩余空间进行历史数据存储,内部Flash空间较小,存储数据量有限,不能满足运行的数据记录要求;内部Flash主要作为程序存储空间使用,在进行程序的擦除和下载操作时,因程序大小的变化或操作失误,可能造成历史数据的丢失,同时,对历史数据进行擦除和保存时,可能造成内部Flash的程序丢失;目前的Flash存储方案也不能解决因意外掉电造成F1ash擦写失败,而导致的Flash数据异常情况;另外,目前Flash存储方案索引区设计复杂,占用空间大,空间利用率不高”的问题
本发明提供单片机Flash存储器的动态数据纠错方法及系统,该方法及系统在执行过程中,依据数据自身属性灵活调整核验码的配置与插入方式,在数据向Flash存储器传输过程中,通过精准的检验机制识别错误,再结合针对性处理纠正错误,保障数据准确性,同时,其可适配不同字符数量等属性的数据,无需因数据特征差异调整整体机制,适用范围广泛,有效提升了单片机Flash存储器数据存储的可靠性与稳定性,让数据的动态传输与存储更贴合实际应用中多样的数据场景需求。
Smart Images

Figure CN120977364B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a method and system for dynamic data error correction in a microcontroller Flash memory. Background Technology
[0002] The purpose of dynamic data error correction in microcontroller Flash is to detect errors caused by interference and aging of stored data, automatically repair single-bit errors, and alert to multi-bit errors, thereby ensuring data integrity.
[0003] Patent application number 202311089214.6 discloses a storage space management method for a Flash memory. The storage space is divided into N sectors, which are further divided into a data area, a data isolation area, an index area, and a system parameter area. The data isolation area is located between the data area and the index area. The total storage capacity of the index area matches the address of the number of sectors in the data area. When the Flash memory is started, the following steps are executed: Step 201: Starting from the maximum address of the index area, search backwards for the sector used when storing the last data packet in the data area; Step 202: Determine the corresponding sector based on the sector number, and start from the last address of the sector to search backwards for the storage address of the last stored data packet; Step 203: Determine the operation to be executed based on the received instruction; if the operation to be executed is to write data, then execute the data writing procedure. Preface; If it is determined that the operation to be performed is reading data, then the data reading program is executed. This application aims to solve the problems that "current Flash storage solutions use the remaining space of internal Flash for historical data storage. The internal Flash space is small and the amount of data stored is limited, which cannot meet the data recording requirements of operation; the internal Flash is mainly used as program storage space. When performing program erasure and download operations, historical data may be lost due to changes in program size or operational errors. At the same time, when erasing and saving historical data, the program in the internal Flash may be lost; current Flash storage solutions also cannot solve the Flash data abnormality caused by Flash erase / write failure due to unexpected power failure; in addition, the current Flash storage solution has a complex index area design, occupies a large space, and has low space utilization."
[0004] However, for dynamic data error correction of microcontroller Flash memory, the various existing error correction technologies for microcontroller Flash memory are scenario-dependent and it is difficult to cover all application scenarios with a single technology. This limitation stems from the inherent contradictions in core indicators such as error correction capability, hardware overhead, real-time performance, and power consumption, as well as the differentiated requirements for reliability, cost, and performance in different scenarios. To address this, a dynamic data error correction method and system for microcontroller Flash memory are proposed. Summary of the Invention
[0005] In view of the above-mentioned shortcomings of the existing technology, the present invention provides a dynamic data error correction method and system for single-chip microcomputer flash memory, which can effectively solve the problems of the existing technology.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions; This invention discloses a dynamic data error correction system for a microcontroller Flash memory, comprising: The system comprises the following modules: a monitoring module for monitoring the attributes of data sent by the data sender and configuring the number of verification codes based on these attributes; an insertion module for obtaining the verification code configuration results from the monitoring module and inserting the verification codes into the data; a transmission module for receiving data with inserted verification codes from the insertion module and performing a transmission operation to the Flash memory; a verification module for reading data received from the Flash memory, retrieving suspected verification codes from the data, comparing the suspected verification codes with the actual verification codes, and verifying whether the data received from the Flash memory contains errors; a collection module for collecting erroneous data when the verification module detects erroneous data, and retrieving the source data corresponding to each collected erroneous data; and a query and correction module for receiving the source data obtained from the collection module based on the collected erroneous data, retrieving the data corresponding to the source data from the data where the verification code insertion operation was performed during the insertion module's operation, and using the retrieved data as the target for error correction processing.
[0007] Furthermore, the data sending end is a sensor or unit on the device that monitors the device's operating data, and the Flash memory is deployed on the device's control panel, where the data sent by the data sending end is received and displayed. The data attributes include the number of characters contained in the data. When configuring a verification code for the data based on the data attributes, the following rules apply: ; In the formula: The number of characters contained in the data; The preset threshold; Each data entry has a text annotation at the end, and the data is then judged based on the above conditions. The text annotation is the number of characters in the data. If the number of characters in the data meets condition (1), the configured verification code length is the number of character intervals in the data plus 2. If the number of characters in the data meets condition (2), the configured verification code length is the number of intervals between adjacent groups of characters in the data, with each group consisting of two characters. If the number of characters in the data meets condition (3), the configured verification code length is the number of intervals between adjacent groups of characters in the data, with each group consisting of two characters plus 2.
[0008] Furthermore, during the insertion module's operation, the system defines a custom verification code and, upon receiving data, extracts a corresponding number of bits from the left end of the verification code based on its configured verification code bit length. This verification code segment is then used as the verification code for the data to perform the insertion operation. When the data meets the conditions, if the data meets the conditions (1), the verification codes configured for each character in the data are inserted in sequence at the interval positions and the left and right ends; if the data meets the conditions (2), the verification codes are inserted in sequence at the positions of every two characters in the data; if the data meets the conditions (3), the verification codes are inserted in sequence at the positions of every two characters in the data. The system-defined verification code is always longer than the verification code configured by the monitoring module for the data. The verification code consists of text, numbers, and punctuation marks.
[0009] Furthermore, during the operation of the transmission module, the data with the inserted verification code is acquired, the data with the inserted verification code is converted into a digital signal according to a preset conversion logic, and then transmitted to the Flash memory; The preset conversion logic includes: binary, octal, decimal, and hexadecimal; The Flash memory receives digital signals, restores them to data, and displays them on the control panel where the Flash memory is located.
[0010] Furthermore, the lower level of the verification module is provided with a pickup unit and a comparison unit. The pickup unit is used to pick up the data content at the corresponding position in the data obtained from the digital signal recovery according to the verification code insertion logic corresponding to conditions (1), (2), and (3), and arrange and reorganize the data content according to the pickup order to obtain three sets of suspected verification codes. The comparison unit is used to obtain the suspected verification codes in the pickup unit and retrieve the system-defined verification codes in the insertion module, and perform the following comparison to determine whether there are any verification codes inserted into the data during the operation of the insertion module in the suspected verification codes: ; In the formula: These are three suspected verification codes obtained by rearranging and recombining data content based on three conditions. Customize the verification code for the system. Based on the above comparison, three comparison results were obtained: (a), (b), and (c).
[0011] Furthermore, after the comparison results are obtained, it is determined whether there are any valid comparison results among the comparison results; No matching result indicates that there is an error in the data received by the Flash memory; When a valid comparison result exists, the valid comparison result is pointed to the corresponding position of each character in the suspected verification code in the system-side custom verification code. The identified corresponding positions are continuous, the valid comparison result is unique, and the number of characters in the suspected verification code is consistent with the number indicated by the text annotation at the end of the source data of the verification code. This indicates that the data received by the Flash memory is correct. If any one of the following three conditions is not met, it indicates that there is an error in the data received by the Flash memory: the corresponding positions are consecutive, the matching result is unique, and the number of characters in the suspected verification code is consistent with the number indicated by the text annotation at the end of the source data of the verification code.
[0012] Furthermore, when the collection module acquires the corresponding source data for each erroneous data, it follows the following rules: Extract suspected verification codes from the erroneous data, delete the suspected verification codes from the erroneous data, compare the similarity of the erroneous data obtained after deleting the suspected verification codes with the data transmitted by the transmission module, and record the data with the largest similarity comparison result as the source data of the erroneous data.
[0013] Furthermore, the error correction processing for the source data is as follows: In the query and error correction module, all retrieved data is used to build a dataset. The verification code insertion and transmission operations are re-executed for each data in the dataset, and the data is verified again until the verification result is correct. Then, the data with the correct verification result is deleted from the dataset. After the dataset is empty, the system is refreshed and put into operation to serve the transmission task of new data.
[0014] Furthermore, the monitoring module interacts with the insertion module via a wireless network, the insertion module interacts with the transmission module and the verification module via a wireless network, the verification module interacts with the pickup unit and the comparison unit via a wireless network, the comparison unit interacts with the insertion module via a wireless network, and the verification module interacts with the collection module and the query and error correction module via a wireless network.
[0015] On the other hand, the dynamic data error correction method for microcontroller Flash memory includes the following steps: The system monitors the attributes of the data sent by the data sender and configures the number of verification code bits for the data based on these attributes. It then sets a verification code, extracting a corresponding number of bits from the configured verification code, and records this as the application verification code for the data. The application verification code is inserted into the data, and the data with the inserted verification code is converted into a digital signal and transmitted to the Flash memory. After receiving the digital signal, the Flash memory restores it to the original data and extracts any suspected verification codes. These suspected verification codes are compared with the configured verification codes according to a preset logic to determine if they match. If they match, the data received by the Flash memory is correct; otherwise, the data received by the Flash memory is incorrect. All erroneous data is collected, and the corresponding data for each erroneous data point is queried among all data points where verification codes have been inserted. A dataset is created using the queried data as the retransmission target. Verification code insertion, transmission, and verification are performed again on each data point in the dataset. If verification passes, the data is deleted from the dataset. This process continues until the dataset becomes empty due to deletion, at which point the refresh step is executed.
[0016] Compared with the known prior art, the technical solution provided by this invention has the following beneficial effects: This invention provides a dynamic data error correction method and system for microcontroller Flash memory. During execution, the method and system flexibly adjust the configuration and insertion method of the verification code according to the data's own attributes. During data transmission to the Flash memory, errors are identified through a precise verification mechanism, and then targeted processing is used to correct the errors, ensuring data accuracy. At the same time, it can adapt to data with different character counts and other attributes, without needing to adjust the overall mechanism due to differences in data characteristics. It has a wide range of applications and effectively improves the reliability and stability of data storage in microcontroller Flash memory, making dynamic data transmission and storage more in line with the diverse data scenario needs in practical applications. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0018] Figure 1 A schematic diagram of the structure of a dynamic data error correction system for a microcontroller's Flash memory; Figure 2 A flowchart illustrating the dynamic data error correction method for a microcontroller's Flash memory. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0020] The present invention will be further described below with reference to embodiments. Example 1:
[0021] The dynamic data error correction system of the microcontroller Flash memory in this embodiment, such as Figure 1 As shown, it includes: The monitoring module is used to monitor the attributes of the data sent by the data sender and configure the number of verification codes based on the data attributes. The data transmitter is a sensor or unit on the device that monitors the device's operating data. The Flash memory is deployed on the device's control panel, which receives and displays the data sent by the data transmitter. Data attributes include the number of characters contained in the data. When configuring a verification code for data based on data attributes, the following rules apply: ; In the formula: The number of characters contained in the data; The preset threshold; Each data entry is marked with a text annotation at the end, and then the above conditions are used to determine the data. The text annotation is the number of characters in the data. If the number of characters in the data meets condition (1), the number of digits of the verification code is the number of character intervals in the data plus 2. If the number of characters in the data meets condition (2), the number of digits of the verification code is the number of intervals between adjacent groups of characters in the data, with each group consisting of two characters. If the number of characters in the data meets condition (3), the number of digits of the verification code is the number of intervals between adjacent groups of characters in the data, with each group consisting of two characters. The insertion module is used to obtain the verification code configuration result of the data in the monitoring module, and insert the verification code into the data based on the configuration result. During the insertion module's operation, the system defines a custom verification code. After receiving data, based on the configured number of bits in the verification code, it extracts a corresponding number of bits from the left end of the verification code and uses this verification code segment as the verification code for the data to perform the insertion operation. When the data meets the conditions, if the data meets the conditions (1), the verification codes configured for each character in the data are inserted in sequence at the interval positions and the left and right ends; if the data meets the conditions (2), the verification codes are inserted in sequence at the positions of every two characters in the data; if the data meets the conditions (3), the verification codes are inserted in sequence at the positions of every two characters in the data. Among them, the number of digits of the system-defined verification code is always greater than the number of digits of the verification code configured for the data by the monitoring module. The verification code consists of text, numbers, and punctuation marks. The transmission module is used to receive data with verification codes inserted in the insertion module and perform a transmission operation on the data with verification codes inserted to the Flash memory. During the operation of the transmission module, the data with the inserted verification code is acquired, the data with the inserted verification code is converted into a digital signal according to the preset conversion logic, and then transmitted to the Flash memory. The preset conversion logic includes: binary, octal, decimal, and hexadecimal; The Flash memory receives digital signals, restores the digital signals to data, and displays the data on the control panel where the Flash memory is located. The verification module is used to read the data received from the Flash memory, obtain the suspected verification code from the data, compare the suspected verification code with the verification code, and verify whether there are any errors in the data received from the Flash memory. The verification module is equipped with a pickup unit and a comparison unit. The pickup unit is used to pick up the data content at the corresponding position in the data obtained from the digital signal recovery according to the verification code insertion logic corresponding to conditions (1), (2), and (3), and arrange and reorganize the data content according to the pickup order to obtain three sets of suspected verification codes. The comparison unit is used to obtain the suspected verification codes in the pickup unit and retrieve the system-defined verification codes in the insertion module, and perform the following comparison to determine whether there are any verification codes inserted into the data during the operation of the insertion module in the suspected verification codes: ; In the formula: These are three suspected verification codes obtained by rearranging and recombining data content based on three conditions. Customize the verification code for the system. Based on the above comparison, three comparison results were obtained: (a), (b), and (c). After the comparison results are obtained, it is determined whether there are any valid comparison results among them. No matching result indicates that there is an error in the data received by the Flash memory; When a valid comparison result exists, the valid comparison result is pointed to the corresponding position of each character in the suspected verification code in the system-side custom verification code. The identified corresponding positions are continuous, the valid comparison result is unique, and the number of characters in the suspected verification code is consistent with the number indicated by the text annotation at the end of the source data of the verification code. This indicates that the data received by the Flash memory is correct. If any one of the following three conditions is not met, it indicates that there is an error in the data received by the Flash memory. The corresponding positions identified are continuous, the matching results are unique, and the number of characters in the suspected verification code is consistent with the number indicated by the text annotation at the end of the source data of the verification code. The collection module is triggered when the inspection module detects erroneous data, collects the erroneous data, and obtains the source data corresponding to each collected erroneous data. When the collection module obtains the corresponding source data for each error data, it follows the following rules: Extract suspected verification codes from the erroneous data, delete the suspected verification codes from the erroneous data, compare the similarity of the erroneous data obtained after deleting the suspected verification codes with the data transmitted by the transmission module, and record the data with the largest similarity comparison result as the source data of the erroneous data. The query and error correction module is used to receive source data obtained from the collection module based on the collected error data, retrieve the data corresponding to the source data from the data of the verification code insertion operation performed during the insertion module's running phase, and use the retrieved data as the target for error correction processing. The error correction process for the source data is as follows: In the query and error correction module, all retrieved data is used to build a dataset. The verification code insertion and transmission operations are re-executed for each data in the dataset, and the data is verified again until the verification result is correct. Then, the data with the correct verification result is deleted from the dataset. After the dataset is empty, the system is refreshed and put into operation to serve the transmission task of new data.
[0022] The monitoring module interacts with the insertion module via a wireless network. The insertion module interacts with the transmission module and the inspection module via a wireless network. The inspection module's subordinate units interact with the pickup unit and the comparison unit via a wireless network. The comparison unit interacts with the insertion module via a wireless network. The inspection module interacts with the collection module and the query and error correction module via a wireless network.
[0023] In this embodiment, the monitoring module monitors the data attributes sent by the data sending end, configures the number of verification codes for the data based on the data attributes, the insertion module runs after the monitoring module to obtain the verification code configuration result of the data in the monitoring module, inserts the verification code into the data based on the configuration result, the transmission module synchronously receives the data with the verification code inserted in the insertion module, performs the transmission operation of the data with the verification code inserted to the Flash memory, the verification module further reads the data received by the Flash memory, obtains the suspected verification code in the data, compares the suspected verification code with the verification code, and checks whether there is an error in the data received by the Flash memory, and the picking unit synchronously picks the data obtained from the digital signal recovery according to the verification code insertion logic corresponding to conditions (1), (2), and (3). The data content at the corresponding positions is sorted and reorganized according to the data content picking order to obtain three sets of suspected verification codes. The comparison unit obtains the suspected verification codes in the picking unit in real time and retrieves the system-defined verification codes in the insertion module. The following comparison is performed to determine whether there are any verification codes inserted into the data during the insertion module's operation. Then, the collection module is triggered to run when the inspection module's inspection result shows that there is erroneous data. The erroneous data is collected, and the source data corresponding to each collected erroneous data is obtained. Finally, the query and error correction module receives the source data obtained from the collection module based on the collected erroneous data. The data corresponding to the source data in the data from the data where the verification code insertion operation was performed during the insertion module's operation is retrieved, and the retrieved data is used as the target for error correction processing.
[0024] In the above embodiments, the system dynamically configures verification codes through data attributes, accurately embeds data, and transmits it to the Flash memory. Verification code comparison effectively identifies data errors, quickly locates the error source, and retrieves the corresponding source data for retransmission and error correction. This continuously ensures the accuracy of stored and displayed data, reduces deviations in device operation monitoring caused by data errors, improves the reliability of Flash memory data storage, and provides accurate data support for stable device operation.
[0025] The following example, using a system instance from the above embodiments, demonstrates the process of inserting a verification code into data: Data to be transmitted: "Indoor temperature 25℃"; The phrase "indoor temperature 25℃" contains 7 characters, where 7 < ; The verification code configured for "indoor temperature 25℃" is 8 digits. The preset verification code is: "3278, 231202, 3=49-09W83g+-113". The first 8 digits of the verification code segment "3278, 231" are extracted and inserted into "Indoor temperature 25℃" to represent: "3room2inner7temperature8degree,2253℃1". The expression “3rooms 2indoors 7temperature 8 degrees, 2253℃1” is converted from decimal to digital signal “51 23460 50 2086955 28201 56 24230 65292 50 50 53 51 8451 49”. Example 2:
[0026] At the implementation level, based on Example 1, this example refers to... Figure 2 The dynamic data error correction system for the microcontroller Flash memory in Example 1 will be further described in detail below: A dynamic data error correction method for a microcontroller's Flash memory includes the following steps: Monitor the attributes of the data sent by the data sender, and configure the number of verification code bits for the data based on the data attributes; Set a verification code. Based on the number of bits configured in the data verification code, extract a corresponding number of bits from the set verification code and record it as the application verification code for the data. The application verification code is inserted into the data, and the data with the application verification code is converted into a digital signal and transmitted to the Flash memory; After receiving the digital signal, the Flash memory restores the digital signal to data and extracts the suspected verification code from the data. The suspected verification code is then compared with the set verification code according to the preset logic to determine whether the verification codes are consistent. If they are consistent, it means that the data received by the Flash memory is correct; otherwise, it means that the data received by the Flash memory is incorrect. Collect all erroneous data, query the corresponding data of the erroneous data in all the data that have been inserted with verification codes, create a dataset with the query data as the retransmission target, and perform verification code insertion, transmission and verification again on each data in the dataset. If the verification is successful, delete the data from the dataset. Continue until the dataset becomes an empty set due to the deletion operation, and then execute the refresh step.
[0027] In summary, the methods and systems described in the above embodiments flexibly adjust the configuration and insertion method of the verification code based on the attributes of the data itself during execution. During the data transmission to the Flash memory, errors are identified through a precise verification mechanism, and then targeted processing is used to correct the errors, ensuring data accuracy. At the same time, it can adapt to data with different character counts and other attributes, without needing to adjust the overall mechanism due to differences in data characteristics. It has a wide range of applications and effectively improves the reliability and stability of data storage in the microcontroller's Flash memory, making the dynamic transmission and storage of data more in line with the diverse data scenario needs in practical applications.
[0028] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A dynamic data error correction system for a single-chip microcomputer Flash memory, characterized in that, include: The monitoring module is used to monitor the attributes of the data sent by the data sender and configure the number of verification codes based on the data attributes. The insertion module is used to obtain the verification code configuration result of the data in the monitoring module, and insert the verification code into the data based on the configuration result. The transmission module is used to receive data with verification codes inserted in the insertion module and perform a transmission operation on the data with verification codes inserted to the Flash memory. The verification module is used to read the data received from the Flash memory, obtain the suspected verification code from the data, compare the suspected verification code with the verification code, and verify whether there are any errors in the data received from the Flash memory. The collection module is triggered when the inspection module detects erroneous data, collects the erroneous data, and obtains the source data corresponding to each collected erroneous data. The query and error correction module is used to receive source data obtained from the collection module based on the collected error data, retrieve the data corresponding to the source data from the data of the verification code insertion operation performed during the insertion module's running phase, and use the retrieved data as the target for error correction processing.
2. The dynamic data error correction system for a single-chip microcomputer Flash memory according to claim 1, characterized in that, The data sending end is a sensor or unit on the device that monitors the device's operating data. The Flash memory is deployed on the device's control panel, where the data sent by the data sending end is received and displayed. The data attributes include the number of characters contained in the data. When configuring a verification code for the data based on the data attributes, the following rules apply: ; In the formula: The number of characters contained in the data; The preset threshold; Each data entry has a text annotation at the end, and the data is then judged based on the above conditions. The text annotation is the number of characters in the data. If the number of characters in the data meets condition (1), the configured verification code length is the number of character intervals in the data plus 2. If the number of characters in the data meets condition (2), the configured verification code length is the number of intervals between adjacent groups of characters in the data, with each group consisting of two characters. If the number of characters in the data meets condition (3), the configured verification code length is the number of intervals between adjacent groups of characters in the data, with each group consisting of two characters plus 2.
3. The dynamic data error correction system for a single-chip microcomputer Flash memory according to claim 2, characterized in that, During the operation of the insertion module, the system defines a custom verification code and, after receiving data, extracts a corresponding number of verification code bits from the left end of the verification code based on its configured verification code bit length. This verification code bit length is then used as the verification code for the data to perform the insertion operation. When the data meets the conditions, if the data meets the conditions (1), the verification codes configured for each character in the data are inserted in sequence at the interval positions and the left and right ends; if the data meets the conditions (2), the verification codes are inserted in sequence at the positions of every two characters in the data; if the data meets the conditions (3), the verification codes are inserted in sequence at the positions of every two characters in the data. The system-defined verification code is always longer than the verification code configured by the monitoring module for the data. The verification code consists of text, numbers, and punctuation marks.
4. The dynamic data error correction system for a single-chip microcomputer Flash memory according to claim 1, characterized in that, During the operation of the transmission module, the data with the verification code inserted is acquired, the data with the verification code inserted is converted into a digital signal according to a preset conversion logic, and then transmitted to the Flash memory. The preset conversion logic includes: binary, octal, decimal, and hexadecimal; The Flash memory receives digital signals, restores them to data, and displays them on the control panel where the Flash memory is located.
5. The dynamic data error correction system for a single-chip microcomputer Flash memory according to claim 2, characterized in that, The verification module is equipped with a pickup unit and a comparison unit. The pickup unit is used to pick up the data content at the corresponding position in the data obtained from the digital signal recovery according to the verification code insertion logic corresponding to conditions (1), (2), and (3), and arrange and reorganize the data content according to the pickup order to obtain three sets of suspected verification codes. The comparison unit is used to obtain the suspected verification codes in the pickup unit and retrieve the system-defined verification codes in the insertion module, and perform the following comparison to determine whether there are any verification codes inserted into the data during the operation of the insertion module in the suspected verification codes: ; In the formula: These are three suspected verification codes obtained by rearranging and recombining data content based on three conditions. Customize the verification code for the system. Based on the above comparison, three comparison results were obtained: (a), (b), and (c).
6. The dynamic data error correction system for a single-chip microcomputer Flash memory according to claim 5, characterized in that, After the comparison results are obtained, it is determined whether there are any valid comparison results among the comparison results; No matching result indicates that there is an error in the data received by the Flash memory; When a valid comparison result exists, the valid comparison result is pointed to the corresponding position of each character in the suspected verification code in the system-side custom verification code. The identified corresponding positions are continuous, the valid comparison result is unique, and the number of characters in the suspected verification code is consistent with the number indicated by the text annotation at the end of the source data of the verification code. This indicates that the data received by the Flash memory is correct. If any one of the following three conditions is not met, it indicates that there is an error in the data received by the Flash memory: the corresponding positions are consecutive, the matching result is unique, and the number of characters in the suspected verification code is consistent with the number indicated by the text annotation at the end of the source data of the verification code.
7. The dynamic data error correction system for a single-chip microcomputer Flash memory according to claim 1, characterized in that, When the collection module acquires the corresponding source data for each error data, it follows the following principle: Extract suspected verification codes from the erroneous data, delete the suspected verification codes from the erroneous data, compare the similarity of the erroneous data obtained after deleting the suspected verification codes with the data transmitted by the transmission module, and record the data with the largest similarity comparison result as the source data of the erroneous data.
8. The dynamic data error correction system for a single-chip microcomputer Flash memory according to claim 1, characterized in that, The error correction process for the source data is as follows: In the query and error correction module, all retrieved data is used to build a dataset. The verification code insertion and transmission operations are re-executed for each data in the dataset, and the data is verified again until the verification result is correct. Then, the data with the correct verification result is deleted from the dataset. After the dataset is empty, the system is refreshed and put into operation to serve the transmission task of new data.
9. The dynamic data error correction system for a single-chip microcomputer Flash memory according to claim 1, characterized in that, The monitoring module interacts with the insertion module via a wireless network. The insertion module interacts with the transmission module and the verification module via a wireless network. The lower level of the verification module interacts with the pickup unit and the comparison unit via a wireless network. The comparison unit interacts with the insertion module via a wireless network. The verification module interacts with the collection module and the query and error correction module via a wireless network.
10. A method for dynamic data error correction of a microcontroller Flash memory, wherein the method is an implementation method of the dynamic data error correction system for a microcontroller Flash memory as described in any one of claims 1-9, characterized in that, Includes the following steps: Monitor the attributes of the data sent by the data sender, and configure the number of verification code bits for the data based on the data attributes; Set a verification code. Based on the number of bits configured in the data verification code, extract a corresponding number of bits from the set verification code and record it as the application verification code for the data. The application verification code is inserted into the data, and the data with the application verification code is converted into a digital signal and transmitted to the Flash memory; After receiving the digital signal, the Flash memory restores the digital signal to data and extracts the suspected verification code from the data. The suspected verification code is then compared with the set verification code according to the preset logic to determine whether the verification codes are consistent. If they are consistent, it means that the data received by the Flash memory is correct; otherwise, it means that the data received by the Flash memory is incorrect. Collect all erroneous data, query the corresponding data of the erroneous data in all the data that have been inserted with verification codes, create a dataset with the query data as the retransmission target, and perform verification code insertion, transmission and verification again on each data in the dataset. If the verification is successful, delete the data from the dataset. Continue until the dataset becomes an empty set due to the deletion operation, and then execute the refresh step.
Citation Information
Patent Citations
Storage space management method of Flash memory and data read-write system
CN117194279A
Data error correction method and device for Nand Flash, electronic equipment and storage medium
CN111813591A
Error correction method and apparatus based on NAND flash memory
WO2021047472A1