Terminal operation method and terminal

By setting up trusted chips and non-volatile flash memory chips in the terminal device, using built-in encryption algorithms for security measurement and establishing a trusted chain, the problem of insufficient security guarantee for encryption and decryption processing in the terminal device is solved, and the terminal of the entire process is realized Trusted control and secure startup.

CN119249378AInactive Publication Date: 2025-01-03BEIJING SMARTCHIP MICROELECTRONICS TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411069925.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2025-01-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art has low security guarantees for encrypting and decryption processing in the service data communication link of terminal devices, making it difficult to effectively prevent attacks and malicious operations.

Method used

By setting up trusted chips, nonvolatile flash memory chips and main control modules in the terminal, using the trusted chip built-in encryption algorithm for security measurement, switching communication channels, establishing trusted chains, and ensuring the secure verification of boot programs and encryption algorithms. In turn, controls the startup and firmware update process of the main control module.

Benefits of technology

It significantly improves the security of all links in terminal control scenarios, prevents illegal operations, ensures trusted control of the entire process of the terminal, avoids malicious programs, and enhances the security of firmware updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119249378A_ABST
    Figure CN119249378A_ABST
Patent Text Reader

Abstract

The invention discloses a terminal operation method and a terminal, and belongs to the technical field of terminals. The operation method of the terminal comprises the following steps: under the condition that a trusted chip controls a first gating chip to switch a communication channel to a first channel, after reading and loading a boot program in a nonvolatile flash memory chip, performing first security measurement based on a first encryption algorithm built in the trusted chip; under the condition that the first security measurement is passed, the trusted chip controls the first gating chip to switch the communication channel to a second channel; and under the condition that the main control module is controlled to be started, the main control module executes an operation corresponding to the target control scene on the boot program in the nonvolatile flash memory chip based on the target control scene. According to the terminal operation method, the security of each link in each terminal control scene is remarkably improved, the trusted chain is established to realize the terminal trusted control in the whole process, and the terminal operation method is applied to various control scenes and has wide application scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of terminal technology, and in particular, relates to a terminal operation method and a terminal. Background Art

[0002] With the development of industrial control, the functions of embedded terminal devices are becoming more and more powerful, and the security confrontation and attacks faced by terminals are also becoming more and more severe. In the related technology, after the terminal is successfully started, each application starts to process the business, and the key data is encrypted and decrypted in the business data communication link to ensure the security of terminal information. The security level of this method is relatively low. Summary of the invention

[0003] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a terminal operation method and a terminal, which significantly improves the security of each link in each terminal control scenario, establishes a trusted chain to realize the terminal trusted control of the whole process, and is applied to a variety of control scenarios, with a wide range of application scenarios.

[0004] In a first aspect, the present application provides an operation method of a terminal, wherein the terminal includes a trusted chip, a first selection chip, a non-volatile flash memory chip, and a main control module; the method includes:

[0005] In the case where the trusted chip controls the first gating chip to switch the communication channel to the first channel, after the boot program in the non-volatile flash memory chip is read and loaded, a first security measurement is performed based on a first encryption algorithm built into the trusted chip; the first channel is used to establish communication between the non-volatile flash memory chip and the trusted chip;

[0006] In the case where the first security metric passes, the trusted chip controls the first gating chip to switch the communication channel to a second channel, where the second channel is used to establish communication between the non-volatile flash memory chip and the main control module;

[0007] When the main control module is controlled to be turned on, the main control module performs operations corresponding to the target control scenario on the boot program in the non-volatile flash memory chip based on the target control scenario; the target control scenario includes at least one of starting the terminal and updating the firmware.

[0008] According to the operation method of the terminal of the present application, a trusted chip is set up, and the boot program is stored in an external serial non-volatile flash memory chip. The trusted chip controls the first selection chip to perform channel switching. When a communication channel is established between the non-volatile flash memory chip and the trusted chip, the trusted chip reads the boot program in the non-volatile flash memory chip and performs a first security measurement. When the measurement passes, the first selection chip is controlled to establish communication between the non-volatile flash memory chip and the main control module so that the main control module can perform operations corresponding to the control scenario on the boot program in the non-volatile flash memory chip in various control scenarios such as terminal startup or firmware update, thereby significantly improving the security of each link in each terminal control scenario, establishing a trusted chain to realize the whole process of terminal trusted control, and being applied to various control scenarios, with a wide range of application scenarios.

[0009] According to an embodiment of the present application, the main control module performs an operation corresponding to the target control scenario on the boot program in the non-volatile flash memory chip based on the target control scenario, including:

[0010] In the case where the target control scenario is the firmware update, the main control module updates the boot program based on the received update program;

[0011] The system kernel and the file system are updated based on the update program, and the first encryption algorithm is updated.

[0012] According to one embodiment of the present application, updating the first encryption algorithm includes:

[0013] The main control module controls the second selection chip to open the third channel; the third channel is used to establish communication between the trusted chip and the main control module;

[0014] Based on the third channel, the first encryption algorithm is updated.

[0015] According to an embodiment of the present application, the main control module performs an operation corresponding to the target control scenario on the boot program in the non-volatile flash memory chip based on the target control scenario, including:

[0016] In the case where the target control scenario is the startup terminal, the main control module loads the boot program;

[0017] The main control module reads the system kernel and the file system in the eMMC memory and performs a second security measurement;

[0018] In the case where the second security measure is passed, the main control module controls the application to start.

[0019] According to an embodiment of the present application, the terminal further includes a first self-locking circuit and a second self-locking circuit; the output end of the first self-locking circuit is connected to a power supply device that supplies power to the main control module, and the output end of the second self-locking circuit is connected to the main control module; the controlling the main control module to start includes:

[0020] When the first safety metric is passed, inputting a first high level signal to the first self-locking circuit and the second self-locking circuit respectively;

[0021] The first self-locking circuit outputs a second high level signal in response to the first high level signal to turn on the power supply device;

[0022] The second self-locking circuit outputs a third high-level signal in response to the first high-level signal to turn off the reset state of the main control module.

[0023] According to an embodiment of the present application, after performing the first security measurement based on the first encryption algorithm built into the trusted chip, the method further includes:

[0024] If the first security metric fails, an alarm message is output.

[0025] In a second aspect, the present application provides a terminal, the terminal comprising:

[0026] Trusted chip;

[0027] A first gating chip, wherein the first gating chip is electrically connected to the trusted chip;

[0028] Non-volatile flash memory chip;

[0029] Main control module;

[0030] The terminal is used to execute the terminal operation method as described in the first aspect.

[0031] According to the operating device of the terminal of the present application, a trusted chip is set up, and the boot program is stored in an external serial non-volatile flash memory chip. The trusted chip controls the first enable chip to perform channel switching. When a communication channel is established between the non-volatile flash memory chip and the trusted chip, the trusted chip reads the boot program in the non-volatile flash memory chip and performs a first security measurement. When the measurement passes, the first enable chip is controlled to establish communication between the non-volatile flash memory chip and the main control module so that the main control module can perform operations corresponding to the control scenario on the boot program in the non-volatile flash memory chip based on various control scenarios such as terminal startup or firmware update, thereby significantly improving the security of each link in each terminal control scenario, establishing a trusted chain to realize the whole process of terminal trusted control, and being applied to various control scenarios, with a wide range of application scenarios.

[0032] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the terminal operation method as described in the first aspect above is implemented.

[0033] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the terminal operation method as described in the first aspect above is implemented.

[0034] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the terminal operation method as described in the first aspect above.

[0035] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:

[0036] By setting a trusted chip and storing the boot program in an external serial non-volatile flash memory chip, the trusted chip controls the first selection chip to switch channels. When a communication channel is established between the non-volatile flash memory chip and the trusted chip, the trusted chip reads the boot program in the non-volatile flash memory chip and performs a first security measurement. When the measurement passes, the first selection chip is controlled to establish communication between the non-volatile flash memory chip and the main control module, so that the main control module can perform operations corresponding to the control scenario on the boot program in the non-volatile flash memory chip in various control scenarios such as terminal startup or firmware update, thereby significantly improving the security of each link in each terminal control scenario, establishing a trusted chain to realize terminal trusted control of the entire process, and being applied to various control scenarios, with a wide range of application scenarios.

[0037] Furthermore, during the terminal startup phase, the boot program is first loaded from the non-volatile flash memory chip, and then the kernel image and file system are loaded from the eMMC. The terminal startup phase is split and processed, and each phase is reinforced separately and measured step by step. Based on the trusted root, a trusted chain is established from the time the terminal starts to achieve full-process secure startup, effectively ensuring the security of each phase in the terminal startup process.

[0038] Furthermore, by setting a first self-locking circuit and a second self-locking circuit to control the opening of the main control module based on the first safety measurement result, dual locking loop control is used to ensure that the main control module is in a completely powered-off state when the measurement fails, thereby further ensuring the safety and effectiveness of the startup.

[0039] Furthermore, in the terminal firmware update process, by establishing a trusted root to measure the legitimacy of the new firmware, illegal terminal upgrade operations can be avoided, thereby improving the security of the firmware update process.

[0040] Furthermore, by outputting an alarm message indicating that the program is illegal when the measurement fails, the terminal enters an alarm state, so that the user is notified to handle it in time, which can effectively prevent the improper operation of malicious programs and further improve the security of terminal control and operation.

[0041] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0043] Figure 1 It is one of the flowcharts of the operation method of the terminal provided in the embodiment of the present application;

[0044] Figure 2 This is the second flowchart of the operation method of the terminal provided in the embodiment of the present application;

[0045] Figure 3 This is a third flowchart of the operation method of the terminal provided in the embodiment of the present application;

[0046] Figure 4 is a structural schematic diagram of a first self-locking circuit provided in an embodiment of the present application;

[0047] Figure 5 is a structural schematic diagram of a second self-locking circuit provided in an embodiment of the present application;

[0048] Figure 6 This is a fourth flowchart of the operation method of the terminal provided in the embodiment of the present application;

[0049] Figure 7 It is a schematic diagram of the signature information of the application provided in the embodiment of the present application;

[0050] Figure 8 This is a fifth flowchart of the operation method of the terminal provided in the embodiment of the present application;

[0051] Fig. 9 It is a structural schematic diagram of an operating device of a terminal provided in an embodiment of the present application;

[0052] Fig.10 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0054] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0055] In conjunction with the accompanying drawings, the operating method of the terminal, the operating device of the terminal, the electronic device and the readable storage medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.

[0056] The terminal operation method may be applied to the terminal, and may be specifically executed by hardware or software in the terminal.

[0057] The operating method of the terminal provided in the embodiment of the present application, the execution subject of the operating method of the terminal may be a functional module or functional entity in the terminal that can implement the operating method of the terminal. The terminals mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras and wearable devices, etc. The operating method of the terminal provided in the embodiment of the present application is explained below by taking the functional module or functional entity in the terminal that can implement the operating method of the terminal as an example of the execution subject.

[0058] like Figure 1 As shown, the operation method of the terminal includes: step 110, step 120 and step 130.

[0059] Step 110: When the trusted chip controls the first selection chip to switch the communication channel to the first channel, after the boot program in the non-volatile flash memory chip is read and loaded, a first security measurement is performed based on a first encryption algorithm built into the trusted chip; the first channel is used to establish communication between the non-volatile flash memory chip and the trusted chip;

[0060] In this step, the terminal may be an embedded acquisition terminal or other terminal.

[0061] The terminal may include: a trusted chip, a first selection chip and a non-volatile flash memory chip.

[0062] The terminal also includes a main control module.

[0063] The main control module may be a central processing unit (CPU) in the terminal.

[0064] The trusted chip is a security chip with a built-in CPU and supports multiple SPI interfaces.

[0065] The first encryption algorithm may include but is not limited to national encryption algorithms such as SM1-SM9 and ZUC.

[0066] In some embodiments, the first encryption algorithm may be the SM3 national encryption algorithm.

[0067] SM3 is a hash algorithm, also known as a digest algorithm, which is suitable for fields such as digital signatures, message authentication, and data integrity detection.

[0068] Among them, the output length of the SM3 algorithm is 256 bits. Compared with the MD5 algorithm, the SM3 algorithm has a longer output length and higher security. In addition, the SM3 algorithm has also taken effective protection measures against the collision tool problem, making the algorithm more secure. The SM3 algorithm also has an avalanche effect. A slight change in the input data can lead to a huge difference in the output result, increasing the difficulty of data cracking, thereby improving the security and reliability of subsequent terminal operations.

[0069] The trusted chip has a built-in initial key, which can be installed when the chip leaves the factory.

[0070] The gate chip is a low on-resistance, multi-channel bidirectional analog fast switching switch chip that supports switching control functions.

[0071] Non-volatile flash memory chip (NorFlash) is a non-volatile flash memory chip that supports the execution of application programs on the chip. The chip is pre-installed with a specific program when it leaves the factory.

[0072] In this application, the bootloader is built into a non-volatile flash memory chip.

[0073] like Figure 2 As shown, the first channel is used to establish communication between the non-volatile flash memory chip and the trusted chip.

[0074] The first security metric is used to perform security verification.

[0075] In some embodiments, performing a first security measurement based on a first encryption algorithm built into the trusted chip may include:

[0076] Decrypting the boot program in the non-volatile flash memory chip based on a first encryption algorithm to obtain a first file;

[0077] The first file is compared with a second file built into the non-volatile flash memory chip.

[0078] In the actual execution process, when the first file obtained by decryption is the same as the second file, it can be considered that the first security measure passes; when the first file is different from the second file, it is considered that the first security measure fails.

[0079] Step 120: When the first security metric passes, the trusted chip controls the first selection chip to switch the communication channel to the second channel, where the second channel is used to establish communication between the non-volatile flash memory chip and the main control module.

[0080] In this step, the main control module may be a central processing unit (CPU) in the terminal.

[0081] Continue to refer Figure 2 ,The second channel is used to establish communication between the non-volatile flash memory chip and the main control module.

[0082] When the first security metric passes, the trusted chip controls the first gating chip to switch the communication channel to the second channel to establish communication between the non-volatile flash memory chip and the main control module, and executes step 130 .

[0083] In some embodiments, if the first security metric fails, the task may be terminated.

[0084] Continue to refer Figure 2 In some embodiments, after performing a first security measurement based on a first encryption algorithm built into the trusted chip, the method may further include:

[0085] If the first security metric fails, an alarm message is output.

[0086] In this embodiment, the warning information is used to prompt that the program is illegal.

[0087] According to the terminal operation method provided in the embodiment of the present application, by outputting an alarm message for prompting that the program is illegal when the measurement fails, the terminal enters an alarm state, which is convenient for notifying the user to take timely action, can effectively prevent the improper operation of malicious programs, and further improve the security of terminal control and operation.

[0088] In some embodiments, the output may be in the form of text output, voice output, image output, or any other achievable output method, which is not limited in this application.

[0089] Step 130: When the main control module is turned on, the main control module performs operations corresponding to the target control scenario on the boot program in the non-volatile flash memory chip based on the target control scenario.

[0090] In this step, the target control scenario includes control scenarios such as starting a terminal or updating firmware.

[0091] It is understandable that for different target control scenarios, the corresponding execution logic may be different.

[0092] In the actual execution process, after the main control module is turned on, information interaction between the main control module and the non-volatile flash memory chip is realized based on the established second channel to achieve the corresponding target control scenario.

[0093] In the present application, a trusted chip is set up to achieve control independent of the main control module, and the first enable chip is controlled by the trusted chip to perform channel switching. When a communication channel is established between the non-volatile flash memory chip and the trusted chip, the trusted chip reads the boot program in the non-volatile flash memory chip and performs a first security measurement, so as to control the first enable chip to perform channel switching based on the first security measurement result. If the measurement fails, the process is terminated, and if the measurement passes, communication is established between the non-volatile flash memory chip and the main control module so that the main control module performs operations corresponding to the target control scenario on the boot program in the non-volatile flash memory chip based on the target control scenario, thereby significantly improving the security of each link in each terminal control scenario, and establishing a trusted chain to achieve terminal trusted control of the entire process.

[0094] In addition, the trustworthiness can be further improved by storing the boot program in an external serial non-volatile flash memory chip for separate verification.

[0095] According to the operation method of the terminal provided in the embodiment of the present application, a trusted chip is set, and the boot program is stored in an external serial non-volatile flash memory chip, and the trusted chip is used to control the first enable chip to perform channel switching. When a communication channel is established between the non-volatile flash memory chip and the trusted chip, the trusted chip reads the boot program in the non-volatile flash memory chip and performs a first security measurement, so that when the measurement passes, the first enable chip is controlled to establish communication between the non-volatile flash memory chip and the main control module so that the main control module can perform operations corresponding to the control scenario on the boot program in the non-volatile flash memory chip based on various control scenarios such as terminal startup or firmware update, thereby significantly improving the security of each link in each terminal control scenario, establishing a trusted chain to realize the whole process of terminal trusted control, and being applied to various control scenarios, with a wide range of application scenarios.

[0096] The implementation of step 130 is described below from two different perspectives.

[0097] 1. Start the terminal

[0098] Continue to refer Figure 2 In some embodiments, the main control module performs operations corresponding to the target control scenario on the boot program in the non-volatile flash memory chip based on the target control scenario, which may include:

[0099] When the target control scenario is to start the terminal, the main control module loads the boot program;

[0100] The main control module reads the system kernel and file system in the eMMC memory and performs a second security measurement;

[0101] When the second security measure is passed, the main control module controls the application to start.

[0102] In this embodiment, continue to refer to Figure 2 , the system kernel and file system are stored in the eMMC memory, and the eMMC memory is communicated with the main control module.

[0103] By storing the boot program in a non-volatile flash memory chip and the system kernel and file system in the eMMC memory, the boot program, kernel, and file system can be stored separately, thereby splitting the startup process to facilitate separate security verification of each link, effectively ensuring the security and reliability of each link in the terminal startup process.

[0104] like Figure 8 As shown, in the actual execution process, after the main control module is powered on, the boot program in the non-volatile flash memory chip is loaded. After the loading is completed, the system kernel and key file system in the eMMC memory are read and the second security measurement is performed.

[0105] When the second security measure is passed, the main control module controls the application to start.

[0106] The second security metric is used in the stage where the main control module starts each business application program.

[0107] Continue to refer Figure 2 In some embodiments, after the main control module reads the system kernel and the file system and performs the second security measurement, the method may further include:

[0108] If the second security metric fails, an alarm message is output.

[0109] In this embodiment, the warning information is used to prompt that the program is illegal.

[0110] According to the terminal operation method provided in the embodiment of the present application, by outputting an alarm message for prompting that the program is illegal when the measurement fails, the terminal enters an alarm state, which is convenient for notifying the user to take timely action, can effectively prevent the improper operation of malicious programs, and further improve the security of terminal control and operation.

[0111] like Figure 6 As shown, in some embodiments, when the second security metric passes, the main control module controls the application to start, which may include:

[0112] Determine the installation status of the application based on the installation file corresponding to the application;

[0113] When the installation status of the application is already installed, a first signature verification is performed on the application;

[0114] If the first signature verification is successful, start the application;

[0115] When the installation status of the application is not installed, performing a second signature verification on the installation file based on a second encryption algorithm;

[0116] If the second signature verification passes, the application is installed based on the installation file, and the first signature verification is performed on the installed application;

[0117] If the first signature verification passes, start the application.

[0118] In this embodiment, the first signature verification is used for APP signature verification.

[0119] The second signature verification is used for installation package signature verification.

[0120] The second encryption algorithm may include but is not limited to national encryption algorithms such as SM1-SM9 and ZUC.

[0121] In some embodiments, the second encryption algorithm may be the SM2 national encryption algorithm.

[0122] Among them, SM2 is an asymmetric key algorithm that uses two independent keys, namely the public key and the private key, to encrypt and decrypt data.

[0123] It is understandable that the application of each service is first signed before installation.

[0124] like Figure 7 As shown, in some embodiments, the signature information may include: program software identification information, program additional information, file size, measurement value, signature value, etc.

[0125] After signing, the application is compressed into a separate installation file and downloaded to the terminal.

[0126] In the actual execution process, when the terminal runs to the second security measurement stage, the installation status of the application is first determined to determine whether the application is installed.

[0127] During actual execution, the installation status of the application may be determined based on the installation identifier.

[0128] If it is detected that the installation is not complete, the SM2 method can be used to perform a second signature verification on the compressed installation file.

[0129] After the second signature verification is passed, the installation process is performed to install the application.

[0130] In the case where the second signature verification fails, it is considered that the second security measure has not been passed, and the installation of the application is stopped.

[0131] When it is detected that the application has been installed, a first signature verification may be performed on the installation file corresponding to the application.

[0132] If the first signature verification passes, the second security measure is considered to have passed, and the application is started.

[0133] If the first signature verification fails, it is considered that the second security measure has not passed, and it is determined that the application startup is abnormal. The terminal will issue an alarm prompt to the application and output an alarm message.

[0134] According to the operation method of the terminal provided in the embodiment of the present application, in the terminal startup link, the boot program is first loaded from the non-volatile flash memory chip, and then the kernel image and file system are loaded from the eMMC. The terminal startup link is split and processed, and each link is reinforced separately and measured step by step. Based on the trusted root, a trusted chain is established from the time the terminal starts to realize the whole process of secure startup, thereby effectively ensuring the security of each link in the terminal startup process.

[0135] 2. Update the firmware

[0136] like Figure 3 As shown, in some embodiments, the main control module performs operations corresponding to the target control scenario on the boot program in the non-volatile flash memory chip based on the target control scenario, which may include:

[0137] In the case where the target control scenario is to update the firmware, the main control module updates the boot program based on the received update program;

[0138] The system kernel and the file system are updated based on the update program, and the first encryption algorithm is updated.

[0139] In this embodiment, the update program is a program for performing firmware update that is received by the terminal through a USB interface.

[0140] When the first security measure passes, the trusted chip controls the first gating chip to switch the communication channel to the second channel to connect NorFlash and the CPU, and the CPU updates the uboot boot program to the NorFlash memory based on the update program.

[0141] In some embodiments, updating the first encryption algorithm may include:

[0142] The main control module controls the second selection chip to open the third channel; the third channel is used to establish communication between the trusted chip and the main control module;

[0143] Based on the third channel, the first encryption algorithm is updated.

[0144] In this embodiment, the second gating chip may be an analog Switch.

[0145] The terminal also includes a second gating chip. When the first security measure passes, the trusted chip controls the gating chip to switch the channel switch through the GPIO pin, connecting the NorFlash and CPU channels, and the CPU updates the uboot boot program to the NorFlash memory.

[0146] In addition, the CPU controls the simulated Switch selection to update the key value of the first encryption algorithm corresponding to the new firmware boot program of the trusted chip, thereby successfully completing the terminal firmware update.

[0147] According to the terminal operation method provided by the embodiment of the present application, in the terminal firmware update link, the legitimacy of the new firmware is measured by establishing a trusted root, which can avoid illegal upgrade operations of the terminal, thereby improving the security of the firmware update link.

[0148] In some embodiments, a dual-locking ring self-locking circuit may be provided to control the opening and closing of the main control module.

[0149] Continue to refer Figure 2 In some embodiments, the terminal may further include a first self-locking circuit and a second self-locking circuit; the output end of the first self-locking circuit is connected to a power supply device for supplying power to the main control module, and the output end of the second self-locking circuit is connected to the main control module; controlling the main control module to start may include:

[0150] When the first safety metric is passed, inputting a first high level signal to the first self-locking circuit and the second self-locking circuit respectively;

[0151] The first self-locking circuit outputs a second high level signal in response to the first high level signal to turn on the power supply device;

[0152] The second self-locking circuit outputs a third high-level signal in response to the first high-level signal to turn off the reset state of the main control module.

[0153] In this embodiment, the power supply device is a power management integrated circuit (Power Management IC, PMIC).

[0154] The first self-locking circuit is used to control the on / off state of the power supply device. When the power supply device is on, the power supply device supplies power to the main control module; when the power supply device is off, the main control module loses power.

[0155] The second self-locking circuit is used to control the reset state of the main control module.

[0156] When the second self-locking circuit outputs a low level, the reset pin (enable pin) of the main control module is pulled low, and the main control module is always in a reset state; when the second self-locking circuit outputs a third high level signal, the reset pin of the main control module is set high, and the main control module is enabled.

[0157] It should be noted that the main control module can only be turned on when the main control module has power and is enabled.

[0158] In the actual execution process, the first self-locking circuit and the second self-locking circuit can be controlled by the high and low level states of the PWRCtr pin of the trusted chip.

[0159] For example, before the first safety metric is passed, the PWRCtr pin is in a low level state, so that the power supply device is in an invalid (disabled) state; and the reset pin of the main control module is pulled low, so that the main control module is in a reset state.

[0160] When the first safety metric is passed, the PWRCtr pin switches to a high level state and outputs a first high level signal, and the input ends of the first self-locking circuit and the second self-locking circuit both receive the first high level signal.

[0161] The first self-locking circuit responds to the first high level signal and outputs a second high level signal to turn on the power supply device, and the active module is powered on.

[0162] The second self-locking circuit outputs a third high-level signal in response to the first high-level signal to control the main control module to be enabled.

[0163] When the main control module is powered on and enabled, the main control module is turned on and enters a normal working state.

[0164] It can be understood that, in this embodiment, when any of the first self-locking circuit and the second self-locking circuit does not output a high level, the main control module cannot be turned on.

[0165] like Figure 4 As shown, in some embodiments, the first self-locking circuit includes: a second transistor Q2 and a third transistor Q3.

[0166] In this embodiment, the second transistor Q2 is a PMOS transistor.

[0167] The source of the second MOS tube is used to access the first voltage VCC1, and the drain of the second MOS tube is connected to the power supply device via the third resistor.

[0168] The gate of the second MOS tube is connected to the first voltage VCC1 via the fourth resistor R4.

[0169] The gate of the second MOS tube is connected to the collector of the third transistor Q3.

[0170] The emitter of the third transistor Q3 is grounded.

[0171] The base of the third transistor Q3 is connected to the PWRCtr pin via the sixth resistor R6 , and the base of the third transistor Q3 is grounded via the fourth capacitor C4 .

[0172] The fifth resistor is connected between an end of the third resistor away from the second MOS tube and the ground.

[0173] In the actual execution process, when the first safety metric is passed, the PWRCtr pin is switched to a high level state, the third transistor Q3 is turned on, the gate of the second MOS tube is pulled down, the second MOS tube is turned on, the pin of the PMIC chip U1 of the power supply device is set high, and the power supply device is turned on to supply power to the main control module.

[0174] like Figure 5 As shown, in some embodiments, the second self-locking circuit includes: a first MOS transistor Q1, a first resistor R1 and a second resistor R2.

[0175] In this embodiment, the first MOS transistor Q1 is an NMOS transistor.

[0176] The source of the first MOS tube Q1 is connected to the PWRCtr pin, the drain of the first MOS tube Q1 is connected to the reset pin (RESET pin) of the main control module, and the drain of the first MOS tube Q1 is connected to the second voltage VCC2 via the second resistor R2.

[0177] The source of the first MOS transistor Q1 is connected to the first voltage VCC1 via the first resistor R1.

[0178] The gate of the first MOS transistor Q1 is connected to the first voltage VCC1.

[0179] In the actual execution process, when the first safety metric is passed, the PWRCtr pin is switched to a high level state, the source level of the first MOS tube Q1 receives the first high level signal, the first MOS tube Q1 is turned on, the second self-locking circuit outputs a third high level signal, the reset pin of the main control module is set high, and the main control module is enabled.

[0180] According to the operation method of the terminal provided in the embodiment of the present application, a first self-locking circuit and a second self-locking circuit are set to control the opening of the main control module based on the first safety measurement result, and a dual locking loop control is used to ensure that the main control module is in a completely power-off state when the measurement fails, thereby preventing the main control module from starting abnormally, and further ensuring the safety and effectiveness of the startup.

[0181] The embodiment of the present application also provides a terminal.

[0182] like Figure 2 As shown, the terminal includes: a trusted chip, a first selection chip, a non-volatile flash memory chip and a main control module.

[0183] Among them, the trusted chip has a built-in first encryption algorithm, which can be installed when the chip leaves the factory.

[0184] The gate chip is a low on-resistance, multi-channel bidirectional analog fast switching switch chip that supports switching control functions.

[0185] The non-volatile flash memory chip supports the execution of application programs on the chip. The chip is pre-loaded with a specific program when it leaves the factory.

[0186] The bootloader is built into the non-volatile flash memory chip.

[0187] The first enable chip is electrically connected to the trusted chip.

[0188] In the actual execution process, the trusted chip can control the first selection chip to switch the channel switch through the GPIO pin to switch between the first channel and the second channel.

[0189] The terminal also includes an eMMC memory.

[0190] The system kernel and the file system are stored in the eMMC memory, and the eMMC memory is communicatively connected with the main control module.

[0191] The terminal operates based on the operating method of the terminal described in any of the above embodiments. The specific implementation method has been described in the above embodiments and will not be repeated in this application.

[0192] According to the terminal provided by the embodiment of the present application, a trusted chip is set up, and the boot program is stored in an external serial non-volatile flash memory chip. The trusted chip controls the first enable chip to perform channel switching. When a communication channel is established between the non-volatile flash memory chip and the trusted chip, the trusted chip reads the boot program in the non-volatile flash memory chip and performs a first security measurement. When the measurement passes, the first enable chip is controlled to establish communication between the non-volatile flash memory chip and the main control module so that the main control module can perform operations corresponding to the control scenario on the boot program in the non-volatile flash memory chip based on various control scenarios such as terminal startup or firmware update, thereby significantly improving the security of each link in each terminal control scenario, establishing a trusted chain to realize the whole process of terminal trusted control, and being applied to various control scenarios, with a wide range of application scenarios.

[0193] Continue to refer Figure 2 In some embodiments, the terminal may further include: a first self-locking circuit and a second self-locking circuit.

[0194] In this embodiment, the input end of the first self-locking circuit is connected to the trusted chip, and the output end of the first self-locking circuit is connected to a power supply device that supplies power to the main control module;

[0195] The input end of the second self-locking circuit is connected to the trusted chip, and the output end of the second self-locking circuit is connected to the main control module.

[0196] The first self-locking circuit is used to control the on / off state of the power supply device. When the power supply device is on, the power supply device supplies power to the main control module; when the power supply device is off, the main control module loses power.

[0197] The second self-locking circuit is used to control the reset state of the main control module.

[0198] When the second self-locking circuit outputs a low level, the reset pin (enable pin) of the main control module is pulled low, and the main control module is always in a reset state; when the second self-locking circuit outputs a third high level signal, the reset pin of the main control module is set high, and the main control module is enabled.

[0199] It should be noted that the main control module can only be turned on when the main control module has power and is enabled.

[0200] like Figure 4 As shown, in some embodiments, the first self-locking circuit may include: a second transistor Q2 and a third transistor Q3.

[0201] In this embodiment, the source of the second MOS tube is used to access the first voltage VCC1, the gate of the second MOS tube is connected to the first voltage VCC1 via the fourth resistor R4, and the drain of the second MOS tube is connected to the power supply device via the third resistor.

[0202] The gate of the second MOS tube is connected to the collector of the third transistor Q3, the emitter of the third transistor Q3 is grounded, the base of the third transistor Q3 is connected to the trusted chip via the sixth resistor R6, and the base of the third transistor Q3 is grounded via the fourth capacitor C4.

[0203] In the actual execution process, when the first safety metric is passed, the PWRCtr pin switches to a high level state, the third transistor Q3 is turned on, the gate of the second MOS tube is pulled down, the second MOS tube is turned on, and the power supply device is turned on to supply power to the main control module.

[0204] According to the terminal provided in the embodiment of the present application, a first self-locking circuit is set to control the power supply device to prevent power supply to the core of the main control module before the first safety metric is passed, so that the main control module remains in a completely power-off state, and the power supply device is controlled to turn on to power the main control module only after the first safety metric is passed.

[0205] like Figure 5 As shown, in some embodiments, the second self-locking circuit may include: a first MOS transistor Q1, a first resistor R1 and a second resistor R2.

[0206] In this embodiment, the source of the first MOS transistor Q1 is connected to the trusted chip, the drain of the first MOS transistor Q1 is connected to the main control module, and the gate of the first MOS transistor Q1 is connected to the first voltage VCC1.

[0207] The source of the first MOS transistor Q1 is connected to the first voltage VCC1 via the first resistor R1.

[0208] The drain of the first MOS transistor Q1 is connected to the second voltage VCC2 via the second resistor R2.

[0209] In the actual execution process, when the first safety metric is passed, the PWRCtr pin is switched to a high level state, the source level of the first MOS tube Q1 receives the first high level signal, the first MOS tube Q1 is turned on, the second self-locking circuit outputs a third high level signal, the reset pin of the main control module is set high, and the main control module is enabled.

[0210] According to the terminal provided in the embodiment of the present application, the reset state of the main control module is controlled by setting a second self-locking circuit, so that the main control module is maintained in the reset state before the first safety metric is passed, so as to prevent the main control module from starting abnormally.

[0211] like Figure 3 As shown, in some embodiments, the terminal may further include a second gating chip.

[0212] In this embodiment, the second gating chip may be an analog Switch.

[0213] When the first security measure passes, the trusted chip controls the strobe chip switching channel switch through the GPIO pin to connect the NorFlash and CPU channels, and the CPU updates the uboot boot program to the NorFlash memory.

[0214] In addition, the CPU controls the simulated Switch selection to update the key value of the first encryption algorithm corresponding to the new firmware boot program of the trusted chip, thereby successfully completing the terminal firmware update.

[0215] According to the terminal provided in the embodiment of the present application, during the terminal firmware update phase, the legitimacy of the new firmware is measured by establishing a trusted root, which can avoid illegal upgrade operations of the terminal, thereby improving the security of the firmware update phase.

[0216] The terminal operation method provided in the embodiment of the present application can be executed by the terminal operation device. In the embodiment of the present application, the terminal operation device provided in the embodiment of the present application is described by taking the terminal operation method executed by the terminal operation device as an example.

[0217] The embodiment of the present application also provides an operating device of a terminal.

[0218] like Fig. 9 As shown, the terminal includes a trusted chip, a first selection chip, a non-volatile flash memory chip and a main control module, and the operating device of the terminal includes: a first processing module 910, a second processing module 920 and a third processing module 930.

[0219] The first processing module 910 is used to perform a first security measurement based on a first encryption algorithm built into the trusted chip after reading and loading the boot program in the non-volatile flash memory chip, in the case where the trusted chip controls the first selection chip to switch the communication channel to the first channel; the first channel is used to establish communication between the non-volatile flash memory chip and the trusted chip;

[0220] A second processing module 920 is used to enable the trusted chip to control the first gating chip to switch the communication channel to the second channel when the first security metric passes, and the second channel is used to establish communication between the non-volatile flash memory chip and the main control module;

[0221] The third processing module 930 is used to control the main control module to start up, so that the main control module performs operations corresponding to the target control scenario on the boot program in the non-volatile flash memory chip based on the target control scenario; the target control scenario includes at least one of starting the terminal and updating the firmware.

[0222] According to the operating device of the terminal provided in the embodiment of the present application, a trusted chip is set, and the boot program is stored in an external serial non-volatile flash memory chip. The trusted chip controls the first enable chip to perform channel switching. When a communication channel is established between the non-volatile flash memory chip and the trusted chip, the trusted chip reads the boot program in the non-volatile flash memory chip and performs a first security measurement. When the measurement passes, the first enable chip is controlled to establish communication between the non-volatile flash memory chip and the main control module so that the main control module can perform operations corresponding to the control scenario on the boot program in the non-volatile flash memory chip based on various control scenarios such as terminal startup or firmware update. The security of each link in each terminal control scenario is significantly improved, a trusted chain is established to realize the whole process of terminal trusted control, and it is applied to various control scenarios, with a wide range of application scenarios.

[0223] In some embodiments, the third processing module 930 may also be used to:

[0224] When the target control scenario is to update the firmware, the main control module updates the boot program based on the received update program;

[0225] The system kernel and the file system are updated based on the update program, and the first encryption algorithm is updated.

[0226] In some embodiments, the third processing module 930 may also be used to:

[0227] The main control module controls the second selection chip to open the third channel; the third channel is used to establish communication between the trusted chip and the main control module;

[0228] Based on the third channel, the first encryption algorithm is updated.

[0229] In some embodiments, the third processing module 930 may also be used to:

[0230] When the target control scenario is to start the terminal, the main control module is made to load the boot program;

[0231] The main control module reads the system kernel and file system in the eMMC memory and performs a second security measurement;

[0232] When the second security measure is passed, the main control module controls the application to start.

[0233] In some embodiments, the terminal further includes a first self-locking circuit and a second self-locking circuit; the output end of the first self-locking circuit is connected to a power supply device that supplies power to the main control module, and the output end of the second self-locking circuit is connected to the main control module; the device may also include a fourth processing module for:

[0234] When the first safety metric is passed, inputting a first high level signal to the first self-locking circuit and the second self-locking circuit respectively;

[0235] The first self-locking circuit is caused to output a second high-level signal in response to the first high-level signal to turn on the power supply device;

[0236] The second self-locking circuit is made to output a third high-level signal in response to the first high-level signal to turn off the reset state of the main control module.

[0237] In some embodiments, the apparatus may further include a fifth processing module, configured to:

[0238] After performing a first security measurement based on a first encryption algorithm built into the trusted chip, if the first security measurement fails, an alarm message is output.

[0239] In some embodiments, Fig.10 As shown, an embodiment of the present application also provides an electronic device 1000, including a processor 1001, a memory 1002, and a computer program stored in the memory 1002 and executable on the processor 1001. When the program is executed by the processor 1001, the various processes of the above-mentioned terminal operation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0240] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0241] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned terminal operation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0242] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0243] An embodiment of the present application also provides a computer program product, including a computer program, which implements the operation method of the above terminal when executed by a processor.

[0244] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0245] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned terminal operation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0246] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0247] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0248] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0249] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0250] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0251] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A terminal operation method, characterized in that: The terminal includes a trusted chip, a first selection chip, a non-volatile flash memory chip and a main control module; the method includes: In the case where the trusted chip controls the first gating chip to switch the communication channel to the first channel, after the boot program in the non-volatile flash memory chip is read and loaded, a first security measurement is performed based on a first encryption algorithm built into the trusted chip; the first channel is used to establish communication between the non-volatile flash memory chip and the trusted chip; In the case where the first security metric passes, the trusted chip controls the first gating chip to switch the communication channel to a second channel, where the second channel is used to establish communication between the non-volatile flash memory chip and the main control module; When the main control module is controlled to be turned on, the main control module performs operations corresponding to the target control scenario on the boot program in the non-volatile flash memory chip based on the target control scenario; the target control scenario includes at least one of starting the terminal and updating the firmware.

2. The terminal operation method according to claim 1, characterized in that: The main control module performs an operation corresponding to the target control scenario on the boot program in the non-volatile flash memory chip based on the target control scenario, including: In the case where the target control scenario is the firmware update, the main control module updates the boot program based on the received update program; The system kernel and the file system in the eMMC memory are updated based on the update program, and the first encryption algorithm is updated.

3. The terminal operation method according to claim 2, characterized in that: The updating of the first encryption algorithm comprises: The main control module controls the second selection chip to open the third channel; the third channel is used to establish communication between the trusted chip and the main control module; Based on the third channel, the first encryption algorithm is updated.

4. The terminal operation method according to any one of claims 1 to 3, characterized in that: The main control module performs an operation corresponding to the target control scenario on the boot program in the non-volatile flash memory chip based on the target control scenario, including: In the case where the target control scenario is the startup terminal, the main control module loads the boot program; The main control module reads the system kernel and the file system in the eMMC memory and performs a second security measurement; In the case where the second security measure is passed, the main control module controls the application to start.

5. The terminal operation method according to any one of claims 1 to 3, characterized in that: The terminal further includes a first self-locking circuit and a second self-locking circuit; the output end of the first self-locking circuit is connected to a power supply device that supplies power to the main control module, and the output end of the second self-locking circuit is connected to the main control module; The controlling the main control module to start up includes: When the first safety metric is passed, inputting a first high level signal to the first self-locking circuit and the second self-locking circuit respectively; The first self-locking circuit outputs a second high level signal in response to the first high level signal to turn on the power supply device; The second self-locking circuit outputs a third high-level signal in response to the first high-level signal to turn off the reset state of the main control module.

6. The terminal operation method according to any one of claims 1 to 3, characterized in that: After performing the first security measurement based on the first encryption algorithm built into the trusted chip, the method further includes: If the first security metric fails, an alarm message is output.

7. A terminal, characterized in that: include: Trusted chip; A first gating chip, wherein the first gating chip is electrically connected to the trusted chip; Non-volatile flash memory chip; Main control module; The terminal operates based on the terminal operation method according to any one of claims 1 to 6.

8. The terminal according to claim 7, characterized in that: Also includes: a first self-locking circuit, wherein an input end of the first self-locking circuit is connected to the trusted chip, and an output end of the first self-locking circuit is connected to a power supply device for supplying power to the main control module; A second self-locking circuit, wherein an input end of the second self-locking circuit is connected to the trusted chip, and an output end of the second self-locking circuit is connected to the main control module.

9. The terminal according to claim 8, characterized in that: The second self-locking circuit comprises: a first MOS transistor, wherein a source of the first MOS transistor is connected to the trusted chip, a drain of the first MOS transistor is connected to the main control module, and a gate of the first MOS transistor is connected to a first voltage; A first resistor, wherein the source of the first MOS tube is connected to the first voltage via the first resistor; A second resistor, the drain of the first MOS tube is connected to a second voltage via the second resistor.

10. The terminal according to claim 8, characterized in that: The first self-locking circuit comprises: a second MOS transistor, wherein a source of the second MOS transistor is used to access a first voltage, a gate of the second MOS transistor is connected to the first voltage via a fourth resistor, and a drain of the second MOS transistor is connected to the power supply device via a third resistor; A third triode, the gate of the second MOS tube is connected to the collector of the third triode, the emitter of the third triode is grounded, the base of the third triode is connected to the trusted chip via a sixth resistor, and the base of the third triode is grounded via a fourth capacitor.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the operating method of the terminal according to any one of claims 1 to 6 is implemented.

12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the terminal operation method according to any one of claims 1 to 6 is implemented.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the operating method of the terminal as claimed in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • File protection method based on credible chip

    CN106709375A

  • Security measurement method and security measurement device for server system startup, and server

    CN111950014A

  • Security chip of terminal equipment, trusted configuration method of security chip and terminal equipment

    CN115495798A

  • Embedded master control chip trusted loading method and system

    CN117034322A