CN118132335A - Method, system and device for recovering starting exception of embedded device - Google Patents

Method, system and device for recovering starting exception of embedded device Download PDF

Info

Publication number
CN118132335A
CN118132335A CN202410204910.5A CN202410204910A CN118132335A CN 118132335 A CN118132335 A CN 118132335A CN 202410204910 A CN202410204910 A CN 202410204910A CN 118132335 A CN118132335 A CN 118132335A
Authority
CN
China
Prior art keywords
data
partition
mirror
mirror image
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410204910.5A
Other languages
Chinese (zh)
Inventor
吴汉俊
尚豪杰
刘明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sunell Technology Corp
Original Assignee
Sunell Technology Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sunell Technology Corp filed Critical Sunell Technology Corp
Priority to CN202410204910.5A priority Critical patent/CN118132335A/en
Publication of CN118132335A publication Critical patent/CN118132335A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application is applicable to the technical field of embedded devices, and provides a method, a system and equipment for recovering starting abnormality of embedded equipment, wherein the method comprises the following steps: responding to the detection of the starting abnormality of the equipment, and acquiring recovery mirror image sub-data corresponding to each partition in a preset storage space; the preset storage space is used for storing a device boot loader; and respectively erasing the data of the corresponding subarea according to each recovered mirror image sub-data. The abnormality recovery method provided by the application does not need complex operation. When the abnormality of equipment software can not be started and needs to be repaired, only the recovery mirror image which is made in advance is put into the SD card, then the equipment is inserted, and the equipment is powered on, so that the equipment recovery process is more flexible and convenient, the after-sale maintenance recovery threshold of the equipment is greatly reduced, and the user can operate the equipment to recover.

Description

Method, system and device for recovering starting exception of embedded device
Technical Field
The application belongs to the technical field of embedded equipment, and particularly relates to a method, a system and equipment for recovering starting abnormality of embedded equipment.
Background
With the vigorous development of the internet of things, various embedded products are layered endlessly and are widely applied, wherein the situation that the embedded equipment cannot be started due to the influence of environment or human factors cannot be avoided due to the fact that software abnormality occurs in the upgrading or using process, for example, when the equipment is abnormally powered off in the upgrading process, partitions are damaged, so that data content is lost, and the equipment cannot be started. At this point, after-market technicians are often required to service the equipment by dismantling it. The process is very tedious, inconvenient, and takes time long, and has certain study threshold. It is often not self-healing for the average end user.
Disclosure of Invention
The embodiment of the application provides a method, a system and equipment for restoring an embedded device starting abnormality, which can solve the problems of complex process and difficult operation of a repairing method in the existing embedded device starting abnormality restoring process.
In a first aspect, an embodiment of the present application provides a method for recovering from an abnormal start of an embedded device, including:
responding to the detection of the starting abnormality of the equipment, and acquiring recovery mirror image sub-data corresponding to each partition in a preset storage space; the preset storage space is used for storing a device boot loader;
and respectively erasing the data of the corresponding subarea according to each recovered mirror image sub-data.
In a possible implementation manner of the first aspect, before the obtaining the restored image sub-data corresponding to each partition in the preset storage space in response to detecting the device start-up abnormality, the method further includes:
Identifying and loading restored mirror image data;
determining data segmentation reference information corresponding to each partition in the preset storage space according to the recovered mirror image data;
And splitting the restored mirror image data according to the data splitting reference information corresponding to each partition, and sequentially obtaining restored mirror image sub-data corresponding to each partition.
In a possible implementation manner of the first aspect, before determining, according to the restored mirror data, data slicing reference information corresponding to each partition in the preset storage space, the method includes:
Obtaining mirror head information from the recovered mirror data; the mirror header information includes first check information regarding the recovered mirror data;
judging whether the recovered mirror image data is matched with the equipment or not according to the first verification information;
And responding to successful matching of the recovered mirror image data and the equipment, and checking the recovered mirror image data according to the first checking information.
In a possible implementation manner of the first aspect, before determining, according to the recovered mirror data, data slicing reference information corresponding to each partition in the preset storage space, the method further includes:
Obtaining mirror head information from the recovered mirror data; the mirror header information includes second check information and position information about each partition in the preset storage space;
And respectively checking the partial recovery mirror image data corresponding to each partition according to the second checking information and the position information.
In a possible implementation manner of the first aspect, the splitting the restored mirror data according to the data splitting reference information corresponding to each partition sequentially obtains restored mirror sub-data corresponding to each partition includes:
sequentially clearing original storage contents of all partitions in the preset storage space;
and writing each recovered mirror sub-data into the corresponding partition.
In a possible implementation manner of the first aspect, after the splitting the restored mirror data according to the data splitting reference information corresponding to each partition, the method further includes:
reading user configuration information;
If the user configuration information fails to read, acquiring default configuration information from the recovery mirror image, wherein the default configuration information is used for enabling the equipment to recover from a factory state;
and executing a starting action on the equipment according to the default configuration information.
In a possible implementation manner of the first aspect, the default configuration information and the user configuration information are JSON structure files.
In a second aspect, an embodiment of the present application provides an embedded device startup anomaly recovery system, including:
The verification comparison module is used for acquiring recovery mirror image sub-data corresponding to each partition in a preset storage space when the equipment starting abnormality is detected; the preset storage space is used for storing a device boot loader;
And the extraction and erasing module is used for respectively erasing the data of the corresponding subareas according to each recovered mirror image sub-data.
In a third aspect, an embodiment of the present application provides a terminal device, including: a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to the first aspect described above when executing the computer program.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which when executed on a terminal device, causes the terminal device to perform the embedded device start-up anomaly recovery method of any one of the first aspects above.
It will be appreciated that the advantages of the second to fourth aspects may be found in the relevant description of the first aspect and are not repeated here.
Compared with the prior art, the embodiment of the application has the beneficial effects that:
according to the embedded device starting abnormality recovery method, after the device starting abnormality is detected, the recovery mirror image sub-data corresponding to each partition in the preset storage space is obtained, and the automatic restoration of starting is realized by using the recovery mirror image sub-data, so that the device maintenance cost is reduced, and the use experience of a device user is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments or the description of the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a recovery image used in an abnormal recovery method for starting an embedded device according to an embodiment of the present application;
FIG. 2 is a schematic flow chart illustrating a method for recovering an abnormal boot state of an embedded device according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an abnormal boot recovery system for an embedded device according to an embodiment of the present application;
Fig. 4 is a schematic structural diagram of an embedded device startup anomaly recovery terminal according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of an embedded device startup anomaly recovery device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in the present description and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Furthermore, the terms "first," "second," "third," and the like in the description of the present specification and in the appended claims, are used for distinguishing between descriptions and not necessarily for indicating or implying a relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
U-Boot is a Boot loader that is primarily used in embedded systems and can support a variety of different computer system architectures, including PPC, ARM, AVR, MIPS, x86, 68k, nios, and MicroBlaze. Many embedded processors and embedded operating systems are supported. At present, the U-Boot has the most perfect support for Linux. Its function is to boot the system, essentially a bare metal program.
AES, an advanced encryption standard (Advanced Encryption Standard, AES) in cryptography, also known as Rijndael encryption, is a block encryption standard adopted by the federal government in the united states, has been analyzed by multiple parties and widely used worldwide, but has become one of the most popular algorithms in symmetric key encryption.
CRC, cyclic redundancy check code (Cyclic Redundancy Check): the error checking check code is the most commonly used in the field of data communication, and is characterized in that the lengths of an information field and a check field can be arbitrarily selected. To ensure the correctness and integrity of data transmission.
With the vigorous development of the internet of things, various embedded products are layered endlessly and are widely applied, and the situation that the embedded equipment cannot be started due to the influence of environment or human factors in the process of upgrading or using is unavoidable, so that common terminal users cannot repair the embedded equipment by themselves.
When the device is abnormally powered off in the upgrading process, the partition is damaged, so that the data content is lost, and the device cannot be started. At this point, after-market technicians are often required to service the equipment by dismantling it. The process is very tedious, inconvenient, and takes time long, and has certain study threshold.
Because the equipment cannot be guaranteed to be certain without problems, when the equipment is difficult to repair, a simple and easy-to-operate repair method is very important, so that a user can repair the equipment by himself, and the after-sale repair cost is greatly reduced.
The application mainly aims to provide an abnormality recovery method of embedded equipment, and aims to solve the problems that the existing abnormality recovery method of the embedded equipment is complex in process and difficult to operate.
Before explaining the method for recovering the exception of the embedded device, which is provided by the present application, the recovering mirror image for recovering the embedded device needs to be described first, and the recovering mirror image provided by the present application has a mirror image structure shown in fig. 1, which is an encrypted mirror image structure, and includes:
The method comprises a mirror image head and a mirror image body, wherein the mirror image head comprises a mark head, a product model corresponding to a restored mirror image, a head content size, a mirror image total size and a storage partition list, the mark head is used for matching the file type of the restored mirror image, the product model corresponding to the restored mirror image is used for confirming whether the restored mirror image is matched with the current model, the head content size and the mirror image total size are used for judging the integrity of the restored mirror image, and the mirror image body comprises mirror image contents of each storage partition in the storage partition list after encryption.
Specifically, the mirror header is used to describe the mirror content, record length information, check information, and the like. The mirror body comprises mirror content after each storage partition in the storage partition list is encrypted.
Wherein the mirror head comprises:
Flag header (4 bytes): when the U-Boot traverses the file from the SD card, the U-Boot judges whether the file is the defined private mark head or not through matching the first 4 bytes of the file, so that the file is subjected to preliminary screening, and the non-mirror image file is removed.
Restore the product model (4 bytes) to which the image corresponds: when private mark heads pass the comparison, reading the 4 bytes to obtain the corresponding product model, and if the model is not matched, indicating that the mirror image is not the mirror image corresponding to the equipment, and preventing the error reading of the mirror images of other models from causing abnormality. And performing second screening through the field to remove the mirror images which do not accord with the model.
Header content size (4 bytes), mirror total size (4 bytes): when the image is loaded, the size of the load = header content size + image content size. If this calculation is not satisfied, the file is declared incomplete, so that the file is further filtered before decryption.
The mirror head also comprises a storage partition list, wherein the storage partition list specifically comprises:
Each storage partition in the partition list corresponds to a partition type (4 bytes) corresponding to the recovery image: to determine the type of the segment image and thereby determine the corresponding partition.
Each storage partition in the partition list corresponds to a partition size (4 bytes) required to restore the image: to determine the size of the segment partition so as to split the segment partition image from the total image file.
Each storage partition in the partition list corresponds to a recovered mirrored CRC check value (4 bytes): the method is used for comparing the value obtained by verification operation after decryption of the split partition mirror image, so as to judge whether the mirror image content is damaged, and ensure that the mirror image is correct and error-free.
The mirror body includes mirror content, and in one or more embodiments, the size and verification information is recorded in the mirror header, where the mirror content is formed by encrypting each individual partition by AES for each partition 2.1, 2.2, … and then assembling the individual partitions together.
Referring to fig. 2, a flow chart of an anomaly recovery method for an embedded device provided by the application specifically includes the following steps:
S220, responding to detection of the equipment starting abnormality, and acquiring recovery mirror image sub-data corresponding to each partition in a preset storage space; the preset storage space is used for storing a device boot loader.
S240, respectively erasing and writing the data of the corresponding subareas according to each recovered mirror image sub-data.
In one or more embodiments, the method for detecting the device start-up abnormality includes detecting an error code in the start-up process, for example, an error code 0x80004002 indicates that a start-up file is missing, detecting an abnormality log in the start-up process, for example, indicating that error information of the boot device cannot be found, or detecting an abnormality of a hardware state in the start-up process, for example, that a hard disk cannot be read or a memory fails, etc.
In one or more embodiments, the retrieval of the restored image sub-data in the preset storage space includes loading the stored boot loader and associated restored data from the preset storage space, such as a restored partition in UEFI firmware, or retrieving the restored image sub-data from a network or external storage medium using a specific tool or command.
Before step S220, referring to fig. 3, the method further includes the steps of:
s202, identifying and loading the recovered mirror image data.
S204, determining data segmentation reference information corresponding to each partition in the preset storage space according to the recovered mirror image data;
S206, cutting the restored mirror image data according to the data cutting reference information corresponding to each partition, and sequentially obtaining restored mirror image sub-data corresponding to each partition.
Specifically, identifying and loading the recovery image in the above steps includes: and judging whether the file is an image file or not by matching the private mark head information with the file type. And comparing the product type information to confirm whether the mirror image is matched with the current model. The integrity of the file is judged by the header content size and the mirror image content total size information, so that a preliminary screening is realized.
Specifically, in step S206, the length of the header information size of the file is skipped first, and the current position mark is recorded as the start address. And then obtaining the first partition length information in the step S2, and obtaining the corresponding length from the current recorded position to the back so as to obtain the mirror image which can be used for erasing after decryption of the mirror image of the first partition. At this time, the starting address is updated to be the current position, and then the mirror image of the second partition is continuously extracted according to the length information of the second partition obtained in the step S2. And the recovery mirror image sub-data corresponding to all the partitions can be obtained through circulation.
And then, erasing the first partition, and after the erasing is completed, using the original mirror of the first partition obtained in the step S3 to write and cover the partition, thereby completing the erasing operation of the first partition. After the first partition is operated, the same steps are continued to operate the subsequent partitions, and finally, the erasing and writing of all the partitions are completed.
In one or more embodiments, prior to step S204, the method further comprises the steps of:
Obtaining mirror head information from the recovered mirror data; the mirror header information includes first check information regarding the recovered mirror data;
judging whether the recovered mirror image data is matched with the equipment or not according to the first verification information;
And responding to successful matching of the recovered mirror image data and the equipment, and checking the recovered mirror image data according to the first checking information.
Specifically, the verifying according to the first recovered mirror data includes: and obtaining the information recorded by the first partition from the header information, decrypting the mirror image from the designated position according to the length in the information, performing CRC check after the decryption is successful, and finally comparing the CRC calculated by the mirror image with the CRC of the header. If the comparison is successful, the mirror image is correctly and correctly indicated, the head information content of the next partition is continuously acquired, and the process is repeated in a circulating way until all the partitions pass the verification, and the mirror image read at present is completely and correctly indicated. If the verification fails, it is indicated that the image file is corrupted and no further steps will be performed for security reasons.
In one or more embodiments, prior to step S204, the method further comprises the steps of:
Obtaining mirror head information from the recovered mirror data; the mirror header information includes second check information and position information about each partition in the preset storage space;
And respectively checking the partial recovery mirror image data corresponding to each partition according to the second checking information and the position information.
In one or more embodiments, the information recorded in the first partition is obtained from the header information, then the mirror image is decrypted from the designated position according to the length in the information, the CRC check is performed after the decryption is successful, and finally the CRC calculated by the mirror image is compared with the CRC of the header. If the comparison is successful, the mirror image is correctly and correctly indicated, the head information content of the next partition is continuously acquired, and the process is repeated in a circulating way until all the partitions pass the verification, and the mirror image read at present is completely and correctly indicated. If the verification fails, it is indicated that the image file is corrupted and no further steps will be performed for security reasons.
In a possible implementation manner of the first aspect, referring to fig. 3, after writing partition recovery data information of the recovery image to a corresponding storage partition of the embedded device, the method further includes the following steps:
S210, reading user configuration information: the step is used for acquiring the user-defined configuration information so as to enable the embedded equipment to recover to the last normally started state.
User configuration files or user configuration data of specific locations in the memory partition are read.
If the user configuration information is successfully read, the next step is performed.
If the user configuration information cannot be read, the next step is performed to acquire default configuration information.
S212, acquiring default configuration information from the recovery mirror image: this step is used to extract default configuration information from the restored image to restore the embedded device to the factory state.
And extracting default configuration data by analyzing the specified position or the specific file of the restored mirror image.
If the default configuration information is successfully acquired, the default configuration is applied and the next operation is performed.
If default configuration information is not available, it may be considered to use a predefined hard-coded configuration as an alternative.
The purpose of the above steps is to read the user configuration information according to the priority after recovering the mirrored partition recovery data information. If the user configuration information is not available, default configuration information in the restored image is used. Thus, the requirement of restoring the equipment to the last normal state or the factory state can be met.
The following description of the technical solution adopted by the present application is further described with reference to specific embodiments, and it should be noted that the following embodiments are for reference only, and specific mirror image structures and operation procedures may be different according to actual requirements.
Assume that our device is an intelligent home controller running a Linux-based operating system. In order to realize the function of equipment abnormality recovery, the following specific implementation steps are adopted:
1. design image file format
First, we need to design a specific image file format to store the contents of each partition of the device. The file format includes header information and partition content.
The header information includes: image file header, image version number, device model number, number of partitions, etc. This information is used to identify and verify the correctness of the image file.
The partition content is encrypted partition data, and each partition includes a partition type, a partition size, and partition data. The partition data is protected by encryption, so that the security of the data is ensured.
Specifically, the image file format may be presented as follows:
Recovery of image file name
[ Mirror head ]
Sign head 0xff 0x01 0x02 0x03 (custom)
Product model ABC123
Header content size 512bytes
Total size of mirror image 16MB+512b ytes
Storing a partition list:
partition 1 type-boot partition, size-1 MB, CRC check value-0 x12345678
Partition 2 type-kernel partition, size-3 MB, CRC check value-0 x87654321
Partition 3 type-configured partition, size-1 MB, CRC check value-0 xabcd4321
Partition 4 type-program partition, size-11 MB, CRC check value-0 x87656721
[ Mirror image body ]
Partition 1 mirror content (encryption): 0xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Partition 2 mirror content (encryption): 0xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The partition mirror image content is encrypted binary data and cannot be directly displayed. In effect, they are encrypted data in hexadecimal representation in the mirror portion.
For example, the portion of partition 1 that mirrors the content (encryption) may be as follows:
Partition 1 mirror content (encryption): 0x0123456789 ABCDEF.
Note that the content in the above example is just one placeholder Fu Shili and does not represent actual encrypted data. The actual encrypted data will contain the actual recovered mirrored content.
2. Mirror image generation when device anomalies occur
When an abnormality occurs in a device, it is necessary to generate an image file containing the current device state. The method comprises the following specific steps:
Collecting data of each partition of the device: including operating system partitions, application partitions, user-configured partitions, etc.
And (3) encrypting the data of each partition to protect the safety of the data.
And generating an image file according to the designed image file format, and filling head information and encrypted partition content.
3. Storage and transmission of image files
The generated image file may be stored on a storage medium local to the device, such as an SD card. In addition, the image file may be transferred to other devices for backup or remote restoration.
4. Device anomaly recovery process
When the equipment needs to be subjected to abnormal recovery, the method comprises the following steps of:
Loading an image file: the image file is read from the storage medium and loaded into the memory.
Specifically, whether the mark head of the file is hexadecimal '0xff 0x01 0x02 0x03' or not can be checked, and the file is confirmed to be an image file; checking whether the product model is matched with the current equipment or not, and ensuring that the mirror image is applicable to the current equipment; and it is also necessary to check whether the header content size and the mirror total size are consistent to ensure file integrity.
Checking the mirror image file: and verifying according to the head information of the image file, specifically, decrypting the image from the designated position according to the length by acquiring the record information of the first partition. And performing CRC check on the decrypted partition mirror image, and comparing the CRC check with CRC in the recorded information. And executing the steps circularly until all the partitions pass the verification or the verification is found to fail.
Decrypting the partition data: and decrypting the encrypted data of each partition to obtain the original partition content. Specifically, starting from a starting address, extracting a decrypted partition image according to the first partition length information; updating the starting address as the current position, and extracting and decrypting the mirror image of the second partition. Repeating the steps until the decryption images of all the partitions are obtained.
Erasure of partitions: and if the mirror image verification is successful, executing partition erasing operation, sequentially erasing each partition on the equipment, and preparing to write in the restored partition data.
Writing partition data: and writing the decrypted partition data into the corresponding partition to complete the abnormal recovery of the equipment.
Specifically, the decrypted first partition image is written into a corresponding storage partition of the embedded device, and the starting address and the length of the first partition are determined. And writing the decrypted mirror image data of the first partition into a corresponding partition of the storage device according to bytes, and ensuring the data integrity and correctness in the writing process.
Updating the starting address to be the starting position of the next partition, and writing the decrypted second partition image into the embedded device. The starting address and length of the second partition are determined. And writing the decrypted mirror image data of the second partition into the corresponding partition of the storage device according to bytes, and ensuring the data integrity and correctness in the writing process.
Repeating the steps until all the decrypted partition images are written into the embedded device.
And (3) configuration recovery judgment: after the power is turned on again, whether the user configuration partition is normal or not is judged. If normal, loading user configuration; if so, the default configuration is used for recovery.
Through the steps, the function of recovering the abnormality of the equipment can be realized. No matter the equipment is in fault or abnormal caused by misoperation of a user, the equipment can be recovered by loading the mirror image file, and the equipment can be ensured to normally operate.
Referring to fig. 4, the present application further includes an embedded device start-up exception recovery system, including:
The verification comparison module is used for acquiring recovery mirror image sub-data corresponding to each partition in a preset storage space when the equipment starting abnormality is detected; the preset storage space is used for storing a device boot loader.
And the extraction and erasing module is used for respectively erasing the data of the corresponding subareas according to each recovered mirror image sub-data.
Fig. 5 is a schematic structural diagram of an embedded device startup anomaly recovery device according to an embodiment of the present application. As shown in fig. 5, an embedded device start-up abnormality recovery device 50 of this embodiment includes: at least one processor 501 (only one shown in fig. 5), a memory 502, and a computer program 503 stored in the memory 502 and executable on the at least one processor 50, the processor 501 implementing the steps in any of the various embedded device-initiated exception recovery method embodiments described above when executing the computer program 503.
The embedded device startup anomaly recovery device/terminal device 50 may be a desktop computer, a notebook computer, a palm computer, a cloud server, or other computing devices. The embedded device boot exception recovery means/terminal device may include, but is not limited to, a processor 501, a memory 502. It will be appreciated by those skilled in the art that fig. 5 is merely an example of the embedded appliance start-up exception recovery apparatus/terminal device 50 and is not meant to limit the embedded appliance start-up exception recovery apparatus/terminal device 50, and may include more or fewer components than shown, or may combine certain components, or may include different components, such as input-output devices, network access devices, etc.
The processor 501 is referred to as a central processing unit (Central Processing Unit, CPU).
The memory 502 may in some embodiments be an internal storage unit of the embedded device-initiated exception recovery apparatus/terminal device 50, such as emmc or flash of the embedded device-initiated exception recovery apparatus/terminal device 50. The memory 502 may also be an external storage device of the embedded device-initiated-exception-recovery apparatus/terminal device 50 in other embodiments, such as a plug-in hard disk provided on the embedded device-initiated-exception-recovery apparatus/terminal device 50. Further, the memory 502 may also include both an internal storage unit and an external storage device of the embedded device start-up abnormality recovery apparatus/terminal device 50. The memory 502 is used to store an operating system, application programs, boot loader (BootLoader), data, and other programs, such as program code for the computer program.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other manners. For example, the apparatus/network device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. An embedded device start-up exception recovery method, comprising:
responding to the detection of the starting abnormality of the equipment, and acquiring recovery mirror image sub-data corresponding to each partition in a preset storage space; the preset storage space is used for storing a device boot loader;
and respectively erasing the data of the corresponding subarea according to each recovered mirror image sub-data.
2. The method of claim 1, further comprising, prior to acquiring restored image sub-data corresponding to each partition in a preset storage space in response to detecting the device start-up exception:
Identifying and loading restored mirror image data;
determining data segmentation reference information corresponding to each partition in the preset storage space according to the recovered mirror image data;
And splitting the restored mirror image data according to the data splitting reference information corresponding to each partition, and sequentially obtaining restored mirror image sub-data corresponding to each partition.
3. The method of claim 2, before determining the data slicing reference information corresponding to each partition in the preset storage space according to the recovered mirror data, comprising:
Obtaining mirror head information from the recovered mirror data; the mirror header information includes first check information regarding the recovered mirror data;
judging whether the recovered mirror image data is matched with the equipment or not according to the first verification information;
And responding to successful matching of the recovered mirror image data and the equipment, and checking the recovered mirror image data according to the first checking information.
4. The method of claim 2, further comprising, before determining the data slicing reference information corresponding to each partition in the preset storage space according to the restored mirror data:
Obtaining mirror head information from the recovered mirror data; the mirror header information includes second check information and position information about each partition in the preset storage space;
And respectively checking the partial recovery mirror image data corresponding to each partition according to the second checking information and the position information.
5. The method of claim 1, wherein the splitting the restored mirror data according to the data splitting reference information corresponding to each partition sequentially obtains restored mirror sub-data corresponding to each partition, includes:
sequentially clearing original storage contents of all partitions in the preset storage space;
and writing each recovered mirror sub-data into the corresponding partition.
6. The method of claim 1, wherein after splitting the restored mirror data according to the data splitting reference information corresponding to each partition, the method further comprises, after sequentially obtaining restored mirror sub-data corresponding to each partition:
reading user configuration information;
If the user configuration information fails to read, acquiring default configuration information from the recovery mirror image, wherein the default configuration information is used for enabling the equipment to recover from a factory state;
and executing a starting action on the equipment according to the default configuration information.
7. The method of claim 6, wherein the default configuration information and the user configuration information are JSON structured files.
8. An embedded device start-up exception recovery system, comprising:
The extraction module is used for acquiring recovery mirror image sub-data corresponding to each partition in a preset storage space when the equipment starting abnormality is detected; the preset storage space is used for storing a device boot loader;
And the erasing module is used for respectively erasing the data of the corresponding subareas according to each recovered mirror image sub-data.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method according to any one of claims 1 to 7.
CN202410204910.5A 2024-02-23 2024-02-23 Method, system and device for recovering starting exception of embedded device Pending CN118132335A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410204910.5A CN118132335A (en) 2024-02-23 2024-02-23 Method, system and device for recovering starting exception of embedded device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410204910.5A CN118132335A (en) 2024-02-23 2024-02-23 Method, system and device for recovering starting exception of embedded device

Publications (1)

Publication Number Publication Date
CN118132335A true CN118132335A (en) 2024-06-04

Family

ID=91239926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410204910.5A Pending CN118132335A (en) 2024-02-23 2024-02-23 Method, system and device for recovering starting exception of embedded device

Country Status (1)

Country Link
CN (1) CN118132335A (en)

Similar Documents

Publication Publication Date Title
CN110716895A (en) Target data archiving method and device, computer equipment and medium
CN112783537B (en) Embedded linux operating system upgrading method and system based on MTD storage device
CN104216800A (en) Automatic system fault recovering method and device based on data redundancy
CN106681865B (en) Service recovery method and device
CN115543694B (en) Flash device switching method and device, computer equipment and storage medium
CN111813753A (en) File saving method, file restoring method, device and terminal equipment
CN115309589A (en) Method, system and device for recovering temporary storage area of substrate management controller
CN111338889A (en) Evidence obtaining method, device, equipment and storage medium supporting multiple operating systems
CN109033818B (en) Terminal, authentication method, and computer-readable storage medium
CN108255644B (en) File system recovery method and device
CN114780298A (en) File data processing method and device, computer terminal and storage medium
CN117234791B (en) Method and device for detecting data loss of memory chip
CN112256532A (en) Test interface generation method and device, computer equipment and readable storage medium
CN118132335A (en) Method, system and device for recovering starting exception of embedded device
CN106445737A (en) Multi-backup starting method
CN116820528A (en) Firmware version upgrading method and device, chip and electronic equipment
CN116244111A (en) Data recovery method, storage method, medical equipment, device and electronic equipment
CN111857740A (en) Software upgrading method and device
CN110674511A (en) Offline data protection method and system based on elliptic curve encryption algorithm
CN115827069A (en) Starting control method, system and device for server mainboard
CN113065168A (en) Method, device and storage medium for storing and verifying authenticity of video data
CN105590065B (en) Method and device for protecting preset file
KR101623508B1 (en) System and Method for Recovery of Deleted Event Log Files
CN112269583B (en) Method for processing equipment operation abnormal file upgrade, server and storage medium
CN112631626B (en) System upgrading method and device based on double systems and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication