A program block three-mode storage method based on verification
By dividing the program into small pieces and checking and comparison, the three-mode redundancy protection of the program is achieved when the aerospace-level chip resources are limited, solving the problem of large resource consumption of traditional methods and ensuring the on-orbit software Stable operation and single-particle protection effect.
Patent Information
- Application Number
- CN202111558182.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-12-20
AI Technical Summary
With limited resources of aerospace-grade chips, it is difficult to achieve full three-mode redundancy protection. The traditional EDAC or three-mode redundancy methods consume too much resources and cannot effectively deal with large programs running in the processor and program data stored in memory. Perform single-particle protection.
Divide the program into N program blocks, and check each program block. The checksum is updated in real time by comparing the main program, the backup program and the pre-calculated checksum. If the three are consistent, the operation will not be performed. If inconsistencies are incorrect, they will be corrected to achieve the three-mode redundancy protection of the program.
Effectively utilize limited resources, single-particle protection for large blocks of programs and data is achieved, ensuring stable operation of on-orbit software, and the resource occupies less than one thousandth of the traditional method. It is suitable for aerospace chips without EDAC functions.
Smart Images

Figure CN114253761B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of aerospace technology, and in particular to a verification-based three-mode storage method for program blocks. Background Art
[0002] The radiation effect of the space environment is one of the main causes of spacecraft anomalies and failures. The universe is filled with various forms of matter, such as plasma and charged particles of various energies, which may have harmful effects on spacecraft. The single particle effect is the most typical one. The single particle effect refers to the radiation effect caused by a single high-energy proton or heavy ion incident on an electronic component. It can be divided into: single particle flip, lock, burnout, gate breakdown, etc. according to different mechanisms. Usually, the single particle effect can be improved by strengthening the chip itself against radiation and strengthening the aircraft itself against radiation.
[0003] Common single-particle protection methods include EDAC, triple-mode redundancy, and timed refresh. Among them, the implementation principle of EDAC is to add some check codes to the transmitted data source code, so that the data source code and the check code establish a relationship according to certain rules. When an error occurs in the legal data encoding, the relationship between the data source code and the check code is destroyed, forming an illegal code, and the receiving end can detect the error by detecting the legality of the code until the error is corrected. Generally, aerospace-grade processors have built-in EDAC functions. If they do not have it, additional protection measures need to be configured.
[0004] Triple-mode redundancy means that the flags that have a significant impact on the program operation and the parameters or codes that play a key role in the operation structure are stored and voted on in triplicate. After the triple-mode voting, if a single particle is found to be overturned, the refresh program is started and the overturned bit is corrected using the triple-mode voting results. This method consumes a lot of resources, and the code redundancy reaches more than 2 / 3.
[0005] The above two methods are currently commonly used means to deal with single-particle effects on orbit. Depending on the type of chip and the resource allocation, a reasonable method can be selected for single-particle protection.
[0006] In actual use, as satellite functions become more and more powerful, the chip resource utilization rate has almost reached its limit. Limited by the limited resources of aerospace-grade chips, in order to achieve the complex functional performance of satellites, considering the satellite power consumption, heat consumption, and cost, it is often impossible to achieve full three-mode redundancy of on-orbit programs. Generally, when designing programs, priority is given to ensuring the three-mode redundancy of data in the program running area and key parameter storage area, while the code storage area, program loading and other links will be considered as secondary priorities. Therefore, when the aerospace-grade chip itself does not have the EDAC function, for large programs running in the processor, program data and important data stored in the memory, etc., a new, more effective, and less resource-intensive method is needed to replace the traditional method that requires a large amount of redundant resources to achieve EDAC or three-mode redundancy. Summary of the invention
[0007] In view of some or all of the problems in the prior art, the present invention provides a program block three-mode storage method based on verification, comprising:
[0008] Divide the program to be injected into N program blocks, and verify each program block to obtain a first checksum;
[0009] Injecting two programs to be injected and a first checksum into the program storage area, wherein the two injected programs to be injected are recorded as a main program and a backup program respectively;
[0010] Divide the main program into N program blocks, and during program execution, verify each program block to obtain a second checksum;
[0011] Dividing the backup program into N program blocks, and verifying each program block to obtain a third checksum; and
[0012] Compare the first checksum, the second checksum, and the third checksum:
[0013] If the three are consistent, no operation is performed; and
[0014] If the three are inconsistent, update the program or checksum and recheck.
[0015] Further, the first checksum and / or the second checksum and / or the third checksum are obtained by an exclusive-OR check.
[0016] Furthermore, the XOR check is performed every 32 bits, and the first checksum and / or the second checksum and / or the third checksum are an array of N*32 bits.
[0017] Furthermore, the program block three-mode storage method includes:
[0018] During program execution, a checksum comparison is performed each time a 32-bit checksum is generated.
[0019] Furthermore, the main program and the backup program are verified using independent verification modules respectively.
[0020] Further, the updating of the program or checksum includes:
[0021] If the first checksum is equal to the second checksum but not equal to the third checksum, comparing the main program and the backup program bit by bit, and correcting the backup program according to the main program;
[0022] If the first checksum is equal to the third checksum but not equal to the second checksum, comparing the main program and the backup program bit by bit, and correcting the main program according to the backup program;
[0023] If the second checksum is equal to the third checksum but not equal to the first checksum, correcting the first checksum according to the second checksum or the third checksum; and
[0024] If the first checksum, the second checksum and the third checksum are all different, reload all the software and perform the check again.
[0025] Furthermore, the updating of the program or checksum also includes:
[0026] If no differences are found when comparing the main program and the backup program bit by bit, reload the verification module and perform verification again.
[0027] Another aspect of the present invention provides a satellite that adopts the verification-based three-mode storage method of program blocks as described above.
[0028] The program block three-mode storage method based on verification provided by the present invention divides the program into program blocks, verifies each program block, compares the checksum values of the main program, the backup program and the pre-calculated on the ground, and then determines whether a single particle effect occurs. At the same time, the method can also update the erroneous program in real time to ensure the stable operation of the on-orbit software, and the overall method is simple and effective. Since the program is divided into small program blocks, the verification process and the subsequent checksum comparison operation account for a very small proportion of redundant resources, usually less than one thousandth. When the chip storage resources are insufficient, the method effectively utilizes limited resources to complete the three-mode protection of the code storage area, program loading, etc., and can be applied to aerospace chips without EDAC and with tight resources, meeting the single particle protection design requirements for large-block program storage / data storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] To further illustrate the above and other advantages and features of various embodiments of the present invention, a more specific description of various embodiments of the present invention will be presented with reference to the accompanying drawings. It will be understood that these drawings only depict typical embodiments of the present invention and are therefore not to be considered as limiting the scope thereof. In the accompanying drawings, for clarity, identical or corresponding parts will be represented by identical or similar reference numerals.
[0030] Figure 1 A flowchart of a verification-based three-mode storage method for program blocks according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0031] In the following description, the present invention is described with reference to various embodiments. However, those skilled in the art will recognize that various embodiments can be implemented without one or more specific details or with other replacement and / or additional methods, materials or components. In other cases, well-known structures, materials or operations are not shown or described in detail to avoid blurring the inventive point of the present invention. Similarly, for the purpose of explanation, specific quantities, materials and configurations are set forth to provide a comprehensive understanding of embodiments of the present invention. However, the present invention is not limited to these specific details. In addition, it should be understood that the various embodiments shown in the drawings are illustrative representations and are not necessarily drawn in correct proportions.
[0032] In this specification, reference to "one embodiment" or "the embodiment" means that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in at least one embodiment of the present invention. The phrase "in one embodiment" appearing in various places in this specification does not necessarily all refer to the same embodiment.
[0033] It should be noted that the embodiments of the present invention describe the steps in a specific order, but this is only for the purpose of illustrating the specific embodiment, rather than limiting the order of the steps. On the contrary, in different embodiments of the present invention, the order of the steps can be adjusted according to actual needs.
[0034] Since triple-mode redundancy consumes a lot of resources, it is usually difficult to perform full triple-mode redundancy on large programs running in the processor, program data stored in the memory, and important data in practical applications. This makes it difficult to effectively implement single-particle protection when the aerospace-grade chip itself does not have the EDAC function. Based on this, the present invention proposes a program block triple-mode storage method based on verification, which provides triple-mode redundancy, verification and refresh of codes for a program storage area that can only store two copies of code and has no EDAC function. It divides the program into N program blocks, calculates the checksum of each program block and the backup program, and then compares it with the checksum pre-calculated on the ground: if the three are consistent, no operation; and if the three are inconsistent, the update of the error module or checksum is achieved by taking two out of three. The scheme of the present invention is further described below in conjunction with the accompanying drawings of the embodiments.
[0035] Figure 1 FIG. 1 is a flow chart showing a method for storing program blocks in three modes based on verification according to an embodiment of the present invention. Figure 1 As shown, a program block three-mode storage method based on verification includes:
[0036] First, in step 101, program injection. Before program injection, the program to be injected is first divided into N program blocks, and each program block is checked to obtain a first checksum, and then the first checksum is injected into the program storage area together with the stored program. In an embodiment of the present invention, the program to be injected and the first checksum need to be injected twice into the program storage area, and the two injected programs to be injected are respectively recorded as the main program and the backup program; in an embodiment of the present invention, the program block is XOR-checked at every 32 bits;
[0037] Next, in step 102, program verification. The main program is divided into N program blocks, and during the program running, each program block is verified by the first verification module to obtain a second checksum. At the same time, the backup program is divided into N program blocks, and each program block is verified by the second verification module to obtain a third checksum. In one embodiment of the present invention, in order to avoid simultaneous errors in the checksum due to a single particle overturning, which affects subsequent results, the code content of the first verification module and the second verification module is the same, but it should occupy two independent spaces in the program to implement, which can also be understood as being completed by two independent functions respectively; in one embodiment of the present invention, each program block of the main program and the backup program is XOR-checked every 32 bits; and
[0038] Finally, in step 103, the checksum is compared. The first checksum, the second checksum and the third checksum are compared, and subsequent operations are performed according to the comparison results. In one embodiment of the present invention, if the first checksum, the second checksum and the third checksum are the same, it means that the software is running normally and no single particle event has occurred. At this time, no operation is performed; if the first checksum, the second checksum and the third checksum are inconsistent, it indicates that a single particle event may occur, and the program or checksum needs to be updated according to the specific results. Specifically:
[0039] If the first checksum is equal to the second checksum but not equal to the third checksum, it indicates that the checksum of the backup program may be overturned by a single particle. At this time, the main program and the backup program are compared bit by bit, and the backup program is corrected according to the main program. If no difference is found when comparing the main program and the backup program bit by bit, the verification module is reloaded and the verification is performed again.
[0040] If the first checksum is equal to the third checksum but not equal to the second checksum, it indicates that the checksum of the main program may be upset by a single particle. At this time, the main program and the backup program are compared bit by bit, and the main program is corrected according to the backup program. If no difference is found when comparing the main program and the backup program bit by bit, the verification module is reloaded and the verification is performed again.
[0041] If the second checksum is equal to the third checksum but not equal to the first checksum, it indicates that the injected first checksum may be upset by a single particle, and the first checksum is corrected according to the second checksum or the third checksum; and
[0042] If the first checksum, the second checksum and the third checksum are all different, it indicates that the program is wrong. At this time, reload all the software and check again.
[0043] In one embodiment of the present invention, during the stable operation of the satellite software, the checksum comparison is performed once after the checksum of each program block is completed, rather than after all program blocks of the main program and the backup program are checked. Specifically, it includes the following steps:
[0044] First, the program to be injected is divided into program block 1, program block 2, program block 3, ..., program block N on the ground, and then an XOR check is performed on each program block every 32 bits to obtain a set of N*32-bit checksum result array C = {c1, c2, c3c4, c5, ... cN}. The checksum result array C will be injected into the program storage area in the satellite chip together with the program to be injected;
[0045] Next, the program to be injected and the checksum result array C are injected twice into the program storage area in the satellite chip;
[0046] Next, the first program in the program storage area is used as the main program and divided into main program block 1, main program block 2, main program block 3, ..., main program block N. The second program in the program storage area is used as the backup program and divided into spare program block 1, spare program block 2, spare program block 3, ..., spare program block N. During the program running process, the first program checksum software module is called to perform XOR check on each main program block of the main program in the program storage area in real time at every 32 bits to generate a set of N*32-bit checksum result arrays A={a1, a2, a3, a4, a5, ..., aN}. During the stable operation of the satellite software, each time a 32-bit checksum ai (i=1, 2, ..., N) is generated, the second program checksum software module is called to perform XOR check on the corresponding backup program block of the backup program in the program storage area at every 32 bits to obtain the corresponding 32-bit checksum result bi. Then, the values of ai, bi and the corresponding ci are compared to see if the three are the same:
[0047] If ai=bi=ci, it means that the software is running normally and no single particle event has occurred. No operation is performed at this time;
[0048] If ai=ci≠bi, it indicates that the checksum of the backup program in the program storage area may be upset by a single particle. At this time, the main program and the backup program are compared bit by bit, and the backup program is corrected according to the main program. If no difference is found during the bit-by-bit comparison, the first and / or second program checksum software module is reloaded and checked again after loading;
[0049] If bi=ci≠ai, it indicates that the main program checksum in the program storage area may be overturned by a single particle. At this time, the main program and the backup program are compared bit by bit, and the main program is corrected according to the backup program. If no difference is found during the bit-by-bit comparison, the first and / or second program checksum software module is reloaded and checked again after loading;
[0050] If ai=bi≠ci, it indicates that the injected checksum data may be overturned by a single particle. In this case, the checksum value of ai or bi is rewritten into the storage space of ci, and subsequent checks are continued; and
[0051] If ai, bi, and ci are all different, it indicates that the program has run into an error. In this case, reload all the software, and then restart the program and verify it.
[0052] The program block three-mode storage method based on verification provided by the present invention divides the program into program blocks, verifies each program block, compares the checksum values of the main program, the backup program and the pre-calculated on the ground, and then determines whether a single particle effect occurs. At the same time, the method can also update the erroneous program in real time to ensure the stable operation of the on-orbit software, and the overall method is simple and effective. Since the program is divided into small program blocks, the verification process and the subsequent checksum comparison operation account for a very small proportion of redundant resources, usually less than one thousandth. When the chip storage resources are insufficient, the method effectively utilizes limited resources to complete the three-mode protection of the code storage area, program loading, etc., and can be applied to aerospace chips without EDAC and with tight resources, meeting the single particle protection design requirements for large-block program storage / data storage.
[0053] Although various embodiments of the present invention are described above, it should be understood that they are presented as examples only and not as limitations. It is obvious to those skilled in the relevant art that various combinations, modifications and changes can be made thereto without departing from the spirit and scope of the present invention. Therefore, the breadth and scope of the present invention disclosed herein should not be limited by the exemplary embodiments disclosed above, but should only be defined according to the attached claims and their equivalents.
Claims
1. A program block three-mode storage method based on verification, characterized in that: Includes steps: Divide the program to be injected into N program blocks, and verify each program block to obtain a first checksum; Inject the program to be injected and the first checksum twice into the program storage area, wherein the two injected programs are recorded as the main program and the backup program respectively; Dividing the main program into N program blocks, and checking each program block during program execution to obtain a second checksum; Dividing the backup program into N program blocks, and verifying each program block to obtain a third checksum; as well as The first checksum, the second checksum and the third checksum are compared, wherein: If the three are consistent, no operation will be performed; as well as If the three are inconsistent, update the program or checksum and recheck.
2. The program block three-mode storage method according to claim 1, characterized in that: The first checksum and / or the second checksum and / or the third checksum are obtained by an exclusive OR check.
3. The program block three-mode storage method according to claim 2, characterized in that: The XOR check is performed every 32 bits, and the first checksum and / or the second checksum and / or the third checksum are an array of N*32 bits.
4. The program block three-mode storage method according to claim 1, characterized in that: After each block of the main program is verified, a verification and comparison is performed.
5. The program block three-mode storage method according to claim 1, characterized in that: The main program and the backup program are verified using independent verification modules respectively.
6. The program block three-mode storage method according to claim 1, characterized in that: The updating of the program or checksum includes: If the first checksum is equal to the second checksum but not equal to the third checksum, comparing the main program and the backup program bit by bit, and correcting the backup program according to the main program; If the first checksum is equal to the third checksum but not equal to the second checksum, comparing the main program and the backup program bit by bit, and correcting the main program according to the backup program; If the second checksum is equal to the third checksum but not equal to the first checksum, correcting the first checksum according to the second checksum or the third checksum; and If the first checksum, the second checksum and the third checksum are all different, then all software is reloaded, and then re-run and re-checked.
7. The program block three-mode storage method according to claim 6, characterized in that: The updating of the program or checksum also includes: If no difference is found when comparing the main program and the backup program bit by bit, the verification module is reloaded and the verification is performed again after loading.
8. A satellite, characterized in that: A chip comprising a program block three-mode storage method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for detecting spatial single event upset of space-borne DSP (Digital Signal Processor) chip
CN102354294A
Triple modular redundancy information storage system for complex space environment and program burning and program boot-loading methods
CN106339282A
