Method and device for quickly starting and recovering embedded system in case of fault and storage medium
Through multi-partition version verification and automatic repair mechanisms, the embedded system identifies and repairs damaged partitions during startup, solving the startup failure problem caused by corrupted system files and achieving rapid recovery and long-term stable operation.
Patent Information
- Application Number
- CN202511018143.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-11-07
AI Technical Summary
Embedded systems are prone to system file corruption due to bit flips, miswriting, and other reasons during long-term operation, which can cause the system to fail to start normally. Existing technologies have low recovery efficiency and pose security risks.
A multi-partition version verification mechanism is adopted, which uses a hash algorithm to calculate the version verification value of each partition, automatically selects the healthy boot partition, and performs partition repair during system operation to ensure that the system can be quickly restored to a usable state.
This system enables the identification and exclusion of damaged partitions during startup, reducing recovery time, improving startup efficiency, ensuring long-term stable operation of the equipment, and enhancing the reliability and maintainability of the system.
Smart Images

Figure CN120909838A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of embedded device industry, in particular to a method, device and storage medium for fast starting and recovering of an embedded system in case of failure. BACKGROUND
[0002] With the wide application of embedded systems, they play a crucial role in the fields of industrial control, smart home, medical devices, autonomous driving, etc. However, since embedded devices are mostly in a long-running state and the environment is complex, system file damage problems such as bit flipping and miswriting may occur during system operation, which may cause the system to fail to start normally. These problems not only affect the stability and reliability of the device, but also may cause serious safety hazards, especially in application scenarios that require high availability and real-time performance, the handling of system failure becomes particularly important.
[0003] Currently, when an embedded device fails due to system file damage, it can only be returned or manually recovered. Therefore, there is a problem of low recovery efficiency.
[0004] The patent with publication number CN111552590B discloses a detection and recovery method and system for memory bit flipping of power secondary equipment. However, this patent can only solve the problem of memory bit flipping when running user programs, and cannot solve the problem of system file damage causing system failure. SUMMARY
[0005] The present application provides a method, device and storage medium for fast starting and recovering of an embedded system in case of failure, which automatically selects a healthy startup partition through version verification of multiple partitions, and repairs the faulty partition during system startup and operation to ensure that the system can be stably and quickly recovered to an available state.
[0006] Technical solution: In a first aspect, a method for fast starting and recovering of an embedded system in case of failure includes the following steps:
[0007] After the embedded device is powered on, it is started to the boot stage and the hardware is initialized;
[0008] The startup partition is selected according to the default configuration, and the startup partition flag is initialized as the default startup partition, and the unusable partition flag is initialized as empty;
[0009] The hash algorithm is used to calculate the version verification value of the multiple system partitions in the local storage space for storing version files, and the corresponding multiple version verification values are obtained, wherein the multiple is an odd number greater than 1;
[0010] The state of each partition is determined by comparing the version check values of different partitions, and in the multiple partitions, if the number of occurrences of a version check value exceeds half of the total number of partitions, all partitions corresponding to the version check value are randomly or selectively set as active partitions according to a specified principle; the partitions whose number of occurrences of the version check value does not reach half are all set as unusable partitions.
[0011] The files in the current active partition are read, the operating system is started and the user state command is executed, and the partition integrity self-check is performed in the system running stage, first checking whether there is an unusable partition flag in the local storage device, if there is, copying the current active partition to the unusable partition for repair, then determining the state of each partition by comparing the version check values of different partitions every interval, and the specific comparison method is consistent with that in the booting stage.
[0012] Preferably, the local storage space of the embedded device further comprises: a bootloader partition, a startup parameter partition, and a user partition, the bootloader partition is used to store the firmware for booting the operating system and initialize the hardware when the device is powered on; the startup parameter partition is used to store the startup parameters of the system partition, including the active partition flag and the unusable partition flag; and the user partition is used to store the user state program.
[0013] Preferably, the multiple system partitions in the local storage space for storing version files are three system partitions, namely A zone, B zone and C zone, and the default configured active partition is A zone.
[0014] The state of each partition is determined by comparing the version check values of different partitions, including:
[0015] If the version check values of A zone and B zone are consistent with C zone, the unusable partition flag is set to C zone and saved; if the version check values of A zone and B zone are inconsistent with C zone, the unusable partition flag is set to B zone and saved; if the version check values of A zone and C zone are inconsistent with B zone and C zone, the active partition flag is set to B zone, and the unusable partition flag is set to A zone and saved; if the version check values of the three partitions are consistent, there is no unusable partition.
[0016] Preferably, the method further comprises: in the booting stage, if the version check values of A zone, B zone and C zone are all inconsistent, no operation is performed; and in the system running stage, if the version check values of A zone, B zone and C zone are all inconsistent, it is determined that the partition is seriously damaged, and an alarm is sent to the operation and maintenance personnel through a business reporting interface for processing.
[0017] Preferably, when comparing the version check values of the partitions to determine the status of each partition, in the case that the version check values of the A partition and the B partition are consistent, but inconsistent with the C partition, and the version check values of the A partition and the B partition are inconsistent, but consistent with the C partition, the start-up partition flag is set to the A partition.
[0018] Preferably, the local storage uses an embedded multimedia memory card; and / or the hash algorithm uses MD5 or SHA-1 algorithm.
[0019] In a second aspect, a method for fast start-up and recovery of an embedded system in case of failure includes:
[0020] A hardware initialization module is configured to initialize hardware after the embedded device is powered on and start-up to a booting stage.
[0021] An initial start-up partition selection module is configured to select a start-up partition according to a default configuration, and initialize the start-up partition flag to the start-up partition of the default configuration and initialize the unusable partition flag to empty.
[0022] A version check value calculation module is configured to calculate version check values of a plurality of system partitions for storing version files in the local storage space by using a hash algorithm, and obtain a plurality of corresponding version check values, wherein the plurality is an odd number greater than 1.
[0023] A partition status determination module is configured to determine the status of each partition by comparing different partition version check values, and in the plurality of partitions, if the number of occurrences of a version check value exceeds half of the total number of partitions, then all partitions corresponding to the version check value are randomly or selectively set as a start-up partition according to a specified principle; and the partitions whose number of occurrences of the version check value does not reach half are all set as unusable partitions.
[0024] A partition background self-checking and repairing module is configured to read files in the current start-up partition, start an operating system and execute user state commands, and perform a partition integrity self-checking during a system running stage, first check whether there is an unusable partition flag in the local storage device, if yes, copy the current start-up partition to the unusable partition for repairing, and then determine the status of each partition by comparing different partition version check values every interval, and the specific comparison method is consistent with that in the booting stage.
[0025] In a third aspect, the present application further provides an embedded device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the computer program is configured to implement the steps of the method for fast start-up and recovery of an embedded system in case of failure according to the first aspect of the present application.
[0026] In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for fast start-up and recovery of an embedded system in case of failure according to the first aspect of the present application.
[0027] In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method for fast start-up and recovery of an embedded system in case of failure according to the first aspect of the present application.
[0028] Advantages: Compared with the prior art, the present application has the following advantages:
[0029] (1) The version integrity of each partition is checked by using a hash algorithm, ensuring that the system can identify and exclude damaged partitions (such as partitions damaged due to power failure, bit flipping, miswriting, or other reasons) when starting up. Even if a partition is damaged, the system can automatically select a normal partition for startup, avoiding the risk of system failure due to partition failure. This reduces the maintenance and maintenance costs caused by device failure downtime, allowing the embedded device to operate efficiently and stably for a longer period of time.
[0030] (2) Through the partition version checking and fast selection of available startup partitions mechanism, the recovery time in case of system failure is greatly reduced. By comparing the version check values of each system partition in real time, the available startup partition can be quickly identified at the initial stage of startup, without the need to switch partitions after multiple failed attempts. This saves time waiting and switching partitions, greatly improving startup efficiency, which is very useful in time-critical scenarios.
[0031] (3) By automatically detecting and repairing unavailable partitions online after startup is complete, the long-term operation of the device is ensured to be unaffected by damage. If a partition version is marked as unavailable, the system will automatically copy the currently normal running partition to the unavailable partition for repair. This online repair mechanism can avoid the situation where all system running partition versions are damaged for a long time, greatly improving the reliability of the system and the maintainability in unattended environments, and greatly reducing the recovery time in future system restarts. BRIEF DESCRIPTION OF DRAWINGS
[0032] Figure 1 A schematic diagram of locally stored partitions according to an embodiment of the present application;
[0033] Figure 2 A flowchart of the overall method according to the present application;
[0034] Figure 3 A flowchart of the startup process of an embedded device in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings.
[0036] The embedded device includes a processor, a memory (internal memory, flash memory, etc.), peripherals (serial port, network interface, sensor, etc.), a power management module, a clock module, etc. The present application focuses on how to quickly recover when the embedded device fails, and proposes a fast start and recovery method. The method selects a start partition quickly by checking the version integrity and comparing the partition version check values, reduces the fault recovery time, and automatically detects and repairs an unusable partition, thereby improving the system security, reliability and robustness. Figure 1 A partition diagram of the local storage of the embedded device in the embodiments of the present application is shown. The local storage uses an embedded multimedia memory card (EMMC), and the space is divided into a bootloader partition, three system partitions (system partition A, system partition B, and system partition C, referred to as A zone, B zone, and C zone), a start parameter partition, and a user partition. The bootloader partition stores firmware for booting the operating system, and is used to initialize the CPU, memory, local storage, and other hardware and peripherals when the device is powered on. The A zone, B zone, and C zone respectively store system files of the same version for version checking, and usually one is primary and two are backup. The start parameter partition is used to store the start parameters of the system partition, including the start partition flag and the unusable partition flag. The user partition is used to store the user state program, i.e., user-related data and settings.
[0037] With reference to Figure 2 The fast start and recovery method for the embedded system when a fault occurs includes the following steps:
[0038] Step S1, after the embedded device is powered on, the bootloader stage is started, and the memory, processor, and peripherals are initialized.
[0039] At the moment of power-on of the embedded device, the hardware circuit starts to work, and the power supply provides power to each component. The bootloader program is loaded into the memory and starts to execute. The bootloader first initializes the CPU, memory, serial port, local storage, and other critical hardware to ensure that these hardware components are in a normal working state.
[0040] Step S2, start partition selection is performed, and the start partition flag is initialized to the A zone, and the unusable partition flag is empty.
[0041] The start partition is an important area for storing the operating system and related start files, which determines which partition to load the operating system from when the system starts.
[0042] The boot partition flag is initialized as A zone, meaning that in the current state, the system will default to booting from the A zone. This flag bit is usually a marker stored in a specific memory address or register that indicates the current boot partition. When the system boots, it will first check this flag to determine which partition to load the operating system from.
[0043] At the same time, the unusable partition flag is initialized as empty, indicating that at the beginning, no partition is marked as unusable. The unusable partition flag is also usually a marker stored in a specific location that indicates which partitions have problems or are not in normal use. In subsequent steps, through the comparison of different partition version checksums, the unusable partition flag will be updated according to the verification result to reflect the actual state of each partition.
[0044] Step S3, use the hash algorithm to calculate the version checksum of the three system partitions A, B and C in the local storage space respectively, and get the corresponding three version checksums;
[0045] The hash algorithm is an algorithm that maps arbitrary length data to fixed length hash values, which has the characteristics of fast calculation, uniqueness and irreversibility. Common hash algorithms such as MD5 (Message Digest Algorithm 5) or SHA-1 (Secure Hash Algorithm 1) can be used.
[0046] For each system partition (A, B and C), the hash algorithm will calculate the version file stored in the partition bit by bit. The algorithm treats the content of the version file as a binary data stream, and processes this data stream through specific mathematical operations to generate a fixed length hash value. This hash value represents the specific state of the version file in the partition, and as long as the content of the version file changes, the corresponding hash value will also change.
[0047] For example, for A zone, the hash algorithm will calculate all the version files in A zone to generate a 128-bit (MD5) or 160-bit (SHA-1) hash value as the version checksum of A zone. Similarly, the same operation is performed on B and C zones to obtain their respective version checksums. In this way, by calculating the version checksum of the three partitions respectively, the system can detect the changes in the version files in each partition by comparing these checksums in subsequent steps.
[0048] Step S4, determine the state of each partition by comparing the version checksums of different partitions, determine the boot partition, and set the partition with inconsistent version checksums as the unusable partition;
[0049] First, the version check values of the A and B areas are compared. If they are consistent, it means that the version files of the A and B areas are the same and no change has occurred. This means that the two partitions are reliable in terms of version and can be normally used.
[0050] Then, the version check value of the A area is compared with that of the C area. If the version check values of the A and B areas are consistent but inconsistent with the C area, it means that the version file of the C area has changed due to some reason (such as software update, storage error, etc.) and is different from the A and B areas. At this time, the unusable partition flag is set to the C area and saved for processing in subsequent steps.
[0051] Similarly, if the version check values of the A and B areas are inconsistent but consistent with the C area, it is considered that the version file of the B area may have a problem, and the unusable partition flag is set to the B area and saved. If the version check values of the A and B areas are inconsistent but consistent with the C area, it means that the version file of the A area may have a problem, and at this time, the startup partition flag is set to the B area, and the unusable partition flag is set to the A area and saved.
[0052] Through such comparison and marking operation, the system can accurately determine the status of each partition, providing a basis for subsequent startup and repair operations.
[0053] In step S5, the files in the current startup partition are read, the operating system is started, and user state commands are executed, and the partition integrity self-check is performed periodically during the system running stage.
[0054] After the system is started, the "partition integrity self-check service" is loaded in the form of a daemon process.
[0055] The service first checks whether there is an unusable partition flag in the local storage device. If there is, the current startup partition is copied to the unusable partition for repair, and after the copying is successful, the unusable partition flag is set to empty.
[0056] Subsequently, the check values of the A / B / C three partitions are checked every specified time, such as 30 minutes. The checking process is consistent with step S4, that is, the partition ID of any two consistent but inconsistent with the third is recorded as the unusable partition, and the partition ID of the two consistent is recorded as the startup partition. If the unusable partition is not empty, the content of the startup partition (any two consistent partitions) is completely copied to the unusable partition, and after the copying is successful, the unusable partition flag is set to empty. If the check values of the A / B / C three partitions are different from each other, it is determined that the partition has a serious damage, and an alarm can be sent to the operation and maintenance personnel through a business reporting interface. The service writes each self-check, discovery and repair operation into a log file for subsequent analysis.
[0057] The system partitions are generally set to an odd number to prevent a tie from occurring that cannot be determined. The above describes three system partitions, and if there are five or other odd number of system partitions, the majority consistency principle is used to determine the partition state. The majority consistency principle means that if the number of occurrences of a version check value exceeds half of the total number of partitions, then all partitions corresponding to the version check value are randomly or according to a specified principle selected to be a start-up partition; the partitions whose number of occurrences of the version check value does not reach half are all set to be unusable partitions.
[0058] Referring to Figure 3 In one embodiment, the method for fast start-up and recovery of an embedded system in the event of a failure includes the following steps:
[0059] Step A: The embedded device receives a power-on signal.
[0060] Step B: The device enters the bootloader phase. In this phase, the system initializes the CPU, serial port, local storage device (EMMC is used in this embodiment), and other necessary peripherals. At this time, the bootloader performs basic hardware detection and configuration to ensure that the system hardware is working properly and can access local storage data. The additional step in this embodiment compared to the prior art is the operating system start-up partition selection module.
[0061] Step C: Run the system start-up partition selection program, and initialize the default start-up partition flag to A zone and the unusable partition flag to empty.
[0062] Step D: Calculate the MD5 version check values of the A, B, and C zones in the EMMC. The check values are used to ensure that the file data of each partition has not been damaged or tampered with.
[0063] Step E: If the check values of the A / B zones are consistent, it means that the version files of the A and B zones are consistent and undamaged, so the system sets the A zone as the system start-up partition and saves this information. If the check values of the A and C zones are not consistent, it means that the version files of the C zone may have been damaged (such as bit flipping, miswriting, etc.), so the C zone is marked as unusable and this state is saved. In this embodiment, it is saved in the EMMC.
[0064] Step F: If the version check values of the A / B zones are not consistent, then the version check values of the A and C zones are compared. If the versions of the A and C zones are consistent, it means that the file systems of the A and C zones are normal and can be used, so the A zone is set as the start-up partition and the B zone is marked as unusable and this state is saved.
[0065] Step G: If the versions of the A area and the C area are inconsistent, further compare the version check values of the B area and the C area. If the check values of the B area and the C area are consistent, it indicates that the file systems of the B area and the C area are normal and can be used, and at this time, the B area will be set as the starting partition, and the A area will be marked as unusable and saved in this state.
[0066] Step H: The system reads the content of the marked starting partition (A area or B area) according to the judgment results of steps E, F and G, and loads the operating system (OS). After successfully loading the operating system, the device will continue to execute the user state command in the operating system to complete the normal start of the system.
[0067] Step I: After the operating system is successfully started, the "partition integrity self-check service" is loaded.
[0068] Step J: The service first checks whether there is a partition marked as unusable. If it is found that a certain partition in the A area, the B area or the C area is marked as unusable, the file system of the current starting partition will be automatically copied to the unusable partition for repair, and after the repair is successful, the unusable partition is set to empty.
[0069] Step K: A / B / C three-partition self-check is performed every 30 minutes. The process is consistent with steps E to G, that is, the partition ID of any two of the A / B / C three-partitions consistent with the third is marked as an unusable partition, and the partition ID of the two consistent is marked as a starting partition. If the unusable partition is not empty, the content of the starting partition is completely copied to the unusable partition, and after the copying is successful, the unusable partition flag is set to empty. If the A / B / C three-partition check values are different from each other, it is determined that the partition is seriously damaged, and an alarm is sent to the operation and maintenance personnel through a business reporting interface for further manual analysis. In this way, the device can automatically repair the damaged partition after successful start, and ensure that the system is in a usable state for a long time.
[0070] In steps E to K, by judging the consistency of the version check values of the A, B and C areas, the system can flexibly select a healthy partition for starting, and ensure that the system can be quickly recovered when the system version is damaged. At the same time, any inconsistent version of a partition will be marked as unusable, and the system ensures the stability and high availability of the device through the repair process.
[0071] The application also provides a fast starting and recovering system for an embedded system in failure, which comprises:
[0072] A hardware initialization module, which is used for starting to a boot starting stage and initializing hardware after the embedded device is powered on.
[0073] An initial starting partition selection module, which is used for selecting a starting partition according to a default configuration, initializing the starting partition flag as the starting partition of the default configuration, and initializing the unusable partition flag as empty.
[0074] a version check value calculation module, configured to calculate version check values of a plurality of system partitions in the local storage space for storing version files respectively by using a hash algorithm, and obtain a plurality of corresponding version check values, wherein the plurality of version check values is an odd number greater than 1;
[0075] a partition state determination module, configured to determine the states of the partitions by comparing the version check values of different partitions, and in the plurality of partitions, if a version check value appears more than half of the total number of the partitions, all the partitions corresponding to the version check value are randomly or selectively set as active partitions according to a specified principle; and the partitions whose version check values appear less than half of the total number of the partitions are all set as unusable partitions.
[0076] a partition background self-checking and repairing module, configured to read files in the current active partition, start an operating system and execute user state commands, and perform a partition integrity self-checking during a system running stage, first check whether there is an unusable partition flag in the local storage device, and if there is, copy the current active partition to the unusable partition for repairing, and then determine the states of the partitions by comparing the version check values of different partitions every interval, and the specific comparison method is consistent with that in the booting and starting stage.
[0077] The application further provides an embedded device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the computer program is configured to implement the steps of the method for quickly starting and recovering an embedded system in case of failure when executed by the processor.
[0078] The application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is configured to implement the steps of the method for quickly starting and recovering an embedded system in case of failure when executed by a processor.
[0079] The application further provides a computer program product, comprising a computer program, wherein the computer program is configured to implement the steps of the method for quickly starting and recovering an embedded system in case of failure when executed by a processor.
[0080] The application is described with reference to flowcharts of the method according to the embodiments of the application. It should be understood that each flow in the flowcharts and the combination of the flows can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose or special-purpose device, embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the device, embedded processor or other programmable data processing device produce a device that implements the functions specified in the flow or flows. Figure 1 The application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is configured to implement the steps of the method for quickly starting and recovering an embedded system in case of failure when executed by a processor.
[0081] These computer program instructions can also be stored in a computer readable memory that can direct the device, embedded processor, or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flow Figure 1 specified in the flow or flows.
[0082] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flow Figure 1 specified in the flow or flows.
Claims
1. A method for fast startup and recovery in case of failure of an embedded system, characterized in that, The method comprises the following steps: After the embedded device is powered on, the booting stage is started, and the hardware is initialized; According to the default configuration, the booting partition is selected, and the booting partition flag is initialized as the default booting partition, and the unusable partition flag is initialized as empty; The version check values of the multiple system partitions in the local storage space for storing version files are calculated by using a hash algorithm, and the corresponding multiple version check values are obtained, wherein the multiple is an odd number greater than 1; The states of the partitions are determined by comparing the version check values of different partitions, and in the multiple partitions, if the number of occurrences of a version check value exceeds half of the total number of partitions, all partitions corresponding to the version check value are randomly or selectively set as the booting partition according to a specified principle; the partitions whose number of occurrences of the version check value does not reach half are all set as unusable partitions; The files in the current booting partition are read, the operating system is started and the user state command is executed, and the partition integrity self-check is performed in the system running stage, first, it is checked whether there is an unusable partition flag in the local storage device, if yes, the current booting partition is copied to the unusable partition for repair, then the states of the partitions are determined by comparing the version check values of different partitions every interval, and the specific comparison method is consistent with that in the booting stage.
2. The method of claim 1, wherein, The local storage space of the embedded device further comprises a bootloader partition, a booting parameter partition and a user partition, the bootloader partition is used for storing the firmware of the booting operating system, and the hardware is initialized when the device is powered on; the booting parameter partition is used for storing the booting parameters of the system partition, including the booting partition flag and the unusable partition flag; and the user partition is used for storing the user state program.
3. The method of claim 1, wherein, The multiple system partitions in the local storage space for storing version files are three system partitions, which are A area, B area and C area, and the default booting partition is A area; The states of the partitions are determined by comparing the version check values of different partitions, including: If the version check values of A area and B area are consistent, but inconsistent with C area, the unusable partition flag is set as C area and saved; if the version check values of A area and B area are inconsistent, but consistent with C area, the unusable partition flag is set as B area and saved; if the version check values of A area and C area are inconsistent, but the version check values of B area and C area are consistent, the booting partition flag is set as B area, and the unusable partition flag is set as A area and saved; if the version check values of the three partitions are consistent, there is no unusable partition.
4. The method of claim 3, wherein, Further comprising: If the version check values of A area, B area and C area are all inconsistent in the booting stage, no operation is performed; if the version check values of A area, B area and C area are all inconsistent in the system running stage, it is determined that the partitions are seriously damaged, and an alarm is sent to the operation and maintenance personnel through a business reporting interface for processing.
5. The method of claim 3, wherein, When the states of the partitions are determined by comparing the version check values of different partitions, in the case that the version check values of A area and B area are consistent, but inconsistent with C area, and the version check values of A area and B area are inconsistent, but consistent with C area, the booting partition flag is set as A area.
6. The method of claim 1, wherein, The local storage uses an embedded multimedia memory card; and / or the hash algorithm adopts MD5 or SHA-1 algorithm.
7. A fast boot and recovery system for embedded systems in case of failure, characterized in that, The method further comprises the following steps: The hardware initialization module is configured to start the booting stage and initialize the hardware after the embedded device is powered on. The initial start partition selection module is configured to select the start partition according to the default configuration, and initialize the start partition flag as the start partition of the default configuration and initialize the unusable partition flag as empty. The version check value calculation module is configured to calculate the version check values of the multiple system partitions for storing the version files in the local storage space by using the hash algorithm, and obtain the corresponding multiple version check values, wherein the multiple is an odd number greater than 1. The partition state determination module is configured to determine the state of each partition by comparing the different partition version check values, and in the multiple partitions, if the number of occurrences of a version check value exceeds half of the total number of partitions, all partitions corresponding to the version check value are randomly or selectively set as the start partition according to a specified principle; the partitions whose number of occurrences of the version check value does not reach half are all set as unusable partitions. The partition background self-checking and repairing module is configured to read the files in the current start partition, start the operating system and execute the user state command, and perform the partition integrity self-checking during the system running stage, first check whether there is an unusable partition flag in the local storage device, if there is, copy the current start partition to the unusable partition for repairing, then determine the state of each partition by comparing the different partition version check values every interval, and the specific comparison method is consistent with that in the booting stage.
8. An embedded device, characterized by The computer program is stored in the memory and configured to be executed by the processor, and when the computer program is executed by the processor, the steps of the fast start and recovery method of the embedded system in the case of failure according to any one of claims 1-6 are implemented. The computer program is stored in the memory and configured to be executed by the processor, and when the computer program is executed by the processor, the steps of the fast start and recovery method of the embedded system in the case of failure according to any one of claims 1-6 are implemented. The computer program is stored in the memory and configured to be executed by the processor, and when the computer program is executed by the processor, the steps of the fast start and recovery method of the embedded system in the case of failure according to any one of claims 1-6 are implemented. 9. A computer readable storage medium having stored thereon a computer program, characterized in that, 10. A computer program product comprising a computer program, characterized in that,
Citation Information
Patent Citations
A method and system for detecting and recovering memory bit flipping in power secondary equipment
CN111552590B