Electronic equipment, protection method and device thereof and readable storage medium

By introducing protection switches into electronic devices, changing the workflow of the subsystem driver layer, the problem of shutting down the safety mode after the main system is broken is solved, and the effect of ensuring the safety of the electronic device is achieved even if the main system is broken is broken.

CN119720207APending Publication Date: 2025-03-28GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311273377.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

After the main system is compromised or ROOT, the security mode may be turned off, causing privacy and security to be compromised.

Method used

By introducing a protection switch in the electronic device, it detects whether the protection switch is on in response to the application's request, and changes the drive layer workflow in the subsystem when it is turned on, returning empty data or virtual data.

Benefits of technology

Even if the main system is compromised or ROOT, electronic devices still ensure security through protection switches to prevent privacy leakage and malicious behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119720207A_ABST
    Figure CN119720207A_ABST
Patent Text Reader

Abstract

The invention discloses electronic equipment, a protection method and device thereof and a readable storage medium. The electronic equipment comprises a main system and at least one subsystem, and the method comprises the steps that in response to a request in an application program, whether a protection switch is turned on or not is detected; in response to the turn-on of the protection switch, returning null data or virtual data corresponding to the request to the application program; wherein when the protection switch is turned on, the workflow of the driving layer in the subsystem corresponding to the application program is changed. Through the mode, the safety of the electronic equipment is ensured by utilizing the protection switch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of security and privacy technology, and in particular to electronic devices and protection methods, devices and readable storage media thereof. Background Art

[0002] With the widespread popularization and application of electronic devices, electronic devices can support more and more applications and their functions are becoming more and more powerful. Electronic devices are developing in the direction of diversification and personalization, becoming indispensable electronic products in users' lives.

[0003] However, as electronic devices have more and more functions, security and privacy issues need to be addressed urgently. Summary of the invention

[0004] The present application provides an electronic device and a protection method, device and readable storage medium thereof, which can ensure the safety of the electronic device by using a protection switch.

[0005] In a first aspect, the present application provides a method for protecting an electronic device, which includes a main system and at least one subsystem, the method including: in response to a request in an application, detecting whether a protection switch is turned on; in response to the protection switch being turned on, returning empty data or virtual data corresponding to the request to the application; wherein, when the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed.

[0006] Among them, each subsystem includes a service layer, a hardware abstraction layer and a driver layer; in response to a request in an application, detecting whether the protection switch is turned on, including: responding to a request in an application, through the service layer, the hardware abstraction layer to the driver layer, and detecting whether the protection switch is turned on in the driver layer.

[0007] Wherein, in response to a request in an application, before detecting whether the protection switch is turned on, it includes: providing a protection switch turning on interface; in response to turning on the protection switch in the turning on interface, the workflow of the driver layer in the subsystem corresponding to the protection switch is changed.

[0008] Among them, in response to turning on the protection switch in the startup interface, the workflow of the driver layer in the subsystem corresponding to the protection switch is changed, including: in response to turning on the protection switch in the startup interface, calling a hook function to change the workflow of the driver layer in the subsystem corresponding to the protection switch.

[0009] Among them, the flag bit of the protection switch is protected by mandatory access control.

[0010] Among them, the root of trust of the protection switch is isolated from the main system.

[0011] Wherein, in response to a request in an application, before detecting whether the protection switch is turned on, it includes: providing a protection switch turning on interface; in response to turning on the protection switch in the turning on interface, the workflow of the driver layer in at least one subsystem is changed.

[0012] In a second aspect, the present application provides a protection device for an electronic device, which includes a main system and at least one subsystem, and the protection device includes: a detection module, used to detect whether a protection switch is turned on in response to a request in an application; a processing module, used to return empty data or virtual data corresponding to the request to the application in response to the protection switch being turned on; wherein, when the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed.

[0013] In a third aspect, the present application provides an electronic device, comprising a processor and a memory coupled to the processor; wherein the memory is used to store a computer program, and the processor is used to execute the computer program to implement the method provided in the first aspect.

[0014] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method provided in the first aspect.

[0015] The beneficial effects of the present application are: different from the prior art, the electronic device and its protection method, device and readable storage medium provided by the present application, the electronic device includes a main system and at least one subsystem. When the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed, so in response to the request in the application, and the protection switch is turned on, empty data or virtual data corresponding to the request is returned to the application. Based on this, even if the main system is hacked or ROOT, the electronic device still uses the protection switch to ensure the security of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0017] in:

[0018] Figure 1 It is a flowchart of an embodiment of a method for protecting an electronic device provided by the present application;

[0019] Figure 2 It is a flowchart of another embodiment of the protection method of the electronic device provided by the present application;

[0020] Figure 3 It is a flowchart of another embodiment of the protection method of the electronic device provided by the present application;

[0021] Figure 4 and Figure 5 This is a schematic diagram of an application scenario of a protection method for an electronic device provided by the present application;

[0022] Figure 6 It is a flowchart of another embodiment of the protection method of the electronic device provided by the present application;

[0023] Figure 7 and Figure 8 This is a schematic diagram of another application scenario of the protection method for electronic equipment provided by the present application;

[0024] Fig. 9 This is a schematic diagram of another application scenario of the protection method for electronic equipment provided by the present application;

[0025] Fig.10 It is a structural schematic diagram of an embodiment of a protection device provided by the present application;

[0026] Fig.11 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application;

[0027] Fig.12 is a structural schematic diagram of another embodiment of the electronic device provided by the present application;

[0028] Fig.13 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION

[0029] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It will be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some but not all structures related to the present application are shown in the drawings. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0030] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0031] With the widespread popularization and application of electronic devices, electronic devices can support more and more applications and their functions are becoming more and more powerful. Electronic devices are developing in the direction of diversification and personalization, becoming indispensable electronic products in users' lives.

[0032] However, as electronic devices have more and more functions, security and privacy issues need to be addressed urgently.

[0033] Although the electronic device is provided with an operating system and a corresponding security mechanism, once the main system of the operating system is hacked or rooted, the security mode is likely to be turned off.

[0034] Based on this, the present application proposes any of the following embodiments to solve at least one of the above technical problems.

[0035] See also Figure 1 , Figure 1 1 is a flow chart of an embodiment of a method for protecting an electronic device provided by the present application. The electronic device includes a main system and at least one subsystem, and the method includes:

[0036] Step 11: In response to a request in the application program, detecting whether the protection switch is turned on.

[0037] In some embodiments, the protection switch may be a physical switch. The protection switch may be turned on or off by a physical control on the electronic device. For example, an independent physical button may be provided on the electronic device, and a corresponding on or off instruction of the protection switch may be generated by pressing or pushing the physical button.

[0038] In some embodiments, the protection switch may be a virtual switch. It may be displayed on a display on an electronic device and provide touch operation. For example, a virtual button is displayed on the display of the electronic device, and a corresponding on or off instruction of the protection switch is generated by touching the virtual button.

[0039] In some embodiments, the main system is the kernel of the operating system in the electronic device, and each subsystem is a functional module, such as an audio functional module, a positioning functional module and / or an image functional module, etc. That is, the operating system in the electronic device is decentralized, the main system only retains the operating system kernel, and the remaining functional modules become independent subsystems.

[0040] Step 12: In response to the protection switch being turned on, returning empty data or dummy data corresponding to the request to the application.

[0041] When the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application program is changed.

[0042] In one application scenario, the user needs to bring an electronic device into a confidential area, but some functions of the electronic device are prone to leaking confidential content. For example, the system of the electronic device is maliciously destroyed, hijacked or cracked, causing the electronic device to passively respond to the malicious behavior and perform responsive operations. Such as feedback of current location information, collection of current audio information and / or taking photos. Based on this, the present application proposes a protection switch function. When the user enters a confidential area, the protection switch can be actively turned on. When the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed. At this time, even if the user makes an operation request to the application on the electronic device, or a malicious behavior makes an operation request to the application, empty data or virtual data corresponding to the request is returned to the application. The privacy security of the electronic device itself and the privacy security of the environment in which the electronic device is located are guaranteed.

[0043] In this embodiment, the electronic device includes a main system and at least one subsystem. When the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed. Therefore, in response to the request in the application, and the protection switch is turned on, empty data or virtual data corresponding to the request is returned to the application. Based on this, even if the main system is hacked or ROOT, the electronic device still uses the protection switch to ensure the security of the electronic device.

[0044] That is, when the main system of the electronic device is in normal use, there is a security protection mechanism for protecting the safety of the electronic device. However, after the main system is hacked or ROOTed, the security protection mechanism may be turned off, and the security mechanism of the protection switch provided by the present application can be used to ensure the safety of the electronic device. In the present application, the security protection mechanism in the main system can be the first protection mechanism, and the protection switch of the present application is the second protection mechanism. That is, the additional second protection mechanism is used to ensure the safety problem when the first protection mechanism is turned off.

[0045] See also Figure 2 , Figure 2 The electronic device includes a main system and at least one subsystem, each of which includes a service layer, a hardware abstraction layer and a driver layer. The method includes:

[0046] Step 21: In response to the request in the application, through the service layer and the hardware abstraction layer to the driver layer, and in the driver layer, detect whether the protection switch is turned on.

[0047] The factor system includes the service layer, the hardware abstraction layer, and the driver layer, and the application usually interacts directly with the service layer, which then interacts with the hardware abstraction layer, and then interacts with the driver layer. That is, the responses of the final subsystem are all processed by the driver layer. Therefore, it is necessary to detect whether the protection switch is turned on in the driver layer. That is, after the protection switch is turned on, the corresponding operation is the processing of the driver layer.

[0048] Considering that if the service layer and the hardware abstraction layer perform corresponding processing according to the protection switch, the corresponding request can actually bypass the service layer and the hardware abstraction layer, making the protection switch invalid, therefore, the protection switch acts on the driver layer.

[0049] Step 22: In response to the protection switch being turned on, returning empty data or dummy data corresponding to the request to the application.

[0050] When the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application program is changed.

[0051] In this embodiment, the electronic device includes a main system and at least one subsystem. When the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed. Therefore, in response to the request in the application, and the protection switch is turned on, empty data or virtual data corresponding to the request is returned to the application. Based on this, even if the main system is hacked or ROOT, the electronic device still uses the protection switch to ensure the security of the electronic device.

[0052] Furthermore, the protection switch acts on the driver layer, which can prevent related malicious behaviors from crossing the service layer and hardware abstraction layer, rendering the protection switch ineffective.

[0053] See also Figure 3 , Figure 3 1 is a flow chart of an embodiment of a method for protecting an electronic device provided by the present application. The electronic device includes a main system and at least one subsystem, and the method includes:

[0054] Step 31: Provide a protection switch activation interface.

[0055] Step 32: In response to turning on the protection switch in the turn-on interface, the workflow of the driver layer in the subsystem corresponding to the protection switch is changed.

[0056] In response to turning on the protection switch in the start interface, the hook function is called to change the workflow of the driver layer in the subsystem corresponding to the protection switch. Specifically, the corresponding code is injected into the driver layer in the subsystem through the hook function to change the code workflow in the driver layer. For example, when a request is received from a user of the application to access the subsystem, empty data or virtual data that does not contain sensitive user information is returned to it.

[0057] Step 33: In response to a request in the application program, detect whether the protection switch is turned on.

[0058] Step 34: In response to the protection switch being turned on, returning empty data or dummy data corresponding to the request to the application.

[0059] Steps 33 to 34 have the same or similar technical solutions as any embodiment of the present application, and will not be described in detail here.

[0060] Combination Figure 4 and Figure 5 To explain:

[0061] like Figure 4 As shown, a protection switch activation interface is provided in the display of the electronic device. Each subsystem corresponds to a protection switch. The user can decide whether to trigger the protection mechanism of the protection switch of the corresponding subsystem by selecting the protection switch button. For example, subsystem A corresponds to protection switch button a, subsystem B corresponds to protection switch button b, and subsystem C corresponds to protection switch button c. Figure 5 As shown, the user selects the protection switch button a, triggering the protection mechanism of the protection switch, and the workflow of the driver layer in the subsystem A corresponding to the protection switch is changed. Specifically, the corresponding code is injected into the driver layer in the subsystem A through the hook function to change the code workflow in the driver layer.

[0062] In some embodiments, the flag of the protection switch is protected by mandatory access control. Mandatory access control can restrict the subject or initiator from accessing or performing certain operations on an object or target. Under mandatory access control, users (or other subjects) and files (or other objects) are marked with fixed security attributes (such as security level, access rights, etc.). Every time an access occurs, the system checks the security attributes to determine whether a user has the right to access the file.

[0063] In some embodiments, the root of trust of the protection switch is isolated from the main system, which can ensure that the root of trust of the protection switch is not affected by the main system and continuously provide a trustworthy basis. The root of trust can be deployed in a virtual machine monitor and / or a trusted execution environment.

[0064] In this embodiment, the electronic device includes a main system and at least one subsystem. When the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed. Therefore, in response to the request in the application, and the protection switch is turned on, empty data or virtual data corresponding to the request is returned to the application. Based on this, even if the main system is hacked or ROOT, the electronic device still uses the protection switch to ensure the security of the electronic device. Because the root of trust of the protection switch is isolated from the main system, as long as the security of the switch root of trust is guaranteed, the protection switch can be used to ensure the security of the electronic device.

[0065] See also Figure 6 , Figure 6 1 is a flow chart of an embodiment of a method for protecting an electronic device provided by the present application. The electronic device includes a main system and at least one subsystem, and the method includes:

[0066] Step 61: Provide a protection switch activation interface.

[0067] Step 62: In response to turning on the protection switch in the start-up interface, the workflow of the driver layer in at least one subsystem is changed.

[0068] Step 63: In response to a request in the application program, detect whether the protection switch is turned on.

[0069] Step 64: In response to the protection switch being turned on, returning empty data or dummy data corresponding to the request to the application.

[0070] Combination Figure 7 and Figure 8 To explain:

[0071] exist Figure 7 In the embodiment, a protection switch activation interface is provided in the display of the electronic device. The user can decide whether to trigger the protection mechanism of the protection switch by selecting the protection switch button d. Figure 8 As shown, the user selects the protection switch button d to trigger the protection mechanism of the protection switch, and the workflow of the driver layer in the subsystem corresponding to the protection switch is changed. Specifically, the corresponding code is injected into the driver layer of all subsystems through the hook function to change the code workflow in the driver layer. That is, after the protection switch is turned on, all subsystems in the electronic device are injected with corresponding code in the driver layer by the hook function, changing the code workflow in the driver layer.

[0072] In one application scenario, the privacy and security protection features of electronic devices are becoming increasingly important. For important scenarios, the camera, audio, and location information of electronic devices should be prevented from being monitored, such as Fig. 9 The operating system in the electronic device may be any one of the Android system, the iOS system, the Hongmeng system or the Window system.

[0073] The main system in the electronic device is a general kernel for operating the mobile phone, and only the memory security of the flag bit of the protection switch is protected by mandatory access control (MAC).

[0074] Furthermore, the protection switch is located outside the main system to ensure that the root of trust is isolated from the main system.

[0075] Fig. 9The audio subsystem, image subsystem, and positioning subsystem in the example are the same in internal structure, which are divided into service layer, hardware abstraction layer, and driver layer from top to bottom. The application uses the corresponding subsystem function by accessing the service layer of the subsystem.

[0076] Furthermore, the module corresponding to the hook function is also located outside the main system. When the protection switch is turned off, each subsystem works normally according to the default mode, and returns normal data to the application when receiving a request to access the subsystem.

[0077] When the protection switch is turned on, the hook function is started, injecting code into the driver layer in the subsystem to change its code workflow. Specifically, when receiving a request from an application to access the subsystem, it returns empty data or pseudo data that does not contain user sensitive information, thereby achieving the effect of anti-tracking mode and protecting user security and privacy.

[0078] See also Fig.10 , Fig.10 1 is a schematic diagram of a structure of an embodiment of a protection device for an electronic device provided by the present application. The electronic device includes a main system and at least one subsystem, and the protection device 100 includes: a detection module 101 and a processing module 102 .

[0079] The detection module 101 is used to detect whether the protection switch is turned on in response to a request in the application program.

[0080] The processing module 102 is used for returning empty data or virtual data corresponding to the request to the application in response to the protection switch being turned on; wherein, when the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed.

[0081] The detection module 101 and the processing module 102 cooperate with each other to implement the method of any of the above embodiments.

[0082] See also Fig.11 , Fig.11 1 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The electronic device 110 includes a processor 111 and a memory 112 coupled to the processor 111;

[0083] The memory 112 is used to store computer programs, and the processor 111 is used to execute computer programs to implement the following method:

[0084] In response to a request in an application, detect whether a protection switch is turned on; in response to the protection switch being turned on, return empty data or virtual data corresponding to the request to the application; wherein, when the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed.

[0085] It can be understood that the processor 111 is used to execute a computer program to implement the method of any of the above embodiments.

[0086] See also Fig.12 , Fig.12 1 is a schematic diagram of the structure of another embodiment of the electronic device provided by the present application. The electronic device 110 may be, for example, the electronic device described above. The electronic device 110 may include: a memory 112, a processor (Central Processing Unit, CPU) 111, a circuit board (not shown in the figure), a power circuit and a microphone 123. The circuit board is placed inside the space surrounded by the shell; the processor 111 and the memory 112 are arranged on the circuit board; the power circuit is used to supply power to various circuits or devices of the electronic device; the memory 112 is used to store executable program code; the processor 111 runs a computer program corresponding to the executable program code by reading the executable program code stored in the memory 112 to implement the method of any of the above embodiments.

[0087] The electronic device may also include: a peripheral interface 114, an RF (Radio Frequency) circuit 116, an audio circuit 117, a speaker 122, a power management chip 119, an input / output (I / O) subsystem 120, other input / control devices 121, a display 113 and an external port 115. These components communicate through one or more communication buses or signal lines 118.

[0088] The memory 112 can be accessed by the processor 111, the peripheral interface 114, etc. The memory 112 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more disk storage devices, flash memory devices, or other volatile solid-state storage devices. The peripheral interface 114 can connect the input and output peripherals of the device to the processor 111 and the memory 112.

[0089] The I / O subsystem 120 can connect the input and output peripherals on the device, such as the display 113 and other input / control devices 121, to the peripheral interface 114. The I / O subsystem 120 may include a display controller 1201 and one or more input controllers 1202 for controlling other input / control devices 121. Among them, the one or more input controllers 1202 receive electrical signals from other input / control devices 121 or send electrical signals to other input / control devices 121. Other input / control devices 121 may include physical buttons (press buttons, rocker buttons, etc.), dials, slide switches, joysticks, and click wheels. It is worth noting that the input controller 1202 can be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.

[0090] The display 113 is an input interface and an output interface between the user electronic device and the user, and displays visual output to the user. The visual output may include graphics, text, icons, videos, etc.

[0091] The display controller 1201 in the I / O subsystem 120 receives an electrical signal from the display 113 or sends an electrical signal to the display 113. The display 113 detects contact on the touch screen, and the display controller 1201 converts the detected contact into interaction with a user interface object displayed on the display 113, that is, realizes human-computer interaction. The user interface object displayed on the display 113 may be an icon for running a game, an icon for connecting to a corresponding network, etc.

[0092] The RF circuit 116 is mainly used to establish communication between the mobile phone and the wireless network (i.e., the network side) to realize data reception and transmission between the mobile phone and the wireless network. For example, sending and receiving short messages, emails, etc. Specifically, the RF circuit 116 receives and sends RF signals, which are also called electromagnetic signals. The RF circuit 116 converts electrical signals into electromagnetic signals or converts electromagnetic signals into electrical signals, and communicates with the communication network and other devices through the electromagnetic signals. The RF circuit 116 may include known circuits for performing these functions, including but not limited to antenna systems, RF transceivers, one or more amplifiers, tuners, one or more oscillators, digital signal processors, CODEC (COder-DECoder, codec) chipsets, Subscriber Identity Module (SIM), etc.

[0093] The audio circuit 117 is mainly used to receive audio data from the peripheral interface 114, convert the audio data into an electrical signal, and send the electrical signal to the speaker 122. The speaker 122 is used to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 116 to sound and play the sound to the user. The power management chip 119 is used to provide power supply and power management for the processor 111, the I / O subsystem 120 and the hardware connected to the peripheral interface 114.

[0094] The electronic device 110 mentioned above may be a mobile terminal, such as a smart phone, a tablet or other mobile device, or a terminal device, such as a personal computer, or a corresponding server.

[0095] See also Fig.13 , Fig.13 1 is a schematic diagram of a computer readable storage medium according to an embodiment of the present application. The computer readable storage medium 150 stores a computer program 151. When the computer program 151 is executed by a processor, the following method is implemented:

[0096] In response to a request in an application, detect whether a protection switch is turned on; in response to the protection switch being turned on, return empty data or virtual data corresponding to the request to the application; wherein, when the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed.

[0097] It can be understood that when the computer program 151 is executed by a processor, it can also implement the method of any of the above embodiments.

[0098] In summary, the electronic device and its protection method, device and readable storage medium provided by the present application include a main system and at least one subsystem. When the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed. Therefore, in response to the request in the application, and the protection switch is turned on, empty data or virtual data corresponding to the request is returned to the application. Based on this, even if the main system is hacked or ROOT, the electronic device still uses the protection switch to ensure the security of the electronic device.

[0099] Furthermore, the core code of anti-tracking is distributed to the driver layer of each subsystem through HOOK technology. In this way, even if the main system is hacked or ROOTed, as long as the security of the trust root of the protection switch is guaranteed, the security of the anti-tracking mode can be guaranteed, and the safety of the electronic device can be guaranteed.

[0100] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only illustrative, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0101] If the integrated units in the above other embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program codes.

[0102] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for protecting an electronic device, characterized in that: The electronic device comprises a main system and at least one subsystem, and the method comprises: In response to a request in the application, detecting whether the protection switch is turned on; In response to the protection switch being turned on, returning empty data or dummy data corresponding to the request to the application; When the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed.

2. The method according to claim 1, characterized in that Each subsystem includes a service layer, a hardware abstraction layer, and a driver layer; The step of detecting whether the protection switch is turned on in response to a request in the application program includes: In response to a request in an application, the protection switch is detected in the driver layer through the service layer and the hardware abstraction layer to determine whether it is turned on.

3. The method according to claim 1, characterized in that Before the step of responding to the request in the application and detecting whether the protection switch is turned on includes: Provide a protection switch activation interface; In response to turning on the protection switch in the turn-on interface, the workflow of the driver layer in the subsystem corresponding to the protection switch is changed.

4. The method according to claim 3, characterized in that In response to turning on the protection switch in the turn-on interface, the workflow of the driver layer in the subsystem corresponding to the protection switch is changed, including: In response to turning on the protection switch in the turn-on interface, a hook function is called to change the workflow of the driver layer in the subsystem corresponding to the protection switch.

5. The method according to claim 4, characterized in that The flag bit of the protection switch is protected by mandatory access control.

6. The method according to claim 3, characterized in that The root of trust of the protection switch is isolated from the main system.

7. The method according to claim 1, characterized in that Before the step of responding to the request in the application and detecting whether the protection switch is turned on includes: Provide a protection switch activation interface; In response to turning on the protection switch at the turn-on interface, a workflow of a driver layer in at least one of the subsystems is changed.

8. A protective device for an electronic device, characterized in that: The electronic device comprises a main system and at least one subsystem, and the protection device comprises: A detection module, used to detect whether the protection switch is turned on in response to a request in the application program; a processing module, configured to return empty data or dummy data corresponding to the request to the application program in response to the protection switch being turned on; When the protection switch is turned on, the workflow of the driver layer in the subsystem corresponding to the application is changed.

9. An electronic device, characterized in that: The electronic device includes a processor, a memory and a display coupled to the processor; The memory is used to store a computer program, and the processor is used to execute the computer program to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 7.