Starting method and device of embedded equipment, electronic equipment and storage medium

Through initial binding and bidirectional authentication between the master and slave chips, the problem of the trust root attack on the embedded device during startup is solved, ensuring the secure boot and overall security of the device.

CN118963858APending Publication Date: 2024-11-15HONGHU WANLIAN (JIANGSU) TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411054410.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

Embedded devices are vulnerable to trust root attacks during startup, resulting in compromised security, and existing solutions are difficult to effectively prevent such threats.

Method used

Through the initial binding and two-way authentication of the master control chip and slave chip, the security of the operating system is ensured at startup, and the operating system startup measurement verification is used to ensure the integrity of the trust chain.

Benefits of technology

Effectively prevent embedded devices from being attacked during startup, ensure the safe start of the device, and improve the overall security of embedded devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963858A_ABST
    Figure CN118963858A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a starting method and device of embedded equipment, electronic equipment and a storage medium. The embedded device comprises a master control chip and at least one slave chip, and the master control chip is in communication connection with the slave chips; the starting method of the embedded device comprises the following steps: in response to a power-on instruction of a target embedded device, performing initialization binding with each slave chip through a master control chip; under the condition that initialization binding of the slave chips succeeds, operating system starting measurement of the target embedded device is carried out through the slave chips; and starting the operating system under the condition that the starting measurement of the operating system is successfully verified. According to the scheme provided by the embodiment of the invention, the problem that the root of trust is attacked in the starting process of the embedded equipment is solved, the embedded equipment can be safely started, and the safety of the embedded equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a startup method, device, electronic device and storage medium for an embedded device. Background Art

[0002] With the advent of the era of the Internet of Everything, various intelligent embedded devices are widely deployed around us. On the one hand, they provide us with various convenient services; on the other hand, these devices may have vulnerabilities and be controlled by attackers, which themselves become a source of threats to user privacy. If the security of various embedded devices cannot be guaranteed, their data may be stolen or tampered with, which may not only cause them to fail to operate normally, but also threaten the personal safety of users in key fields such as medical care, autonomous driving, aerospace, or rail transportation. Therefore, while requiring the normal availability of device functions, it is even more necessary to ensure their security.

[0003] Among the security attributes of embedded devices, startup security is an important part. If the device is attacked during the startup phase and is no longer secure and trustworthy, then all security protection measures taken thereafter will be difficult to guarantee the security of the device. Therefore, it is crucial to perform security reinforcement during the device startup phase to ensure the security of the device startup.

[0004] Although boot security reinforcement has become an industry consensus, there are still many vulnerabilities and threats. In the existing solutions, during the boot process of embedded devices, the chip is relatively independent and may be attacked by the root of trust, thus threatening the security of embedded devices.

[0005] How to prevent the root of trust of embedded devices from being attacked during the startup process is a key research issue in the industry. Summary of the invention

[0006] The present invention provides a startup method, device, electronic device and storage medium for an embedded device, so as to solve the problem that the trust root of the embedded device is attacked during the startup process, so that the embedded device can be started safely and the security of the embedded device is improved.

[0007] According to one aspect of the present invention, a method for starting an embedded device is provided. The embedded device comprises: a master control chip and at least one slave chip, wherein the master control chip is communicatively connected with each of the slave chips; the method comprises:

[0008] In response to a power-on instruction of the target embedded device, initializing and binding the master control chip with each of the slave chips;

[0009] When each of the slave chips is successfully initialized and bound, the operating system startup measurement of the target embedded device is performed through each of the slave chips;

[0010] In case the operating system startup metric verification succeeds, the operating system is started.

[0011] According to another aspect of the present invention, a startup device for an embedded device is provided, the embedded device comprising: a master chip and at least one slave chip, the master chip being communicatively connected with each of the slave chips; the device comprising:

[0012] An initialization binding module, used for responding to a power-on instruction of a target embedded device and initializing binding with each of the slave chips through the master control chip;

[0013] An operating system startup measurement module, used to perform operating system startup measurement of the target embedded device through each slave chip when each slave chip is successfully initialized and bound;

[0014] The operating system startup module is used to start the operating system if the operating system startup metric verification succeeds.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the startup method of the embedded device described in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the startup method of an embedded device described in any embodiment of the present invention when executed.

[0020] According to another aspect of the present invention, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method for starting an embedded device according to any embodiment of the present invention is implemented.

[0021] The technical solution of the embodiment of the present invention responds to the power-on instruction of the target embedded device, initializes and binds the master chip with each of the slave chips; when the initialization and binding of each of the slave chips is successful, the operating system startup measurement of the target embedded device is performed by each of the slave chips; when the operating system startup measurement verification is successful, the operating system is started, which solves the problem of the trusted root of the embedded device being attacked during the startup process, can enable the embedded device to be safely started, and improves the security of the embedded device.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 is a flowchart of a method for starting an embedded device provided in accordance with Embodiment 1 of the present invention;

[0025] Figure 2 This is a schematic diagram of the structure of a main control chip provided according to Embodiment 1 of the present invention;

[0026] Figure 3 is a schematic diagram of the structure of a slave chip provided according to Embodiment 1 of the present invention;

[0027] Figure 4 This is a schematic diagram of a process of initializing and binding a master chip and a slave chip according to Embodiment 1 of the present invention;

[0028] Figure 5 is a schematic diagram of the structure of a startup device for an embedded device provided according to Embodiment 3 of the present invention;

[0029] Figure 6 It is a structural schematic diagram of an electronic device for implementing the startup method of an embedded device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] Embodiment 1

[0033] Figure 1 This is a flowchart of a startup method for an embedded device provided according to Embodiment 1 of the present invention. This embodiment is applicable to the case of securely starting an embedded device. The method can be executed by a startup device of the embedded device. The startup device of the embedded device can be implemented in the form of hardware and / or software. The startup device of the embedded device can be configured in electronic devices such as computers, servers or tablet computers.

[0034] Before specifically introducing the specific steps of the startup method of the embedded device involved in this embodiment, it is also necessary to explain that the embedded device involved in this embodiment may include a master chip and at least one slave chip; wherein the master chip can be communicatively connected with each slave chip.

[0035] Main control chip: also known as the main control chip, it is the core component of the motherboard or hard disk, the bridge between various devices, and the brain that controls the operation of the device.

[0036] Slave chip: one or more auxiliary chips opposite to the master chip, which assist the master chip in completing specific tasks or providing additional functions. In this embodiment, the slave chip is a trusted security chip that provides trusted root and cryptographic algorithm capabilities.

[0037] It should also be noted that the embedded devices involved in this embodiment are deployed with the open source Hongmeng operating system (OpenAtom OpenHarmony, OpenHarmony). OpenHarmony is an open source distributed operating system built by developers around the world. It has the characteristics of being oriented to all scenarios and distributed. It is a "fully (all-field) new (new generation) open (open source)" operating system.

[0038] refer to Figure 1 , the startup methods of embedded devices include:

[0039] Step 110 : In response to a power-on instruction of the target embedded device, initialization binding is performed with each of the slave chips through the master control chip.

[0040] In an optional implementation of this embodiment, after the target embedded device is powered on, the master control chip is powered on first, and the master control chip is initialized and bound to each slave chip. The target embedded device is any device that is deployed with the OpenHarmony operating system and has a master control chip and a slave chip, and the functions and attributes thereof are not limited in this embodiment.

[0041] Figure 2 is a schematic diagram of the structure of a main control chip provided according to the first embodiment of the present invention, such as Figure 2 As shown, the main control chip mainly includes a unique encoding module 210 , an algorithm capability module 220 and a data preset area 230 .

[0042] Among them, the unique coding module 210 is used for binding with the slave chip, two-way authentication verification, and calculation factors for updating the PCR (Platform Configuration Register) measurement value of the terminal startup file at all levels; wherein the unique code can be an SN code (Serial Number) or a CPUID (CPU Identification).

[0043] The algorithm capability module 220 can select different algorithms for integrity, two-way identity authentication, and one-way identity authentication according to the algorithm support of different main control chips.

[0044] It should be noted that, in this embodiment, in addition to integrity verification, two-way identity authentication and one-way identity authentication, the algorithm capability module 220 can also make selections based on the capability support of the main control chip, which is not limited in this embodiment.

[0045] The data preset area 230 can store the boot of the chip and the checksum of the chip system; it can also store the preset keys and certificates for one-way authentication and two-way authentication.

[0046] Figure 3 is a schematic diagram of the structure of a slave chip provided according to the first embodiment of the present invention, such as Figure 3 As shown, the slave chip mainly includes a checking module 310 , a boot and chip operating system module 320 , and an authentication data storage area 330 .

[0047] The slave chip selection involved in this embodiment uses a trusted security chip, which has the ability of trusted root storage and national secret SM algorithm, generates SM2 identity public and private keys and signature certificates by itself, and pre-sets the master chip signature certificate for two-way authentication with the master chip.

[0048] The checking module 310 may calculate CRC (Cyclic Redundancy Check) values ​​of various levels of boot and chip operating system according to the boot and chip operating system module 320 .

[0049] The authentication data storage area 330 may include measurement value areas at all levels of the embedded operating system, and store the concatenated string of the measurement value PCR; illustratively, PCR (BL1 bootloader) + PCR (BL2 image) + PCR (BL31image) + PCR (BL32 image) + PCR (kernel image) + PCR (TEE image) + PCR (recover image) + PCR (BL33) + PCR (uboot partition) + PCR (kernel partition) + PCR (rootfs partition) + PCR (OEM partition) is 12*32 bytes in total, and 12 is the number of trust chain components in the startup phase. Here, the system startup process of the OpenHarmony operating system is briefly described, and the key file measurement value PCR can be added according to the needs, including but not limited to the OpenHarmony operating system and the corresponding startup process related files. The unique encoding storage area of ​​the main control chip of the slave chip is filled with all 0xFF before initialization. The initialization binding flag bit of the slave chip and the main control chip is set to FALSE, and the algorithm capability is not provided to other modules. If a module is called, an error that the initialization binding is not performed is returned.

[0050] In an optional implementation of the present embodiment, initializing binding with each of the slave chips through the master control chip may include: sending a first message to the target slave chip through the master control chip; the first message includes: a verification random number and a verification algorithm flag; the target slave chip parses the first message to obtain the verification random number and the verification algorithm flag; determines a first environment verification code, and sends the first environment verification code to the master control chip; the master control chip calculates a second environment verification code, and determines whether the second environment verification code is consistent with the first environment verification code; if they are consistent, sending a second message to the target slave chip; the second message includes: the target slave chip parses the second message to obtain a first verification code, compares the first verification code with the calculated second verification code, and determines whether the first verification code is consistent with the calculated second verification code; if they are consistent, the target slave chip is verified and the master control chip and the target slave chip are successfully initialized and bound.

[0051] It should be noted that the first environment verification code, the second environment verification code, the first verification code and the second verification code involved in this embodiment are all character strings calculated by the main control chip or the slave chip, and their specific forms are not limited in this embodiment; the "first" and "second" involved are only for the convenience of description and have no specific meaning.

[0052] Based on the above scheme, if the master control chip determines that the second environment verification code is inconsistent with the first environment verification code, the master control chip stops the instruction request to the target slave chip and issues an alarm; if the target slave chip determines that the first verification code is inconsistent with the calculated second verification code, the initialization binding process is stopped and the startup measurement of the target slave chip is not released.

[0053] The target slave chip may be any slave chip in the embedded device, which is not limited in this embodiment.

[0054] Optionally, in this embodiment, a first message can be sent to the target slave chip through the main control chip, and the first message can include a verification random number and a verification algorithm flag; wherein the verification random number RND contains 16 bytes, and the verification algorithm flag selects SM3 (hash algorithm)-SM2 (asymmetric algorithm).

[0055] Furthermore, the target slave chip parses the received first message to obtain the verification random number and verification algorithm flag carried by the first message; the target slave chip determines the first environment verification code based on the verification random number and verification algorithm flag obtained by parsing, and sends the environment verification code to the main control chip.

[0056] In this embodiment, the target slave chip calculates the flash checksum of BOOT and COS through the verification module: CRC (first-level BOOT), CRC (second-level BOOT), CRC (chip operating system); calculates the environment check code through the verification algorithm: checkCodeHASH (32 bytes) = SM3 (RND, CRC (first-level BOOT), CRC (second-level BOOT), CRC (COS)); checkCodeSIGN (64 bytes) = SM2 (checkCodeHASH1, PrvKey (slave chip identity private key)); checkCode1 = checkCodeHASH + checkCodeSIGN, a total of 96 bytes. Among them, checkCode1 is the first environment check code involved in this embodiment.

[0057] Furthermore, the main control chip calculates a second environment verification code and determines whether the second environment verification code is consistent with the first environment verification code; if they are consistent, a second message is sent to the target slave chip.

[0058] In this embodiment, the master chip can read the CRC values ​​of the first-level BOOT, second-level BOOT and chip operating system in the data preset area: CRC (first-level BOOT`), CRC (second-level BOOT`), CRC (COS`); obtain the latest random number RND` (16 bytes) in the random number generator; read the preset slave chip identity signature certificate and parse the slave chip identity public key PubKey. Verify the slave chip computing environment check code signature: PubSignVerify (checkCodeHASH, checkCodeSIGN, slave chip identity public key PubKey); after verification, use the master chip preset data to calculate the slave chip checkCodeHASH` = SM3 (RND`, CRC (first-level BOOT`), CRC (secondary BOOT`), CRC (COS`)); compare checkCodeHASH and checkCodeHASH` for consistency; further, compare checkCode1' with the sent back checkCode1 for consistency.

[0059] If they are consistent, a message (second message) for updating the unique code of the main control chip is sent, with a total of 112 bytes: SN / CPUID value (16 bytes) + check Code2 (96 bytes for this data verification code; checkCodeHASH2 (32 bytes) = SM3 (SN / CPUID, CRC (first-level BOOT`), CRC (secondary BOOT`), CRC (COS`)); checkCodeSIGN2 (64 bytes) = SM2 (checkCodeHASH2, PrvKey (main control chip identity private key)); checkCode2 = checkCodeHASH2 + checkCodeSIGN2, a total of 96 bytes; among them, checkCode2 is the first verification code involved in this embodiment; if they are inconsistent, the main control chip stops the instruction request for the target slave chip and issues an alarm.

[0060] The slave chip parses the second message to obtain the master chip SN / CPUID and the first check code checkCode2, reads the preset master chip identity signature certificate, and parses the master chip identity public key PubKey. Verify and update the signature of the unique code message of the main control chip: PubSignVerify(checkCodeHASH2, checkCodeSIGN2, main control chip identity public key PubKey); after verification, use the preset data from the chip to calculate checkCodeHASH2`=SM3(SN / CPUID, CRC(first level BOOT), CRC(second level BOOT), CRC(COS)); compare checkCodeHASH2 and checkCodeHASH2` for consistency; if they are consistent and the signature verification is successful, the main control chip SN / CPUID in the message is updated to the main control chip unique SN / CPUID storage area; the measurement value areas at all levels of the embedded operating system are updated, and the storage structure after update is: SM3(SN / CPUID,PCR(BL1bootloader))+SM3(SN / CPUID,PCR(BL2image))+SM3(SN / CPUID,PCR(BL31 image))+SM3(SN / CPUID,PCR(BL32 image))+SM3(SN / CPUID,PCR(kernel image))+SM3(SN / CPUID,PCR(TEE image))+SM3(SN / CPUID,PCR(recover image))+SM3(SN / CPUID,PCR(BL33))+SM3(SN / CPUID,PCR(uboot partition))+SM3(SN / CPUID,PCR(kernel partition))+SM3(SN / CPUID,PCR(rootfs partition))+SM3(SN / CPUID,PCR(OEM partition)) is 12*32 bytes in total, 12 is the number of trust chain components in the startup phase. The slave chip initialization binding flag is TRUE, providing startup metrics and algorithm capabilities to other modules; if they are inconsistent, the initialization binding process is stopped, and the startup metrics of the target slave chip are not released.

[0061] In order to better understand the initialization binding process between the master chip and the slave chip involved in this embodiment, Figure 4 FIG. 1 is a schematic diagram of a process of initializing and binding a master chip and a slave chip according to Embodiment 1 of the present invention. Figure 4 As shown, it mainly includes:

[0062] Step 410: Send a first message to the slave chip;

[0063] Step 420: parse the first message to obtain a verification random number and a verification algorithm flag; determine a first environment verification code;

[0064] Step 430: Send the first environment verification code to the main control chip;

[0065] Step 440: Calculate and obtain a second environment verification code, and determine whether the second environment verification code is consistent with the first environment verification code;

[0066] Step 441: If they are consistent, send a second message to the slave chip;

[0067] Step 442: If they are inconsistent, stop requesting instructions from the slave chip and issue an alarm;

[0068] Step 450: parse the second message to obtain a first verification code, compare the first verification code with the calculated second verification code, and determine whether the first verification code is consistent with the calculated second verification code;

[0069] Step 451: If they are consistent, the slave chip is verified, and the master chip and the slave chip are successfully initialized and bound;

[0070] Step 452: If they are inconsistent, stop the initialization binding process and do not release the startup metric of the slave chip.

[0071] Step 120: When each slave chip is successfully initialized and bound, the operating system startup measurement of the target embedded device is performed through each slave chip.

[0072] In an optional implementation of this embodiment, if the master chip and the slave chip are successfully initialized and bound, the slave chip can be further used to perform startup measurement of the operating system of the embedded device.

[0073] Optionally, in this embodiment, performing operating system startup measurement of the target embedded device through each of the slave chips may include: when the target slave chip is successfully initialized and bound, receiving the unique code of the master chip, and determining whether the unique code is consistent with the stored reference unique code of the master chip; if they are consistent, starting the operating system startup measurement process; otherwise, stopping the startup measurement of the operating system.

[0074] In an optional implementation of this embodiment, when the target slave chip is successfully initialized and bound, the slave chip can perform a two-way authentication process based on the SM2 certificate with the master chip. During the two-way authentication process, the unique code SN / CPUID of the master chip needs to be sent to the slave chip for verification; the slave chip reads the content of the unique SN / CPUID storage area of ​​the master chip and compares it with the unique code SN / CPUID sent after the two-way authentication to see if they are consistent; if they are consistent, the operating system startup measurement process is started; if they are inconsistent, it is considered that the master chip has changed and the computing environment is unsafe, and the operating system startup and startup measurement process are stopped, waiting for the next power-on, and then the operating system startup measurement is performed again.

[0075] Step 130: If the operating system startup metric verification succeeds, start the operating system.

[0076] In an optional implementation of this embodiment, when the operating system startup measurement verification succeeds, starting the operating system may include: performing a startup measurement trust chain of the operating system based on the target slave chip.

[0077] Optionally, in this embodiment, performing a startup measurement trust chain of the operating system based on the target slave chip may include: extracting a hash value of startup-related measurements of the operating system from a trusted register module through the target slave chip; determining a measurement verification code according to the hash value and a unique code of the master chip; reading each register value; respectively comparing each measurement verification code and each register value, and if the comparison is consistent, starting the operating system; otherwise, stopping starting the operating system and waiting for the next power-on instruction of the target embedded device.

[0078] In an optional implementation of the present embodiment, operating system startup-related metrics of the embedded device are extracted from the chip from the data preset area 230: HASH values: PCR (BL1bootloader), PCR (BL2 image), PCR (BL31 image), PCR (BL32 image), PCR (kernel image), PCR (TEE image), PCR (recoverimage), PCR (BL33), PCR (uboot partition), PCR (kernel partition), PCR (rootfs partition) and PCR (OEM partition).

[0079] Furthermore, the unique code SN / CPUID of the main control chip is added to calculate a new metric check code: SM3`(SN / CPUID, PCR(BL1 bootloader)), SM3`(SN / CPUID, PCR(BL2image)), SM3`(SN / CPUID, PCR(BL31 image)), SM3`(SN / CPUID, PCR(BL32 image)), SM3`(SN / CPUID, PCR(kernelimage)), SM3`(SN / CPUID, PCR(TEE image)), SM3`(SN / CPUID, PCR(recover image)), SM3`(SN / CPUID, PCR(BL33)), SM3`(SN / CPUID, PCR(uboot partition)), SM3`(SN / CPUID, PCR(kernel partition)), SM3`(SN / CPUID, PCR(rootfs partition)), SM3`(SN / CPUID, PCR(OEM partition)).

[0080] Further, the updated PCR values ​​are read from the metric value areas of each level of the chip embedded operating system (data preset area 230): PCR`(BL1 bootloader), PCR`(BL2 image), PCR(BL31 image), PCR`(BL32image), PCR`(kernel image), PCR`(TEE image), PCR`(recover image), PCR`(BL33), PCR`(uboot partition), PCR`(kernel partition), PCR(rootfs partition), PCR`(OEM partition);

[0081] Furthermore, the following measurement values ​​are compared from the chip during the startup process:

[0082] PCR`(BL1 bootloader), SM3`(SN / CPUID, PCR(BL1 bootloader));

[0083] PCR`(BL2 image), SM3`(SN / CPUID, PCR(BL2 image));

[0084] PCR`(BL31 image), SM3`(SN / CPUID, PCR(BL31 image));

[0085] PCR`(BL32 image), SM3`(SN / CPUID, PCR(BL32 image));

[0086] PCR`(kernel image), SM3`(SN / CPUID, PCR(kernel image));

[0087] PCR`(TEE image), SM3`(SN / CPUID, PCR(TEE image));

[0088] PCR`(recover image), SM3`(SN / CPUID, PCR(recover image));

[0089] PCR`(BL33), PCR(uboot partition), SM3`(SN / CPUID, PCR(uboot partition));

[0090] PCR`(kernel partition), SM3`(SN / CPUID, PCR(kernel partition));

[0091] PCR`(rootfs partition), SM3`(SN / CPUID, PCR(rootfs partition));

[0092] PCR`(OEM partition), SM3`(SN / CPUID, PCR(OEM partition));

[0093] If any of the above measurement values ​​are inconsistent, the startup measurement fails and the system startup is stopped. In this embodiment, the measurement logic is run by the trusted root module of the slave chip, the unique code SN / CPUID of the main control chip is added, the key files of the terminal operating system are measured, and the three are bound to enhance the protection of startup security.

[0094] In the scheme of this embodiment, after the embedded device is powered on, the main control chip will verify the credibility of the slave chip: through a supported or predetermined algorithm, the computing environment check code of the slave chip is calculated through a random number, the CRC of each level of BOOT of the slave chip, and the CRC of COS. Only when they are consistent will normal service business interaction be carried out.

[0095] Furthermore, the algorithm service capability is not released before the first initialization of the slave chip. The algorithm capability is released only when the initialization and binding of the solution process are completed; during the first initialization, the unique code SN / CPUID of the master chip is written into the MPU protection zone of the slave chip. Once written, it cannot be modified or exported. At the same time, the PCR of the corresponding terminal operating system's measurement values ​​at all levels is updated, the unique code SN / CPUID of the master chip is added, and the new PCR is calculated.

[0096] Furthermore, when starting measurement, the slave chip first performs two-way authentication with the master chip to verify whether the unique code SN / CPUID of the master chip is consistent with the binding information stored in the MPU. Only after they are consistent, will it respond to the instruction requirements of the master chip and other modules.

[0097] It should be noted that in this embodiment, when the slave chip is started and measured, since the unique code SN / CPUID of the master chip is added during initialization, the PCR value of the startup process file of the same terminal generates new measurement values ​​NewPCR of startup files at each level after the terminals of different master chips are initialized, and NewPCR is measured step by step. Only when the measurement is successfully started can it be started normally.

[0098] The solution of this embodiment uses the method of extending and updating the three-party associated authentication of the master chip, slave chip, and terminal startup process file measurement value PCR. If any component is lost, erroneous, or attacked, it can effectively ensure the trusted expectation of secure startup.

[0099] The three parties are the master chip, the slave chip, and the embedded device startup file. The master chip and the slave chip must be bound for the first time for initialization; the slave chip will perform two-way authentication with the master chip each time; the trusted platform configuration register PCR of the slave chip stores the measurement value of the startup file and the unique SN / CPUID of the master chip; during the startup process, the PCR embedded device measurement value of the slave chip will be compared with the measurement value of the next startup file for consistency.

[0100] The technical solution of this embodiment responds to the power-on instruction of the target embedded device, initializes and binds the master chip with each of the slave chips; when the initialization and binding of each of the slave chips is successful, the operating system startup measurement of the target embedded device is performed by each of the slave chips; when the operating system startup measurement verification is successful, the operating system is started, which solves the problem of the trusted root of the embedded device being attacked during the startup process, enables the embedded device to be safely started, and improves the security of the embedded device.

[0101] Embodiment 2

[0102] Figure 5 1 is a schematic diagram of a structure of a startup device of an embedded device according to a third embodiment of the present invention; the embedded device comprises: a master chip and at least one slave chip, the master chip is in communication connection with each of the slave chips; Figure 5 As shown, the startup device of the embedded device includes: an initialization binding module 510, an operating system startup measurement module 520 and an operating system startup module 530.

[0103] An initialization binding module 510 is used to perform initialization binding with each of the slave chips through the master chip in response to a power-on instruction of the target embedded device;

[0104] An operating system startup measurement module 520 is used to perform operating system startup measurement of the target embedded device through each slave chip when each slave chip is successfully initialized and bound;

[0105] The operating system startup module 530 is used to start the operating system if the operating system startup metric verification succeeds.

[0106] The solution of this embodiment responds to the power-on instruction of the target embedded device through the initialization binding module, and initializes the binding with each slave chip through the master chip; when the initialization binding of each slave chip is successful, the operating system startup measurement of the target embedded device is performed through each slave chip through the operating system startup measurement module; when the operating system startup measurement verification is successful, the operating system is started by the operating system startup module, which solves the problem of the trusted root of the embedded device being attacked during the startup process, can enable the embedded device to be safely started, and improves the security of the embedded device.

[0107] In an optional implementation of this embodiment, the initialization binding module 510 is specifically used to send a first message to the target slave chip through the master chip; the first message includes: a verification random number and a verification algorithm flag;

[0108] The target slave chip parses the first message to obtain the verification random number and the verification algorithm flag;

[0109] Determine a first environment verification code, and send the first environment verification code to the main control chip;

[0110] The main control chip calculates a second environment verification code, and determines whether the second environment verification code is consistent with the first environment verification code;

[0111] If they are consistent, sending a second message to the target slave chip;

[0112] The target slave chip parses the second message to obtain a first verification code, and compares the first verification code with the calculated second verification code to determine whether the first verification code is consistent with the calculated second verification code;

[0113] If they are consistent, the target slave chip is verified, and the master chip and the target slave chip are successfully initialized and bound.

[0114] In an optional implementation of this embodiment, the initialization binding module 510 is further specifically configured to, if the master control chip determines that the second environment verification code is inconsistent with the first environment verification code, the master control chip stops the instruction request to the target slave chip and issues an alarm;

[0115] If the target slave chip determines that the first verification code is inconsistent with the calculated second verification code, the initialization binding process is stopped, and the startup metric of the target slave chip is not released.

[0116] In an optional implementation of this embodiment, the operating system starts the measurement module 520, which is specifically used to receive the unique code of the master chip when the target slave chip is successfully initialized and bound, and determine whether the unique code is consistent with the stored reference unique code of the master chip;

[0117] If they are consistent, then starting the operating system to start the measurement process;

[0118] Otherwise, the startup measurement of the operating system is stopped.

[0119] In an optional implementation of this embodiment, the operating system startup module 530 is used to start the operating system based on the target slave chip to measure the trust chain.

[0120] In an optional implementation of this embodiment, the operating system startup module 530 is specifically configured to extract a hash value of the startup-related metric of the operating system from the trusted register module through the target slave chip;

[0121] Determine a metric check code according to the hash value and the unique code of the main control chip;

[0122] Read the values ​​of each register;

[0123] Comparing the measurement check codes and the register values ​​respectively, and starting the operating system when the comparisons are consistent;

[0124] Otherwise, stop starting the operating system and wait for the next power-on instruction of the target embedded device.

[0125] In an optional implementation of this embodiment, the operating system of the embedded device is an OpenHarmony operating system.

[0126] The startup device of the embedded device provided in the embodiment of the present invention can execute the startup method of the embedded device provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0127] Embodiment 3

[0128] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0129] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0130] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0131] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a startup method of an embedded device.

[0132] In some embodiments, the startup method of the embedded device may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the startup method of the embedded device described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the startup method of the embedded device in any other appropriate manner (e.g., by means of firmware).

[0133] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0134] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0135] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0136] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0137] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0138] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0139] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0140] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for starting an embedded device, characterized in that: The embedded device comprises: a master control chip and at least one slave chip, wherein the master control chip is communicatively connected with each of the slave chips; The startup method of the embedded device comprises: In response to a power-on instruction of the target embedded device, initializing and binding the master control chip with each of the slave chips; When each of the slave chips is successfully initialized and bound, the operating system startup measurement of the target embedded device is performed through each of the slave chips; In case the operating system startup metric verification succeeds, the operating system is started.

2. The method for starting an embedded device according to claim 1, characterized in that: The initialization binding with each of the slave chips through the master chip includes: Sending a first message to the target slave chip through the master control chip; the first message includes: a verification random number and a verification algorithm flag; The target slave chip parses the first message to obtain the verification random number and the verification algorithm flag; Determine a first environment verification code, and send the first environment verification code to the main control chip; The main control chip calculates a second environment verification code, and determines whether the second environment verification code is consistent with the first environment verification code; If they are consistent, sending a second message to the target slave chip; The target slave chip parses the second message to obtain a first verification code, and compares the first verification code with the calculated second verification code to determine whether the first verification code is consistent with the calculated second verification code; If they are consistent, the target slave chip is verified, and the master chip and the target slave chip are successfully initialized and bound.

3. The method for starting an embedded device according to claim 2, characterized in that: The method further comprises: If the master control chip determines that the second environment verification code is inconsistent with the first environment verification code, the master control chip stops requesting instructions from the target slave chip and issues an alarm; If the target slave chip determines that the first verification code is inconsistent with the calculated second verification code, the initialization binding process is stopped, and the startup metric of the target slave chip is not released.

4. The method for starting an embedded device according to claim 1, characterized in that: The step of performing operating system startup measurement of the target embedded device through each of the slave chips includes: In the case that the target slave chip is successfully initialized and bound, receiving the unique code of the master chip, and determining whether the unique code is consistent with the stored reference unique code of the master chip; If they are consistent, then starting the operating system to start the measurement process; Otherwise, the startup measurement of the operating system is stopped.

5. The method for starting an embedded device according to claim 4, characterized in that: In the case where the operating system startup metric verification succeeds, starting the operating system includes: A chain of trust is measured based on booting of the operating system from the target chip.

6. The method for starting an embedded device according to claim 5, characterized in that: The booting measurement trust chain of the operating system based on the target slave chip includes: Extracting a hash value of a boot-related metric of the operating system from a trusted register module via the target slave chip; Determine a metric check code according to the hash value and the unique code of the main control chip; Read the values ​​of each register; Comparing the measurement check codes and the register values ​​respectively, and starting the operating system when the comparisons are consistent; Otherwise, stop starting the operating system and wait for the next power-on instruction of the target embedded device.

7. The method for starting an embedded device according to any one of claims 1 to 6, characterized in that: The operating system of the embedded device is the open source Hongmeng operating system OpenHarmony.

8. A startup device for an embedded device, characterized in that: The embedded device comprises: a master control chip and at least one slave chip, wherein the master control chip is communicatively connected with each of the slave chips; The startup device of the embedded device comprises: An initialization binding module, used for responding to a power-on instruction of a target embedded device and initializing binding with each of the slave chips through the master control chip; An operating system startup measurement module, used to perform operating system startup measurement of the target embedded device through each slave chip when each slave chip is successfully initialized and bound; The operating system startup module is used to start the operating system if the operating system startup metric verification succeeds.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the startup method of the embedded device according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the startup method of an embedded device according to any one of claims 1 to 7 when executed.