Fault recovery method based on embedded operating system
By using checkpoint file structure and process relationship information in an embedded operating system for failure recovery, the problems of low failure recovery efficiency and high overhead in the existing technology are solved, and efficient failure recovery and correct process revolving are achieved.
Patent Information
- Application Number
- CN202411385841.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-30
AI Technical Summary
When existing embedded operating systems fail to recover, the system overhead of using status files for retrieval is high, the efficiency is not high, and the need to rewind all processes leads to low efficiency and high overhead.
Using the checkpoint file structure and the process method of setting the storage modification status by only volume-back, the process information is indexed and stored by using the checkpoint file, setting up multi-task collaborative checkpoints, and updating the checkpoint file Data and globally consistent revolving according to process relationship structure when failing to recover.
Improves the efficiency of fault recovery, reduces system overhead, and ensures the correctness of fault recovery and the handling of dependencies.
Smart Images

Figure CN119248577A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a fault recovery method based on an embedded operating system, belonging to the technical field of operating system fault processing. Background Art
[0002] Computer systems have been widely used in safety-critical fields such as aerospace. Once errors occur in such systems, serious consequences will occur. It is extremely important to establish highly reliable computer systems in safety-critical fields. As the most basic underlying software in computer systems, operating systems are the key to building highly reliable computer systems.
[0003] During the implementation process, the following application problems need to be solved: (1) Checkpoints of embedded operating systems are mainly recorded using status files, and the system overhead for retrieving them is high and inefficient; (2) For fault recovery of embedded operating systems, the method of directly rolling back all processes is mainly used, which has a relatively high system overhead. Summary of the invention
[0004] The technical problem solved by the present invention is: to overcome the shortcomings of the prior art, and to propose a fault recovery method based on an embedded operating system. By using a checkpoint file structure and a method of only rolling back the process that sets a mark for the storage modification status, the embedded operating system fault recovery is realized, and the problems of low efficiency and high overhead caused by the need to roll back all processes when performing fault recovery in the prior art are solved.
[0005] The technical solution of the present invention is:
[0006] A fault recovery method based on an embedded operating system, comprising:
[0007] Step 1, constructing a target process structure including task information and storage information according to multiple processes running on the embedded operating system;
[0008] Step 2, using the checkpoint file to index and store the files related to the checkpoint; wherein the checkpoint file stores all the information required for the recovery process to run;
[0009] The checkpoint file consists of file start data, end mark and several process data; the file start data includes the file start header mark, program version, kernel version, process number and process information storage structure;
[0010] Process data includes process ID, storage modification flag, associated process storage modification flag, process relationship structure, process file system information, process writeback file and other process data;
[0011] The end marker indicates the end of the checkpoint file;
[0012] Step 3, setting multi-task collaborative checkpoints according to the set time intervals, and saving the checkpoint time intervals;
[0013] Step 4: During the system operation, update the data in the checkpoint file according to the checkpoint time interval;
[0014] Step 5, when the system receives the checkpoint setting request, it performs a globally consistent checkpoint setting according to the process relationship structure in the checkpoint file, and sets the storage modification flag of the process data and the storage modification flag of the associated process;
[0015] Step 6, when the system receives the checkpoint recovery command, it rewinds the corresponding process according to the process relationship structure in the checkpoint file, the current process storage modification flag recorded in the checkpoint file, and the associated process storage modification flag, restores all data of each process, and restores each process.
[0016] Furthermore, when the system receives a checkpoint setting request, it performs a globally consistent checkpoint setting according to the process relationship structure. The specific method is as follows:
[0017] After receiving the checkpoint setting, wait for the user's interrupt save request; the callback work process sends an interrupt save signal according to the process relationship structure, and the target process of the checkpoint setting receives the interrupt save signal;
[0018] Update and save the process relationship structure of the target process, save all process data, and set the checkpoint end flag of this process;
[0019] If the global consistency checkpoint setting is not completed, other process checkpoints are set according to the process relationship structure, otherwise the global consistency checkpoint processing is terminated.
[0020] Furthermore, when the system receives a checkpoint recovery command, the method for recovering the process running in the system is:
[0021] After determining the next process that needs to be restored, block the corresponding process according to the process relationship structure;
[0022] Wake up the main process and check the storage modification status of related processes according to the process structure: if the storage modification flag of the process data indicates that the process itself has been modified, then rewind the process; if the storage modification flag of the associated process indicates that the related process has been modified, then rewind the related process;
[0023] Restore all data of the process and resume the process;
[0024] The next process with which the modified process has a dependency is searched and stored according to the stored process relationship until all processes are restored.
[0025] Furthermore, during the operation of the system, the method for updating the data in the checkpoint file is:
[0026] Record the file start data of the checkpoint file. Record the program version, kernel version, number of processes, and record the corresponding position of each process in the file in the process information storage structure.
[0027] Record all process data. For each process, record the corresponding process ID in the order of the process information storage structure. If the running process performs read and write operations, the storage modification flag of the process is set, otherwise it is cleared. If the associated process performs read and write operations, the storage modification flag of the associated process is set, otherwise it is cleared.
[0028] Furthermore, the checkpoint interval is:
[0029]
[0030] Where, T Chek The interval between checkpoints for the system, t BDS is the mean time between system failures, t SP It is the time consumed by running the checkpoint operation; the parameter σ ranges from 0<σ≤100.
[0031] Furthermore, the storage modification flag records whether the process performs memory and register storage modification; the associated process storage modification flag records whether other processes related to the process perform storage modification.
[0032] Furthermore, the target process structure records the relationship information of the processes, including the creation and hierarchical relationship information between processes.
[0033] Furthermore, the process information storage structure in the file start data records the positions of all process IDs corresponding to the checkpoint file.
[0034] The advantages of the present invention compared with the prior art are:
[0035] (1) The checkpoint file used in the present invention has a process information storage structure in the file header to record the positions of all processes in the checkpoint file, which is convenient for searching the checkpoint file and is creative.
[0036] (2) The checkpoint file used in the present invention describes the constraint dependency relationship between processes, uses the process storage modification flag to indicate that the process itself has undergone storage modification, and the associated process storage modification status word records the storage modification status of the related process.
[0037] (3) The present invention adopts a method of only rolling back the process that sets the storage modification status mark, combined with the use of a process relationship information file to ensure that all processes that have a dependency relationship with the storage modification process are rolled back, thereby ensuring the correct execution of fault recovery. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0039] Figure 1 This is a schematic diagram of the checkpoint file format according to an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of a checkpoint setting method according to an embodiment of the present invention;
[0041] Figure 3 The figure is a schematic diagram of a checkpoint recovery method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0043] The present invention proposes a fault recovery method based on an embedded operating system, comprising:
[0044] S1, build a target process structure containing task information and storage information.
[0045] S2, use the checkpoint file to store the checkpoint related files. The checkpoint file saves all the information required for the recovery process to run;
[0046] Checkpoint files such as Figure 1 As shown, it consists of file start and end marks and several process data.
[0047] The file starts with the header flag of the file start, program version, kernel version, number of processes, and process information storage structure (all process IDs correspond to the location of the checkpoint file).
[0048] Process data includes: process ID, storage modification flag of the current process, storage modification flag of the associated process, process relationship structure, process file system information, process writeback file and process related data.
[0049] The end marker indicates the end of the checkpoint file.
[0050] S3, the system sets multi-task collaborative checkpoints at a certain time interval, and the time interval for saving checkpoints is:
[0051]
[0052] T Chek The most appropriate interval for system checkpointing, t BDS is the mean time between failures of the system; t SP It is the time consumed by running the checkpoint operation; the parameter σ ranges from 0<σ≤100.
[0053] S4: During system operation, the checkpoint file data is updated according to the following steps.
[0054] (1) After receiving the checkpoint setting, wait for the user's interrupt save request; the callback work process sends an interrupt save signal according to the process relationship structure, and the target process of the checkpoint setting receives the interrupt save signal;
[0055] (2) Update and save the process relationship structure of the target process, save all process data, and set the checkpoint end flag of this process;
[0056] (3) If the global consistency checkpoint setting is not completed, other process checkpoints are set according to the process relationship structure, otherwise the global consistency checkpoint processing is terminated.
[0057] S5, such as Figure 2 As shown in the figure, the system receives a checkpoint setting request and performs a globally consistent checkpoint setting based on the checkpoint file:
[0058] (1) After receiving the checkpoint setting, wait for the user's interrupt save request. The callback work process sends an interrupt save signal according to the process relationship structure. The target process of the checkpoint setting receives the interrupt save signal.
[0059] (2) Update and save the process relationship structure of the target process, save all process data, and set the checkpoint end flag of this process.
[0060] (3) If the global consistency checkpoint setting is not completed, other process checkpoints are set according to the process structure, otherwise the global consistency checkpoint processing is terminated.
[0061] (4) After setting the global consistency checkpoint, the storage modification flag of the current process and the storage modification flag of the associated process are reset.
[0062] S6, such as Figure 3 As shown in the figure, when the system receives the checkpoint recovery command, it recovers the process running on the processor core:
[0063] (1) After determining the next process that needs to be restored, block the corresponding process according to the process relationship tree.
[0064] (2) Wake up the main process and check the storage modification status of related processes according to the process structure. If the storage modification flag of the process is not zero, it means that the process itself has made storage modifications and the process needs to be rolled back. If the storage modification flag of the associated process is not zero, it means that the related process has made storage modifications and the related process needs to be rolled back. Checkpoint recovery based on the relationship between processes can achieve rolling back only the processes that have made storage modifications, reducing the recovery cost while ensuring the correct execution of the process.
[0065] (3) Restore all data of the process and resume the process.
[0066] (4) The next process in the relationship between the modified process and the next process in the relationship is searched and stored according to the stored process relationship structure until all processes are restored.
[0067] The above-described embodiments are only preferred specific implementations of the present invention. Common changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included in the protection scope of the present invention.
Claims
1. A fault recovery method based on an embedded operating system, characterized in that: include: Step 1, constructing a target process structure including task information and storage information according to multiple processes running on the embedded operating system; Step 2, using the checkpoint file to index and store the files related to the checkpoint; wherein the checkpoint file stores all the information required for the recovery process to run; The checkpoint file consists of file start data, end mark and several process data; the file start data includes the file start header mark, program version, kernel version, process number and process information storage structure; Process data includes process ID, storage modification flag, associated process storage modification flag, process relationship structure, process file system information, process writeback file and other process data; The end marker indicates the end of the checkpoint file; Step 3, setting multi-task collaborative checkpoints according to the set time intervals, and saving the checkpoint time intervals; Step 4: During the system operation, update the data in the checkpoint file according to the checkpoint time interval; Step 5, when the system receives the checkpoint setting request, it performs a globally consistent checkpoint setting according to the process relationship structure in the checkpoint file, and sets the storage modification flag of the process data and the storage modification flag of the associated process; Step 6, when the system receives the checkpoint recovery command, it rewinds the corresponding process according to the process relationship structure in the checkpoint file, the current process storage modification flag recorded in the checkpoint file, and the associated process storage modification flag, restores all data of each process, and restores each process.
2. A fault recovery method based on an embedded operating system according to claim 1, characterized in that: When the system receives a checkpoint setting request, it sets a globally consistent checkpoint according to the process relationship structure. The specific method is as follows: After receiving the checkpoint setting, wait for the user's interrupt save request; the callback work process sends an interrupt save signal according to the process relationship structure, and the target process of the checkpoint setting receives the interrupt save signal; Update and save the process relationship structure of the target process, save all process data, and set the checkpoint end flag of this process; If the global consistency checkpoint setting is not completed, other process checkpoints are set according to the process relationship structure, otherwise the global consistency checkpoint processing is terminated.
3. The fault recovery method based on embedded operating system according to claim 1, characterized in that: When the system receives a checkpoint recovery command, the method for recovering the processes running in the system is as follows: After determining the next process that needs to be restored, block the corresponding process according to the process relationship structure; Wake up the main process and check the storage modification status of related processes according to the process structure: if the storage modification flag of the process data indicates that the process itself has been modified, then rewind the process; If the associated process storage modification flag indicates that the associated process has undergone storage modification, the associated process is rolled back; Restore all data of the process and resume the process; The next process with which the modified process has a dependency is searched and stored according to the stored process relationship until all processes are restored.
4. The fault recovery method based on embedded operating system according to claim 1, characterized in that: During system operation, the method for updating the data in the checkpoint file is as follows: Record the file start data of the checkpoint file. Record the program version, kernel version, number of processes, and record the corresponding position of each process in the file in the process information storage structure. Record all process data. For each process, record the corresponding process ID in the order of the process information storage structure. If the running process performs read and write operations, the storage modification flag of the process is set, otherwise it is cleared. If the associated process performs read and write operations, the storage modification flag of the associated process is set, otherwise it is cleared.
5. The fault recovery method based on embedded operating system according to claim 1, characterized in that: The checkpoint intervals are: Where, T Chek The interval between checkpoints for the system, t BDS is the mean time between system failures, t SP It is the time consumed by running the checkpoint operation; the parameter σ ranges from 0<σ≤100.
6. The fault recovery method based on embedded operating system according to claim 1, characterized in that: The storage modification flag records whether the process has modified the memory or register storage; the associated process storage modification flag records whether other processes related to the process have modified the storage.
7. The fault recovery method based on embedded operating system according to claim 1, characterized in that: The target process structure records the relationship information of processes, including the creation and hierarchical relationship information between processes.
8. The fault recovery method based on embedded operating system according to claim 1, characterized in that: The process information storage structure in the file start data records the positions of all process IDs corresponding to the checkpoint file.
Citation Information
Patent Citations
Method for restoring application software exception in Android system
CN106959909A
Method and apparatus for recovering a multi-threaded process from a checkpoint
US20020194525A1
Method for writing modified data from a main memory of a computer back to a database
US5933593A
High-speed database checkpointing through sequential I / O to disk
US5996088A
Cited By
Process recovery method, product, equipment and storage medium
CN120029827A
A process recovery method, product, device and storage medium
CN120029827B
