Terminal mode switching method, device and equipment
By introducing security elements SE and GPIO pin status detection in the terminal device, combined with the verification of identity authentication instructions, the problem of low security in mode switching in the prior art is solved, and higher reliability and security of mode switching are achieved.
Patent Information
- Application Number
- CN202411799225.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-18
AI Technical Summary
Existing terminal devices rely on account passwords for security authentication during mode switching, resulting in a low security protection level, which is prone to leakage of user data due to account password leakage or malicious attacks.
By introducing a security element SE into the terminal device, the first level signal is triggered in response to the mode switching operation, the GPIO pin state is detected, and the identity authentication command is sent to the SE for verification in the activated state, and the mode switching is performed only after the verification is passed.
Improve the trustworthiness and security of mode switching, prevent forced switching of modes due to other attack methods, and ensure that terminal devices have undergone trustworthy identity authentication before mode switching.
Smart Images

Figure CN119653011A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a mode switching method, device and equipment of a terminal. Background Art
[0002] At present, some terminals on the market support mode switching. After the user clicks a button on the terminal OS (Operating System) interface and enters the account password for verification, the mode switch is completed and enters another mode. The above-mentioned switchable modes include: privacy mode, child mode, safety mode, laboratory mode, etc.
[0003] The terminal sets up multiple modes with the aim of providing users with more secure private space to store more private data. The security authentication of the above mode switching relies more on the account and password entered by the user, and the security protection level is relatively low. When the user account and password are leaked or attacked maliciously, it is easy to complete the mode switching, causing user data leakage.
[0004] With the rapid iteration of consumer electronics business demands, people's cognitive level is gradually improving, and they are paying more and more attention to personal privacy and information security. The terminal carriers that carry personal privacy information are becoming more and more important. There is an urgent need for a more reliable and secure way to protect user data in the terminal and the switching of different terminal modes. Summary of the invention
[0005] In order to solve the above technical problems, the present disclosure provides a mode switching method, device and equipment of a terminal.
[0006] According to one aspect of the present disclosure, a mode switching method of a terminal is provided, the method being applied to a terminal device, the method comprising:
[0007] In response to the mode switching operation, determine the target mode to be switched, and trigger the security element SE to generate a first level signal, so that the SE feeds back the state of the general purpose input and output port GPIO pin according to the first level signal;
[0008] When it is detected that the GPIO pin state meets the activation state, an identity authentication instruction is sent to the SE, so that the SE verifies the signature of the identity authentication instruction and feeds back the verification result;
[0009] When the signature verification result is passed, the current mode is switched to the target mode.
[0010] According to another aspect of the present disclosure, a mode switching method of a terminal is also provided, the method being applied to a secure element SE, the method comprising:
[0011] Generate a first level signal; wherein the first level signal is triggered by the terminal device in response to a mode switching operation;
[0012] Feedback the general purpose input / output port GPIO pin state to the terminal device according to the first level signal;
[0013] Receiving an identity authentication instruction sent by the terminal device; wherein the identity authentication instruction is sent by the terminal device when detecting that the state of the GPIO pin meets the activation state;
[0014] The identity authentication instruction is signature verified, and the signature verification result is fed back to the terminal device, so that the terminal device switches from the current mode to the target mode when the signature verification result is passed.
[0015] According to another aspect of the present disclosure, a mode switching device of a terminal is also provided, the device is applied to a terminal device, and the device includes:
[0016] An operation response module, configured to determine a target mode to be switched in response to a mode switching operation, and trigger the security element SE to generate a first level signal, so that the SE can feedback a general purpose input and output port GPIO pin state according to the first level signal;
[0017] An instruction sending module, configured to send an identity authentication instruction to the SE when detecting that the GPIO pin state meets the activation state, so that the SE verifies the identity authentication instruction and feeds back the verification result;
[0018] The mode switching module is used to switch from the current mode to the target mode when the signature verification result is passed.
[0019] According to another aspect of the present disclosure, a mode switching device of a terminal is also provided, the device is applied to a security element SE, and the device includes:
[0020] A signal generating module, configured to generate a first level signal; wherein the first level signal is generated by the terminal device in response to a mode switching operation.
[0021] A state feedback module, used for feeding back the state of a general purpose input / output port GPIO pin to the terminal device according to the first level signal;
[0022] An instruction receiving module, used for receiving an identity authentication instruction sent by the terminal device; wherein the identity authentication instruction is sent by the terminal device when detecting that the state of the GPIO pin meets the activation state;
[0023] The signature verification module is used to verify the signature of the identity authentication instruction and feed back the verification result to the terminal device, so that the terminal device switches from the current mode to the target mode when the verification result is passed.
[0024] According to another aspect of the present disclosure, an electronic device is provided, the electronic device comprising:
[0025] processor;
[0026] a memory for storing instructions executable by the processor;
[0027] The processor is used to read the executable instructions from the memory and execute the instructions to implement the above method.
[0028] According to another aspect of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute the above method.
[0029] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0030] The technical solution provided by the embodiment of the present disclosure includes: first, the terminal device responds to the mode switching operation, determines the target mode to be switched, and triggers SE to generate a first level signal, so that SE can feedback the GPIO pin state according to the first level signal; then, when the GPIO pin state is detected to be in the activated state, an identity authentication instruction is sent to SE, so that SE verifies the identity authentication instruction and feedbacks the verification result; finally, when the verification result is passed, the current mode is switched to the target mode. In the technical solution, when responding to the mode switching operation, SE is triggered to generate a first level signal and the GPIO pin state is fed back based on this, and the terminal device detects whether the GPIO pin state is in the activated state. This process can use the physical GPIO pin state to detect whether the mode switching operation has actually occurred, thereby improving the credibility of the mode switching; the identity authentication instruction is verified by SE, and the current mode is switched to the target mode after the verification is passed, so that the terminal device can be ensured to have undergone a reliable identity authentication before the mode switching, thereby improving the security of the mode switching. Therefore, in the mode switching process, the present invention adds security control technical means such as physical GPIO pin status detection and SE signature verification of identity authentication instructions to ensure that mode switching is performed after secure and reliable authentication, effectively preventing forced mode switching due to other attack methods, and improving the credibility and security of mode switching. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0033] Figure 1 This is a flowchart of a mode switching method for a terminal applied to a terminal device according to an embodiment of the present disclosure;
[0034] Figure 2 A schematic diagram of generating a high level according to an embodiment of the present disclosure;
[0035] Figure 3 This is an interactive schematic diagram of mode switching according to an embodiment of the present disclosure;
[0036] Figure 4 This is a flowchart of a mode switching method for a terminal applied to a SE according to an embodiment of the present disclosure;
[0037] Figure 5 A schematic diagram of the structure of a mode switching device for a terminal applied to a terminal device according to an embodiment of the present disclosure;
[0038] Figure 6 It is a structural schematic diagram of a mode switching device for a terminal applied to a SE according to an embodiment of the present disclosure;
[0039] Figure 7 It is a schematic diagram of the structure of the electronic device described in the embodiment of the present disclosure. DETAILED DESCRIPTION
[0040] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0041] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0042] In view of the problem of low security protection level in the existing mode switching method based on account and password, the embodiments of the present disclosure provide a mode switching method, device, equipment and medium for a terminal. The scheme ensures that the terminal device has undergone a trusted authentication before switching modes through security control technical means such as GPIO (General-purpose input / output) pin status detection and SE (Secure Element) signature verification of identity authentication instructions, thereby preventing forced mode switching due to other attack methods, thereby completing the mode switching of the terminal device in a more reliable and secure manner.
[0043] Figure 1 The present invention provides a flowchart of a mode switching method of a terminal provided in an embodiment of the present invention. The method can be applied to products such as THN31S, THN31P, and T9-Mobile-SE. The mode switching method of the terminal can be executed by a mode switching device of the terminal configured in the terminal device; the above-mentioned device can be implemented by software and / or hardware. The above-mentioned terminal device is any device that is set with different modes and can switch between different modes, such as a smart phone, a computer, a smart watch, etc.
[0044] like Figure 1 As shown, the embodiment of the present disclosure provides a mode switching method of a terminal, which is applied to a terminal device. In one implementation, a device class SE (Secure Element) is provided on the terminal device; an authentication program for identity authentication can be installed on the SE, and the authentication program is specifically, for example, a javacard applet. Applied to the above-mentioned terminal device OS, the mode switching method of the terminal provided in this embodiment may include the following steps.
[0045] S102, in response to the mode switching operation, determining a target mode to be switched, and triggering the SE to generate a first level signal, so that the SE feeds back a GPIO pin state according to the first level signal.
[0046] In this embodiment, the terminal device may be provided with a plurality of modes such as a normal mode, a privacy mode, a children's mode, a safety mode, and a laboratory mode, and may switch between the above modes in order to adapt to different users and different usage scenarios. In the case where the user needs to switch modes, the terminal device may receive a mode switching operation initiated by the user. The mode switching operation may be, for example: when the user presses a physical button on the terminal device, the mode switching operation is triggered; or, when the user operates a control on the interface of the terminal device by clicking, long pressing, etc., the mode switching operation is triggered; or, when the user opens the software installed on the terminal device, the mode switching operation is triggered, and so on. The above physical buttons, controls, or software can be used to implement the mode switching function.
[0047] After receiving the mode switching operation, the terminal device may respond to the mode switching operation, determine the target mode to be switched, and trigger the SE to generate a first level signal.
[0048] Among them, Figure 2 As shown, triggering SE to generate a first level signal specifically includes: triggering the first GPIO pin on the hardware circuit of SE to be pulled up according to the mode switching operation to generate a first level signal that lasts for a preset duration; the first level signal can be a low level signal or a high level signal.
[0049] In one embodiment, a GPIO on the SE hardware circuit is triggered to pull up or down by responding to the mode switching operation, thereby generating a high level or low level that lasts for N milliseconds. This current signal is sensed by the OS on the SE and marks the GPIO pin as "Active" at the software level. Specifically, in this embodiment, the first GPIO pin (e.g., S-GPIO1 pin) on the SE hardware circuit can be triggered to pull up by responding to the mode switching operation, generating a first level signal that lasts for a preset duration (e.g., 50ms).
[0050] Then, SE feeds back the GPIO pin status according to the first level signal. Specifically, after SE captures the first level signal of the S-GPIO1 pin, it records that the current GPIO (specifically S-GPIO1) pin status is activated, and the activation status can be expressed as Active, indicating that the mode switching process of the terminal device is activated. And, SE feeds back the recorded GPIO pin status to the terminal device.
[0051] S104, when it is detected that the GPIO pin state meets the activation state, sending an identity authentication instruction to the SE, so that the SE verifies the signature of the identity authentication instruction and feeds back the verification result.
[0052] According to the above embodiment, the terminal device OS can receive the GPIO pin status fed back by the SE through the interface provided by the SE OS, and detect whether the GPIO pin status meets the expected activation state Active.
[0053] When the GPIO pin status is detected to be in the activated state, the terminal device OS sends an authentication instruction to the authentication program (such as Javacard applet) pre-installed on the SE, and waits for the authentication program to verify the authentication instruction and then feedback the verification result. The above authentication instruction is specifically, for example, an APDU (Application Protocol data unit) instruction representing authentication.
[0054] In one embodiment, the terminal device sending the identity authentication instruction to the SE may specifically include:
[0055] Generate a string randomly; use the private key in the preset public-private key pair to sign the string to obtain a signature value; use the signature value as the data field of the identity authentication instruction, and send the identity authentication instruction to the authentication program preset in the SE; wherein the authentication program is used to verify the signature of the identity authentication instruction.
[0056] Specifically, a pair of public and private key pairs are generated in advance in the terminal device OS according to the encryption algorithm; for example, an ECC (Elliptic Curve Cryptography) encryption algorithm is used to generate a pair of public and private key pairs with a public key of PK.DEV and a private key of SK.DEV. The above private key is stored in the device terminal and used to generate identity authentication instructions; the above public key can be written into the SE authentication program through the APDU instruction and used to verify the signature of the identity authentication instruction.
[0057] In this embodiment, the terminal device OS can randomly generate a 32-byte hexadecimal string R1; sign the string R1 according to a preset signature algorithm such as ECKA and use the private key SK.DEV in the above public-private key pair to obtain a signature value S1; use the signature value S1 as the data field of the identity authentication instruction, and send the identity authentication instruction to the authentication program preset in the SE.
[0058] In addition, in some embodiments, if the GPIO pin state does not conform to the activation state, such as the non-activation state (expressed as Non-Actived), the authentication program in the SE can reject the authentication instruction sent by the terminal device OS and return an error status word to the terminal device.
[0059] After the terminal device sends the identity authentication instruction to the SE, the SE can verify the signature of the identity authentication instruction and feedback the verification result, refer to the following embodiment content.
[0060] The authentication program in the SE uses the public key in the preset public-private key pair to verify the signature of the data field in the identity authentication instruction; if the signature verification is successful, the SE interface is called through the preset authentication program to generate a second level signal; the second level signal is fed back to the terminal device as the signature verification result. If the signature verification fails, a signal indicating that the signature verification fails can be returned to the terminal device.
[0061] In specific implementation, after receiving the identity authentication instruction, the authentication program in the SE uses the public key PK.DEV in the public-private key pair to calculate the data field (i.e., the signature value S1) in the identity authentication instruction to obtain a check value; if the check value is the string R1, it is determined that the signature verification is successful. If the signature verification is successful, the authentication program calls the SE interface to generate a second level signal on the first GPIO pin (e.g., the S-GPIO2 pin) for a preset duration (e.g., 50ms); the second level signal can be a low level signal or a high level signal.
[0062] S106: If the signature verification result is passed, switch from the current mode to the target mode.
[0063] On the basis of the above embodiment, the SE verifies the identity authentication instruction and feeds back the verification result, which may be a second level signal indicating that the verification is successful. If the terminal device receives the second level signal fed back by the SE after the verification of the identity authentication instruction, it determines that the verification of the identity authentication instruction is successful. Then, the terminal device OS switches from the current mode to the target mode, for example, from the current normal mode to the child mode.
[0064] In one embodiment, the mode switching method of the terminal may further include: sending a status clearing instruction to the SE, so that the SE sets the GPIO pin status of the terminal device to an inactive state according to the status clearing instruction.
[0065] Among them, the status clearing instruction can be an APDU instruction indicating clearing the GPIO pin status or switching the GPIO pin status; the status clearing instruction is used to clear the activated status Active of the GPIO pin after the terminal device completes the mode switching, that is, to switch the GPIO pin status to the non-activated state Non-Actived.
[0066] Based on this, the terminal device OS sends a status clearing instruction to the SE authentication program, and clears the activation status Active of the GPIO pin through the SE authentication program, that is, switches the GPIO pin status to the non-activated state Non-Actived, thereby determining the end of the current mode switching process.
[0067] like Figure 3 As shown, this embodiment provides another mode switching method of a terminal based on a terminal device and an SE, which may include the following steps.
[0068] (1) The terminal device determines the target mode to be switched in response to the mode switching operation, and triggers the SE to generate a first level signal.
[0069] (2) The SE feeds back the GPIO pin status to the terminal device according to the first level signal.
[0070] (3) The terminal device detects whether the GPIO pin state meets the activation state.
[0071] (4) If the conditions are met, a character string is randomly generated; the character string is signed using the private key in the preset public-private key pair to obtain a signature value; the signature value is used as the data field of the identity authentication instruction, and the identity authentication instruction is sent to the authentication program preset in the SE.
[0072] (5) SE receives the identity authentication instruction and uses the public key in the preset public-private key pair to verify the signature of the data field in the identity authentication instruction.
[0073] (6) If the signature verification is successful, the SE interface is called through a preset authentication program to generate a second level signal; the second level signal is fed back to the terminal device as the signature verification result.
[0074] (7) The terminal device receives the signature verification result; if the signature verification result is a second level signal, it is determined that the identity authentication instruction signature verification is successful. In this case, the current mode is switched to the target mode.
[0075] In summary, the mode switching method of the terminal provided in the above embodiment includes: first, the terminal device responds to the mode switching operation, determines the target mode to be switched, and triggers SE to generate a first level signal, so that SE can feedback the GPIO pin state according to the first level signal; then, when the GPIO pin state is detected to be in the activated state, an identity authentication instruction is sent to SE, so that SE verifies the identity authentication instruction and feeds back the verification result; finally, when the verification result is passed, the current mode is switched to the target mode. In the present technical scheme, when responding to the mode switching operation, SE is triggered to generate a first level signal and the GPIO pin state is fed back based on it, and the terminal device detects whether the GPIO pin state is in the activated state. This process can use the physical GPIO pin state to detect whether the mode switching operation has actually occurred, thereby improving the credibility of the mode switching; the identity authentication instruction is verified by SE, and the current mode is switched to the target mode after the verification is passed, so that the terminal device can be ensured to have undergone a reliable identity authentication before the mode switching, thereby improving the security of the mode switching. Therefore, in the mode switching process, the present invention adds security control technical means such as physical GPIO pin status detection and SE signature verification of identity authentication instructions to ensure that mode switching is performed after secure and reliable authentication, effectively preventing forced mode switching due to other attack methods, and improving the credibility and security of mode switching.
[0076] Figure 4The present invention provides a flowchart of a method for switching a mode of a terminal. The method can be executed by a mode switching device of a terminal configured in an SE. The device can be implemented by software and / or hardware. Figure 4 As shown, the mode switching method applied to the terminal of SE may include the following steps.
[0077] S202, generating a first level signal; wherein the first level signal is triggered by the terminal device in response to a mode switching operation;
[0078] S204, feeding back the general purpose input / output port GPIO pin state to the terminal device according to the first level signal;
[0079] S206, receiving an identity authentication instruction sent by the terminal device; wherein the identity authentication instruction is sent by the terminal device when detecting that the GPIO pin state meets the activation state;
[0080] S208, verifying the signature of the identity authentication instruction, and feeding back the verification result to the terminal device, so that the terminal device switches from the current mode to the target mode when the verification result is passed.
[0081] In one embodiment, in the above step S208, verifying the identity authentication instruction and feeding back the verification result to the terminal device may include:
[0082] Use the public key in the preset public-private key pair to verify the signature of the data field in the identity authentication instruction; if the signature verification passes, call the SE interface through the preset authentication program to generate a second level signal; and feed back the second level signal to the terminal device as the signature verification result.
[0083] Figure 5 This is a schematic diagram of the structure of a mode switching device for a terminal provided in an embodiment of the present disclosure, and the device is applied to a terminal device and can be used to implement a mode switching method for a terminal. The mode switching device for a terminal applied to a terminal device may include the following modules.
[0084] An operation response module 310, for determining a target mode to be switched in response to a mode switching operation, and triggering the security element SE to generate a first level signal, so that the SE feeds back a general purpose input and output port GPIO pin state according to the first level signal;
[0085] The instruction sending module 320 is used to send an identity authentication instruction to the SE when detecting that the GPIO pin state meets the activation state, so that the SE verifies the identity authentication instruction and feeds back the verification result;
[0086] The mode switching module 330 is configured to switch from the current mode to the target mode when the signature verification result is passed.
[0087] Figure 6 This is a schematic diagram of the structure of a mode switching device for a terminal provided in an embodiment of the present disclosure, and the device is applied to a SE and can be used to implement a mode switching method for a terminal. The mode switching device for a terminal applied to a SE may include the following modules.
[0088] The signal generating module 410 is used to generate a first level signal; wherein the first level signal is triggered by the terminal device in response to a mode switching operation;
[0089] A state feedback module 420, configured to feed back a general purpose input / output port GPIO pin state to the terminal device according to the first level signal;
[0090] The instruction receiving module 430 is used to receive the identity authentication instruction sent by the terminal device; wherein the identity authentication instruction is sent by the terminal device when detecting that the state of the GPIO pin meets the activation state;
[0091] The signature verification module 440 is used to verify the signature of the identity authentication instruction and feed back the verification result to the terminal device, so that the terminal device switches from the current mode to the target mode when the verification result is passed.
[0092] The implementation principle and technical effects of the device provided in this embodiment are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0093] Figure 7 The structure diagram of an electronic device provided by the embodiment of the present disclosure is shown in FIG. Figure 7 As shown, the electronic device 500 includes one or more processors 501 and a memory 502 .
[0094] The processor 501 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 500 to perform desired functions.
[0095] The memory 502 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 501 may run the program instructions to implement the mode switching method of the terminal of the embodiment of the present disclosure described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.
[0096] In one example, the electronic device 500 may further include: an input device 503 and an output device 504 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0097] In addition, the input device 503 may also include, for example, a keyboard, a mouse, and the like.
[0098] The output device 504 can output various information to the outside, including the determined distance information, direction information, etc. The output device 504 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0099] Of course, to simplify, Figure 7 Only some of the components related to the present disclosure in the electronic device 500 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 500 may also include any other appropriate components.
[0100] Furthermore, this embodiment also provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the above-mentioned mode switching method of the terminal.
[0101] The embodiments of the present disclosure provide a method, device, electronic device, and medium computer program product for mode switching of a terminal, including a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0102] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also 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 a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0103] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A mode switching method of a terminal, characterized in that: The method is applied to a terminal device, and the method comprises: In response to the mode switching operation, determine the target mode to be switched, and trigger the security element SE to generate a first level signal, so that the SE feeds back the state of the general purpose input and output port GPIO pin according to the first level signal; When it is detected that the GPIO pin state meets the activation state, an identity authentication instruction is sent to the SE, so that the SE verifies the signature of the identity authentication instruction and feeds back the verification result; When the signature verification result is passed, the current mode is switched to the target mode.
2. The method according to claim 1, characterized in that The sending of the identity authentication instruction to the SE includes: Generate a random string; Sign the string using the private key in the preset public-private key pair to obtain a signature value; The signature value is used as the data field of the identity authentication instruction, and the identity authentication instruction is sent to the authentication program preset in the SE; wherein the authentication program is used to verify the signature of the identity authentication instruction.
3. The method according to claim 1, characterized in that The method further comprises: If the second level signal fed back by the SE after the signature verification of the identity authentication instruction is received, it is determined that the signature verification of the identity authentication instruction is passed.
4. The method according to claim 1, characterized in that The method further comprises: A status clearing instruction is sent to the SE, so that the SE sets the GPIO pin state of the terminal device to an inactive state according to the status clearing instruction.
5. The method according to claim 1, characterized in that The triggering safety element SE to generate a first level signal includes: The mode switching operation triggers the pull-up of the first GPIO pin on the hardware circuit of the SE to generate a first level signal lasting for a preset time period.
6. A mode switching method of a terminal, characterized in that: The method is applied to a security element SE, and the method includes: Generate a first level signal; wherein the first level signal is triggered by the terminal device in response to a mode switching operation; Feedback the general purpose input / output port GPIO pin state to the terminal device according to the first level signal; Receiving an identity authentication instruction sent by the terminal device; wherein the identity authentication instruction is sent by the terminal device when detecting that the state of the GPIO pin meets the activation state; The identity authentication instruction is signature verified, and the signature verification result is fed back to the terminal device, so that the terminal device switches from the current mode to the target mode when the signature verification result is passed.
7. The method according to claim 6, characterized in that The verifying the signature of the identity authentication instruction and feeding back the verification result to the terminal device includes: Using the public key in the preset public-private key pair, verifying the signature of the data field in the identity authentication instruction; If the signature verification is successful, the SE interface is called through a preset authentication program to generate a second level signal; The second level signal is fed back to the terminal device as a signature verification result.
8. A mode switching device for a terminal, characterized in that: The device is applied to a terminal device, and the device includes: An operation response module, configured to determine a target mode to be switched in response to a mode switching operation, and trigger the security element SE to generate a first level signal, so that the SE can feedback a general purpose input and output port GPIO pin state according to the first level signal; An instruction sending module, configured to send an identity authentication instruction to the SE when detecting that the GPIO pin state meets the activation state, so that the SE verifies the identity authentication instruction and feeds back the verification result; The mode switching module is used to switch from the current mode to the target mode when the signature verification result is passed.
9. A mode switching device for a terminal, characterized in that: The device is applied to a security element SE, and comprises: A signal generating module, configured to generate a first level signal; wherein the first level signal is generated by the terminal device in response to a mode switching operation. A state feedback module, used for feeding back the state of a general purpose input / output port GPIO pin to the terminal device according to the first level signal; An instruction receiving module, used for receiving an identity authentication instruction sent by the terminal device; wherein the identity authentication instruction is sent by the terminal device when detecting that the state of the GPIO pin meets the activation state; The signature verification module is used to verify the signature of the identity authentication instruction and feed back the verification result to the terminal device, so that the terminal device switches from the current mode to the target mode when the verification result is passed.
10. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1 to 5 or any one of claims 6 to 7.