A startup method and storage medium based on heterogeneous multi-core chip
By using the verification and authentication mechanism of BootROM and startup boot module in the embedded system, a trusted chain is established and the startup process of heterogeneous multi-core chips is managed, which solves the reliability and security issues of the startup process and realizes the system's robustness. Ability and usability improvements.
Patent Information
- Application Number
- CN202010326901.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-23
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-04-23
AI Technical Summary
In embedded systems, there are reliability and security issues in the startup process of heterogeneous multi-core chips. Especially in the context of increasingly important network security, existing technology is difficult to ensure the integrity and reliability of the startup process, and lacks effective recovery mechanism.
By selecting BootROM as the root of trust, design a startup boot module, use the verification and authentication mechanism to establish a trusted chain, select the appropriate core and verify the relevant content, and use methods such as Merkle tree to back up and verify files. , ensure the safety and reliability of the startup process, and provide a recovery mechanism when verification fails.
It improves the security and reliability of the startup process of heterogeneous multi-core chips, ensures that the system can recover when files are damaged or updates fail, reduces the risk of user complaints and system failures, and enhances the robustness and availability of the system.
Smart Images

Figure CN113553115B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of embedded systems, and in particular to a startup method based on a heterogeneous multi-core chip and a computer-readable storage medium. Background Art
[0002] The development of technologies such as the Internet of Things and artificial intelligence has put forward more requirements for embedded systems. In some applications, the system is not only required to have high real-time performance, but also to have strong data processing capabilities. For example, in the field of automotive electronics, the gateway needs to support traditional CAN and LIN communications, so it is necessary to run a real-time operating system to achieve fast response and avoid communication frame loss. At the same time, in order to support functions such as FOTA, big data, and intrusion detection, a more powerful processing core is required to run a more complex operating system. Therefore, the actual diversified needs have prompted chip manufacturers to integrate multiple processing cores with different architectures in embedded chips to meet a variety of application scenarios. Summary of the invention
[0003] The present invention proposes a system security startup solution based on heterogeneous multi-core chips. Specifically:
[0004] According to one aspect of the present invention, a startup method based on a heterogeneous multi-core chip is provided, comprising the following steps: selecting BootROM as a trusted root, and verifying a startup boot module through BootROM; and if the startup boot module passes the verification, selecting a core to be started in the heterogeneous multi-core chip and its corresponding content to be verified according to a predetermined configuration.
[0005] Optionally, in some embodiments of the present invention, if the core selected to be started is a controller core, the content to be verified includes a calibration file and an APP file, and the method further includes: verifying the calibration file and the APP file through the startup boot module, and releasing the controller core if the verification passes.
[0006] Optionally, in some embodiments of the present invention, if the core selected to be started is a processor core, the content to be verified includes a uboot program, environment variables, a kernel, system services, a startup script, and an application, and the method further includes: verifying the uboot program through the startup boot module, and releasing the processor core if the verification passes; executing the uboot program through the processor core, and verifying the environment variables and the kernel in the uboot program; if the kernel passes the verification, copying it into the file system and verifying its system services and startup scripts; and if the system services and startup scripts pass the verification, executing the application, and verifying the application using the startup boot module.
[0007] Optionally, in some embodiments of the present invention, if the size of the content to be verified is smaller than a predetermined value, the content to be verified includes multiple backups to form a set to be verified together, and the method further includes: if an item in the set to be verified fails the verification, the item is recorded, and the remaining items in the set to be verified are used for verification; if all items in the set to be verified fail the verification, the verification of the content to be verified fails; and if any item in the set to be verified passes the verification, the verification of the content to be verified succeeds, and the recorded item is replaced with the item that passed the verification.
[0008] Optionally, in some embodiments of the present invention, if the size of the content to be verified is greater than or equal to a predetermined value, the content to be verified includes a backup file, and the method further includes: verifying the content to be verified by determining whether a Merkle tree set is legal, wherein the Merkle tree set includes a main file Merkle tree and a backup file Merkle tree generated as follows: dividing the content to be verified into multiple small files according to preset rules and calculating a hash value for each small file to construct the main file Merkle tree; and dividing the backup file into multiple small files according to the preset rules and calculating a hash value for each small file to construct the backup file Merkle tree.
[0009] Optionally, in some embodiments of the present invention, the Merkle tree set also includes multiple backups of the main file Merkle tree and multiple backups of the backup file Merkle tree.
[0010] Optionally, in some embodiments of the present invention, if any item in the Merkle tree set is legal, the Merkle tree of the current content to be verified is constructed according to the preset rules for the content to be verified; the Merkle tree of the current content to be verified is compared with each node of any item in the Merkle tree set: if each node of the Merkle tree of the current content to be verified is consistent with each node of any item, the current content to be verified passes the verification; or if each node of the Merkle tree of the current content to be verified has a consistent node in any item in the Merkle tree set, the data blocks corresponding to these consistent nodes are combined to replace the content to be verified, and the replaced content passes the verification.
[0011] Optionally, in some embodiments of the present invention, the boot module includes multiple backups, and the method includes the following steps: configuring a core to be started by the BootROM; and running the boot module and the latest version of its backups through the core.
[0012] Optionally, in some embodiments of the present invention, the content to be verified and its backup are verified in order from newest to oldest versions.
[0013] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and wherein when the instructions are executed by a processor, the processor is caused to execute any one of the methods described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The above and other objects and advantages of the present invention will become more fully apparent from the following detailed description taken in conjunction with the accompanying drawings, wherein the same or similar elements are denoted by the same reference numerals.
[0015] Figure 1 The figure illustrates a startup method based on a heterogeneous multi-core chip according to an embodiment of the present invention.
[0016] Figure 2 The figure illustrates a startup method based on a heterogeneous multi-core chip according to an embodiment of the present invention.
[0017] Figure 3 The figure illustrates a startup method based on a heterogeneous multi-core chip according to an embodiment of the present invention.
[0018] Figure 4 The figure illustrates a startup method based on a heterogeneous multi-core chip according to an embodiment of the present invention.
[0019] Figure 5 The figure illustrates a startup method based on a heterogeneous multi-core chip according to an embodiment of the present invention.
[0020] Figure 6 The figure illustrates a startup method based on a heterogeneous multi-core chip according to an embodiment of the present invention.
[0021] Figure 7 The figure illustrates a startup method based on a heterogeneous multi-core chip according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] Usually, embedded systems start running from the firmware BootROM in the chip, and then jump to the pre-configured user program address for execution. This program configures the system clock, related peripherals, and runs the operating system. However, when the processor has multiple cores, and each core has a different architecture and runs a different operating system, there are many optional startup paths. How to choose the startup file during the startup process directly affects the correct operation of subsequent programs.
[0023] In addition, as the concept of the Internet of Everything becomes more popular, more and more embedded devices are connected to the Internet, and network security becomes an unavoidable issue. If the boot process is unreliable, the security of subsequent applications is out of the question. If the boot scheme is configured by selecting only one trusted root and forming a trusted chain based on it, the reliability of the selected trusted root still needs to be further strengthened.
[0024] Finally, during the startup process, according to the running order of each program on the trusted chain, the upper-level program verifies the reliability and integrity of the lower-level program. If the verification fails, the current practice is to abandon the startup. The consequence of this method is that if a file is damaged or the file update fails, it will seriously hinder the normal execution of the system function, which will inevitably cause user complaints. The measure that can be taken is to back up the file. If a file fails to verify, the backup file is automatically enabled. The problem is that there is a lack of recovery mechanism after the file is damaged. When two files are tampered with at the same time or one of the two files fails to update and the other is tampered with, the system cannot start. How to improve the reliability of the startup process is also a problem that needs to be solved.
[0025] In the context of the present invention, unless otherwise specified, if the verification fails, the startup fails. For the sake of brevity, some examples of the present invention may only describe the flow of passing the verification in the verification process, but those skilled in the art will know after reading this application that the normal process of startup failure should be followed, unless otherwise specified in some examples of the present invention.
[0026] The purpose of the present invention is to design an embedded system secure boot solution for heterogeneous multi-core chips to safely boot embedded chips with heterogeneous multi-core characteristics, thereby providing a trusted operating environment for subsequent programs.
[0027] According to one aspect of the present invention, a startup method based on a heterogeneous multi-core chip is provided. Figure 7 As shown, the method includes the following steps: selecting BootROM as the trusted root, and verifying the boot module through BootROM; and if the boot module passes the verification, selecting the core to be started in the heterogeneous multi-core chip and its corresponding content to be verified according to a predetermined configuration.
[0028] In some examples of the present invention, BootROM can be selected as a trusted root, and a trusted chain is established with the designed boot module as the intermediary according to the characteristics of heterogeneous multi-core chips, and several schemes of credibility measurement are proposed. BootROM is a protected storage area in the chip, which stores the code that is first executed after the chip is powered on. This code is written before the chip leaves the factory, and the user cannot modify it after leaving the factory, so it is very reliable to use BootROM as a security root. At this time, BootROM needs to support the verification of the integrity and authenticity of the next level program. Now some chips (such as TC297, S32G) already support this function. Usually, these chips also provide a hardware security module for encryption and decryption calculations. For chips equipped with hardware security modules, BootROM needs to first verify the firmware of the hardware encryption module, and then run the firmware, through the program of the hardware encryption module or the user program (for example, the boot module) that is first executed by BootROM.
[0029] In some embodiments of the present invention, if the core selected to be started is a controller core, the content to be verified includes calibration files and APP files, and the method also includes: verifying the calibration files and APP files by starting the boot module, and releasing the controller core if the verification passes.
[0030] In some examples of the present invention, after verification, the boot module starts to execute, and the module selects the core to be started and its corresponding program according to the configuration. If it is a controller core, it needs to run a real-time operating system, then the boot module first verifies the calibration file, then verifies the APP file, and verifies that the core is released. The trust chain formed by this is as follows Figure 1 shown.
[0031] In some embodiments of the present invention, if the core selected to be started is a processor core, the content to be verified includes the uboot program, environment variables, kernel, system services, startup scripts and applications, and the method also includes: verifying the uboot program through the startup boot module, and releasing the processor core if the verification passes; executing the uboot program through the processor core, and verifying the environment variables and kernel in the uboot program; if the kernel passes the verification, copying it into the file system and verifying its system services and startup scripts; and if the system services and startup scripts pass the verification, executing the application, and verifying the application using the startup boot module.
[0032] In some examples of the present invention, after verification, the boot module starts to execute, and the module selects the core to be started and its corresponding program according to the configuration. If it is a processor core, it needs to run a complex operating system such as Linux. The boot module first verifies uboot, releases the core after verification, and executes the uboot program by the processor core, and verifies the environment variables and kernel in the uboot program. After the kernel passes the verification, it is copied into the file system and its system services and startup scripts are verified. After the verification passes, the application starts to execute, and the boot module verifies the application to be executed. The trust chain formed by this is as follows Figure 2 shown.
[0033] In some examples of the present invention, a digital signature can be selected for program verification. When the program is downloaded, a hash value is calculated for the program, and the hash value is encrypted with the manufacturer's private key. The generated digital signature is stored in a non-volatile memory together with the program. The corresponding public key is stored in the write-protected memory in the controller. The signature is verified before each program is started. After the verification, the hash value of the current program is calculated and compared with the value stored in the memory. If they are the same, it proves that the program is complete and authentic. In addition, some authentication methods, such as HMAC, CMAC, GMAC, AES GCM, etc., can also be used to authenticate the next-level program. The key used in the process is stored in the memory of the chip and protected by an encryption algorithm. Before use, the key is decrypted to obtain the key and its authenticity is verified, and then the decrypted key is used to authenticate the program.
[0034] In some embodiments of the present invention, if the size of the content to be verified is less than a predetermined value (for example, 50 kB), the content to be verified includes multiple backups to form a set to be verified together, and the method also includes: if an item in the set to be verified fails to pass the verification, the item is recorded, and the remaining items in the set to be verified are used for verification: if all items in the set to be verified fail to pass the verification, the verification of the content to be verified fails; and if any item in the set to be verified passes the verification, the verification of the content to be verified succeeds, and the recorded item is replaced with the item that passed the verification.
[0035] In some examples of the present invention, a mechanism for boot file recovery is designed to deal with tampering, destruction, and failure of normal refresh of the boot file, thereby improving the robustness of the boot process. Files are divided into two categories. For smaller files, the memory occupancy is relatively small, and multiple backups can be made for them. If the verification fails, they are recorded and the verification of the backup programs is enabled. If all backup programs fail the verification, the system is reset. If one backup program passes the verification, the program is executed and the next program in the trust chain is verified. After the startup is completed, the boot module repairs the marked startup programs that have not passed the verification. The specific method is to replace the corresponding programs that failed the verification with the programs used in this normal startup. The process is as follows. Figure 3 shown.
[0036] In some embodiments of the present invention, if the size of the content to be verified is greater than or equal to a predetermined value (e.g., 50 kB), the content to be verified includes a backup file, and the method further includes: verifying the content to be verified by determining whether a Merkle tree set is legal, wherein the Merkle tree set includes a main file Merkle tree and a backup file Merkle tree generated in the following manner: the content to be verified is stored in a Merkle tree according to a preset rule (e.g., Figure 5 The method comprises dividing the backup file into multiple small files according to the preset rule and calculating a hash value for each small file to construct the main file Merkle tree; and dividing the backup file into multiple small files according to the preset rule and calculating a hash value for each small file to construct the backup file Merkle tree.
[0037] In some embodiments of the present invention, the Merkle tree set also includes multiple backups of the main file Merkle tree and multiple backups of the backup file Merkle tree.
[0038] In some embodiments of the present invention, if any item in the Merkle tree set is legal, the Merkle tree of the current content to be verified is constructed according to preset rules for the content to be verified; the Merkle tree of the current content to be verified is compared with each node of any item in the Merkle tree set: if each node of the Merkle tree of the current content to be verified is consistent with each node of any item, the current content to be verified passes the verification; or if each node of the Merkle tree of the current content to be verified has a consistent node in any item in the Merkle tree set, the data blocks corresponding to these consistent nodes are combined to replace the content to be verified, and the replaced content passes the verification.
[0039] In some examples of the present invention, for larger files, such as the APP program used in the controller core, the Bootloader program involved in the processor core, the kernel and the file system, etc., if they are backed up multiple times, it will cause a large amount of memory consumption, which is not suitable for the embedded field with limited memory resources. For these files, only one backup can be performed, which will be referred to as the main file and the backup file in the following text. The two files are logically divided into multiple small files, and the hash value is calculated for each small file to construct a Merkle tree. Since the Merkle tree is much smaller than the original file, the aforementioned method can be used to back it up multiple times for protection, and then the authentication code or digital signature is attached and saved in the memory. Taking uboot as an example, its Merkle tree is as follows: Figure 4 shown.
[0040] The boot module first verifies the data of the tree structure. If it passes, a Merkle tree is constructed for the current file with the same logical division, and the root nodes are compared. If they are the same, the current file verification passes. If they are different, the modified logical blocks are marked, and the Merkle tree of the stored backup file is authenticated. After the authentication passes, the Merkle tree is calculated for the backup file and compared with the stored value. If the root node of the backup file Merkle tree is correct, the backup file is enabled. Otherwise, it is determined whether the root nodes of the Merkle trees stored in the main file and the backup file are consistent. If they are consistent, try to use the correct logical blocks in the main file and the backup file to repair each other. If all intact data blocks can constitute the entire program, the repair is successful, and the combined file is used to continue the startup process. Otherwise, the startup fails and the system is reset. The process is as follows Figure 5 shown.
[0041] In some embodiments of the present invention, the boot module includes multiple backups, and the method includes the following steps: configuring a core to be started by the BootROM; and running the boot module and the latest version of its backups through the core.
[0042] In some embodiments of the present invention, the content to be verified and its backup are verified in order from the newest to the oldest version.
[0043] In some examples of the present invention, in view of the complex operating environment and the large number of startup files on heterogeneous multi-core embedded systems, a boot mechanism for the startup process is established by comprehensively considering factors such as startup time and file version, so that the system selects the best startup path. For example, the core started by BootROM can be configured first, and this core is responsible for running the startup boot module, while other cores run the application program, so the startup program will not affect the execution of the application program. When the startup boot module is verified and run, the module first compares and selects the latest version of the program in the module and its unverified backup. If the latest version of the program is currently running, continue. Otherwise, reset the system and re-run the startup process. Thereafter, select the corresponding trust chain according to the core that needs to be started at present, and start the next level boot program in the trust chain (such as uboot, etc.).
[0044] In some examples of the present invention, the boot module first selects the latest version of the next-level program in the trust chain, marks it as the main file, and marks other files as backup files. The module verifies the main file. If it passes, the boot process continues. If it fails, another backup file is selected and the version number of the backup file is compared with the version number of the previous-level file. If they are compatible, the backup file is verified. If successful, the current file is marked as the main file. If all backup files fail to verify, recovery is attempted. If it still fails, the system is reset. When the number of resets exceeds the limit, the boot module causes the chip to enter bootloader mode. In this mode, developers can burn digitally signed programs into the chip RAM through various communication pins and start directly from the RAM. The program can then load other files and start normally. After the normal startup is successful, the boot module overwrites the corresponding files that failed to verify during the startup process with the currently used files. The working process of the boot module is as follows: Figure 6 As shown,
[0045] In order to further illustrate the present invention, the startup of the S32G chip is taken as an example for detailed description.
[0046] The selected S32G chip has 3 Cortex-M7 cores and 4 Cortex-A53 cores, and has a hardware security module HSE. At startup, the program in the BootROM starts to execute first. The program checks the functions of the registers and configures the peripherals during the startup process. Then it copies and verifies the firmware of the hardware security module HSE from the external Flash. If the verification passes, the HSE firmware starts to execute, and then jumps to the user file address in the startup vector table to start execution.
[0047] In this example, the address corresponds to the program start address of the boot module, which is executed by a Cortex-M7 core. The HSE firmware first authenticates the boot module with AES GCM. The authentication is performed by the HSE module. Before authentication, it is necessary to verify whether the key used is credible, and then compare the current file version with the unverified backup file version. If the current file is the latest version, it will continue to execute. Otherwise, the address of the backup file is written into the boot vector table, triggering a chip reset and re-running the boot program. This setting enables the chip to run the latest version of the intact boot module program.
[0048] After the file version check passes, according to the settings, the boot module first needs to boot the Cortex-M7 core to run. The module copies the calibration and APP programs to SRAM according to the configuration, and authenticates the calibration and APP respectively with AES GCM. Once the authentication passes, the module triggers the core reset and operation of the APP. Because the calibration file in this example is small, it is backed up twice in the system. If the calibration authentication fails, the file that failed the authentication is recorded, the current calibration file is set as the backup file, and another file in the system is set as the main file authentication. It is determined whether the version number matches and authenticated. If the authentication succeeds, the APP file is authenticated. Since the APP file is large, it has only one backup. First, the Merkle tree of the main file is read (the Merkle tree of the main file and the backup file has three backups) and AES GCM authentication is performed. If the authentication fails, the backup Merkle tree is read again for authentication until all backups fail to authenticate, and then the current boot process is abandoned. If the authentication is successful, the APP file is read into SRAM and its Merkle tree is calculated. The root node value of the stored Merkle tree is compared with the calculated root node value. If they are the same, it indicates that the current APP can be run. Otherwise, the Merkle tree of the backup file and the backup file are read in the same way as the main file. If the backup file is correct, the backup file is enabled. Otherwise, the root nodes of the Merkle trees of the stored main file and backup file are determined. If they are the same, the correct program blocks in the main file and backup file are selected to try to form a complete program. If the complete program can be successfully formed, the startup can continue. Otherwise, the system is reset and the startup is attempted again. If all the above checks are passed, the booted core is reset to start running.
[0049] After the program of the M7 core runs, the boot module starts to boot the program of the A53 core. The bootloader used by the A53 core is uboot. First, the module copies the first part of the uboot code to Nor Flash and authenticates it. This code contains the copy and authentication of the remaining uboot program. The first code of uboot has a main file and two backups. The remaining code of uboot and the subsequent Linux kernel and file system occupy a large amount of memory. There is only one backup, but each file saves 3 corresponding Merkle trees. The authentication and recovery process of the remaining uboot code is consistent with the above APP. The second code of uboot contains the authentication program for environmental variables and the kernel. After the kernel runs successfully, it will authenticate the startup script and system services. In order to reduce the startup time, the authentication of the application is then performed by the core where the boot program is located. Once the authentication fails, the backup application is started.
[0050] When all applications pass authentication, the boot module processes the files that failed authentication. The specific method is to query the records during the boot process and overwrite the files that failed authentication with the same type of files used in this boot process. Therefore, all files including the main file and the backup file are in a completely safe state when the system is started next time. If the number of system resets caused by authentication failure during the boot process exceeds the preset limit, the boot program configures the chip to enter the serial boot mode of S32G after reset, and writes the boot loader directly into RAM through CAN, UART, Ethernet and other communication methods to start running. The boot loader is protected by digital signatures or message authentication codes to ensure that only legitimate people can use this method to start the chip. The program loads the new boot program, the calibration and APP used by the M7 core, the uboot, kernel, file system used by the A53 core, etc. This measure avoids the situation where the chip cannot be used after the file is attacked and cannot be restored, and can only be replaced, thereby reducing the user's cost.
[0051] According to another aspect of the present invention, a computer-readable storage medium is provided, in which instructions are stored, and it is characterized in that when the instructions are executed by a processor, the processor executes any one of the methods described above. The computer-readable medium referred to in the present invention includes various types of computer storage media, which can be any available medium that can be accessed by a general-purpose or special-purpose computer. For example, the computer-readable medium can include RAM, ROM, EPROM, EEPROM, etc. 2PROM, register, hard disk, removable disk, CD-ROM or other optical disk storage, disk storage or other magnetic storage device, or can be used to carry or store the desired program code unit in the form of instruction or data structure and can be accessed by general or special purpose computer, or general or special purpose processor. Any other temporary or non-temporary medium. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and blue-ray disc, wherein the disk usually copies data magnetically, and the disc uses laser to copy data optically. The above combination should also be included in the protection scope of computer-readable medium. Exemplary storage medium is coupled to the processor so that the processor can read and write information from / to the storage medium. In an alternative, the storage medium can be integrated into the processor. The processor and storage medium can reside in the ASIC. The ASIC can reside in the user terminal. In an alternative, the processor and storage medium can reside in the user terminal as discrete components.
[0052] In view of the above, it can be seen that some embodiments of the scheme of the present invention have at least one of the following advantages compared with the prior art: (1) BootROM is selected as the trusted root, and security is greatly enhanced; (2) According to the possible application scenarios of heterogeneous multi-core chips, a boot boot module is used to manage and maintain multiple trusted chains, ensuring the security and reliability of the entire boot process; (3) Different boot file security mechanisms are formulated according to the size of the boot file. The mechanism can restore the damaged boot file to a certain extent. Compared with the current practice, the mechanism improves the system's ability to resist attacks and prevent risks such as refresh failure; (4) A boot mechanism is designed during the startup process of a heterogeneous multi-core system. The mechanism can effectively manage multiple files in the system and select the optimal boot path from them. In addition, a system recovery mechanism is provided in the event of a boot failure, thereby ensuring the security of the system, improving the availability of the system, and helping to reduce user losses and complaints.
[0053] The above examples mainly illustrate the startup method based on heterogeneous multi-core chips and computer-readable storage media of the present invention. Although only some of the embodiments of the present invention are described, it should be understood by those skilled in the art that the present invention can be implemented in many other forms without departing from its subject matter and scope. Therefore, the examples and embodiments shown are regarded as illustrative rather than restrictive, and the present invention may cover various modifications and substitutions without departing from the spirit and scope of the present invention as defined in the appended claims.
Claims
1. A startup method based on a heterogeneous multi-core chip, characterized in that: The method comprises the following steps: Select BootROM as the trusted root and verify the boot module through BootROM; and If the boot module passes the verification, the core to be started in the heterogeneous multi-core chip and its corresponding content to be verified are selected according to the predetermined configuration. Wherein, if the core selected to be started is a controller core, the content to be verified includes a calibration file and an APP file, and the method further includes: The calibration file and the APP file are verified by the boot module, and if the verification passes, the controller core is released. Wherein, if the core selected to be started is a processor core, the content to be verified includes a uboot program, an environment variable, a kernel, a system service, a startup script, and an application, and the method further includes: Verifying the uboot program through the boot module, and releasing the processor core if the verification passes; Executing the uboot program through the processor core, and verifying the environment variables and the kernel in the uboot program; If the kernel passes the verification, copy it into the file system and verify its system services and startup scripts; and If the system service and the startup script pass the verification, the application is executed, and the startup boot module is used to verify the application.
2. The method according to claim 1, characterized in that If the size of the content to be verified is smaller than a predetermined value, the content to be verified includes a plurality of backups to form a set to be verified, and the method further includes: If an item in the set to be verified fails the verification, the item is recorded and the remaining items in the set to be verified are used for verification: If all items in the to-be-verified set fail to pass the verification, the verification of the to-be-verified content fails; and If any item in the set to be verified passes the verification, the verification of the content to be verified is successful, and the recorded item is replaced with the item that passed the verification.
3. The method according to claim 2, characterized in that If the size of the content to be verified is greater than or equal to a predetermined value, the content to be verified includes a backup file, and the method further includes: verifying the content to be verified by determining whether the Merkle tree set is legal, wherein The Merkle tree set includes a main file Merkle tree and a backup file Merkle tree generated as follows: Dividing the content to be verified into multiple small files according to a preset rule and calculating a hash value for each small file to construct the main file Merkle tree; and The backup file is divided into multiple small files according to the preset rule and a hash value is calculated for each small file to construct the backup file Merkle tree.
4. The method according to claim 3, characterized in that The Merkle tree set also includes multiple backups of the main file Merkle tree and multiple backups of the backup file Merkle tree.
5. The method according to claim 4, characterized in that If any item in the Merkle tree set is legal, construct the Merkle tree of the current content to be verified according to the preset rules. Compare the current Merkle tree of the content to be verified with each node of any item in the Merkle tree set: If the nodes of the Merkle tree of the current content to be verified are consistent with the nodes of any item, the current content to be verified passes the verification; or If each node of the Merkle tree of the current content to be verified has a consistent node in any item in the Merkle tree set, the data blocks corresponding to these consistent nodes are combined to replace the content to be verified, and the replaced content passes the verification.
6. The method according to claim 2 or 3, characterized in that: The boot module includes multiple backups, and the method includes the following steps: Configure the core to be started by BootROM; and The boot module and the latest version in its backup are run through the core.
7. The method according to claim 6, characterized in that The content to be verified and its backup are verified in order from the newest to the oldest version.
8. A computer-readable storage medium having a computer program / instruction stored therein, characterized in that: When the computer program / instructions are executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
9. A computer program product, comprising a computer program / instructions, characterized in that: When the computer program / instructions are executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
