Data input method and apparatus and user equipment
11574064 ยท 2023-02-07
Assignee
Inventors
- Peng Zhang (Beijing, CN)
- Ji WANG (Beijing, CN)
- Hui Li (Helsinki, FI)
- Hongliang Xie (Shenzhen, CN)
- Xiaopu Wang (Shenzhen, CN)
Cpc classification
G06F21/604
PHYSICS
G06F21/83
PHYSICS
G06F21/74
PHYSICS
International classification
Abstract
A data input method and apparatus, and user equipment are provided. The method includes: when it is determined that an operation of a user on the user equipment UE is not performed in a preset display area, deliver an event corresponding to the operation to a first operating environment for processing, where the preset display area runs in a second operating environment of the UE, and the second operating environment has a higher security level than the first operating environment. This can better improve security of an event generated when the user operates a program that runs in a Normal World of the user equipment, and can directly operate an event that runs in the Normal World.
Claims
1. A data input method for a user equipment (UE) with a first operating environment and a second operating environment, where the second operating environment has a higher security level than the first operating environment, comprising: displaying a preset display area, wherein the preset display area runs in the second operating environment; receiving a second operation performed on the UE; storing, by the second operating environment, a second event corresponding to the second operation in a shared storage area in response to determining that the second operation is not performed in the preset display area, wherein the shared storage area is a storage area that is shared by the first operating environment and the second operating environment; and triggering an interrupt in the first operating environment, wherein the interrupt causes the second event stored in the shared storage area to be obtained by the first operating environment for processing.
2. The method according to claim 1, wherein the triggering an interrupt in the first operating environment comprises: triggering the interrupt in the first operating environment; invoking a daemon thread in the first operating environment; and delivering, by using the daemon thread, the second event stored in the shared storage area to the first operating environment for processing.
3. The method according to claim 1, wherein the method further comprises: displaying the preset display area when determining that a first event corresponding to a first operation is a secure input event, wherein the secure input event is a data input event with an authority verification attribute.
4. The method according to claim 1, wherein the preset display area comprises a formatted input edit box.
5. The method according to claim 1, wherein the method further comprises: hiding the preset display area.
6. The method according to claim 1, wherein the first operating environment is run in a first virtual core of a processor and the second operating environment is run in a second virtual core of the processor.
7. The method according to claim 6, wherein the first virtual core is a non-secure core, and the second virtual core is a secure core.
8. The method according to claim 3, wherein a content of the authority verification attribute is a password.
9. An apparatus, comprising: at least one processor; and one or more memory having computer readable instructions stored thereon that, when executed by the least one processor, cause the apparatus to: display a preset display area, wherein the preset display area runs in a second operating environment, wherein the apparatus comprises a first operating environment and the second operating environment, and the second operating environment has a higher security level than the first operating environment; receive a second operation performed on the apparatus; store, by the second operating environment, a second event corresponding to the second operation in a shared storage area in response to determining that the second operation is not performed in the preset display area, wherein the shared storage area is a storage area that is shared by the first operating environment and the second operating environment; and trigger an interrupt in the first operating environment, wherein the interrupt causes the second event stored in the shared storage area to be obtained by the first operating environment for processing.
10. The apparatus according to claim 9, wherein the apparatus is further caused to: trigger the interrupt in the first operating environment; invoke a daemon thread in the first operating environment; and deliver, by using the daemon thread, the second event stored in the shared storage area to the first operating environment for processing.
11. The apparatus according to claim 9, wherein the apparatus is further caused to: display the preset display area when determining that a first event corresponding to a first operation is a secure input event, wherein the secure input event is a data input event with an authority verification attribute.
12. The apparatus according to claim 9, wherein the apparatus is further caused to: hide the preset display area.
13. The apparatus according to claim 9, wherein the first operating environment is run in a first virtual core of a processor and the second operating environment is run in a second virtual core of the processor.
14. The apparatus according to claim 13, wherein the first virtual core is a non-secure core, and the second virtual core is a secure core.
15. The apparatus according to claim 11, wherein a content of the authority verification attribute is a password.
16. A non-transitory computer-readable storage medium, comprising computer-readable instructions stored thereon that, when executed by at least one processor, cause an apparatus to: display a preset display area, wherein the preset display area runs in a second operating environment, wherein the apparatus comprises a first operating environment and the second operating environment, and the second operating environment has a higher security level than the first operating environment; receive a second operation performed on the apparatus; store, by the second operating environment, a second event corresponding to the second operation in a shared storage area in response to determining that the second operation is not performed in the preset display area, wherein the shared storage area is a storage area that is shared by the first operating environment and the second operating environment; and trigger an interrupt in the first operating environment, wherein the interrupt causes the second event stored in the shared storage area to be obtained by the first operating environment for processing.
17. The non-transitory storage medium according to claim 16, wherein the apparatus is further caused to: trigger the interrupt in the first operating environment; invoke a daemon thread in the first operating environment; and deliver, by using the daemon thread, the second event stored in the shared storage area to the first operating environment for processing.
18. The non-transitory storage medium according to claim 16, wherein the apparatus is further caused to: display the preset display area when determining that a first event corresponding to a first operation is a secure input event, wherein the secure input event is a data input event with an authority verification attribute.
19. The non-transitory storage medium according to claim 16, wherein the apparatus is further caused to: hide the preset display area.
Description
BRIEF DESCRIPTION OF DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
DESCRIPTION OF EMBODIMENTS
(11) To resolve a problem that in a TrustZone technology, neither security of an event generated when a user operates a program that runs in a Normal World of user equipment can be completely resolved, nor an event that runs in the Normal World can be directly operated, in technical solutions provided in the present invention, when it is determined that an operation of a user on UE is not performed in a preset display area, an event corresponding to the operation is delivered to a first operating environment for processing. The preset display area runs in a second operating environment of the UE, and the second operating environment has a higher security level than the first operating environment. Therefore, security of the event generated when the user operates the program that runs in the Normal World of the user equipment can be better improved, and the event that runs in the Normal World can be directly operated.
(12) The following expounds main implementation principles, specific implementations, and corresponding available beneficial effects of the technical solutions in the embodiments of the present invention with reference to various accompanying drawings.
(13) In a technical solution put forward in an embodiment of the present invention,
(14) In a TrustZone technology, when hardware and program instructions of user equipment run, there may be two operating environments: a secure operating environment and a non-secure operating environment. The non-secure operating environment may also be referred to as a Normal World, and is corresponding to a first operating environment put forward in this embodiment of the present invention. The secure operating environment may also be referred to as a Secure World, and is corresponding to a second operating environment put forward in this embodiment of the present invention. A program and hardware of the user equipment that run in the secure operating environment have a higher security level than a program and hardware of the user equipment that run in the non-secure operating environment. The Secure World may also be a virtual operating environment isolated from the operating system of the user equipment.
(15) User equipment to which a data input method put forward in an embodiment of the present invention is applied is shown in
(16) The memory 205 may include a read-only memory and a random access memory, and provide the processor 201 with a program instruction and data that are stored in the memory 205. A part of the memory 205 may further include a nonvolatile random access memory (NVRAM).
(17) In some implementations, the memory 205 stores the following elements: an executable module or a data structure, or a subset thereof, or an extended set thereof.
(18) An operating system 2051 includes various system program instructions. The program instructions may run on the framework layer, the kernel library layer, the driver layer, and the like shown in
(19) In the technical solution put forward in this embodiment of the present invention, the operating system may run in both a first operating environment and a second operating environment whose security level is higher than the first operating environment.
(20) An application program 2052 includes various application programs, for example, the desktop (launcher), the media player (Media Player), the browser (Browser), and an input method application that are shown in
(21) The various application programs in the application program 2052 may be applied to the first operating environment, or may run in the second operating environment. In the technical solution put forward in this embodiment of the present invention, the application program 2052 stores a program instruction that implements the data input method, and the program instruction runs in the second operating environment.
(22) In this embodiment of the present invention, the memory 205 may also be referred to as a storage area, and is configured to store a program of the data input method, and store the operating system.
(23) The processor 201 invokes the program instruction stored in the memory 205, and according to the obtained program instruction, the processor 201 is configured to: when it is determined that an operation of a user on the UE is not performed in a preset display area, deliver an event corresponding to the operation to the first operating environment for processing.
(24) Optionally, in an embodiment, the processor 201 is further configured to: when it is determined that the event corresponding to the operation is a secure input event, display the preset display area, so that the user performs the operation in the preset display area. The secure input event is a data input event with an authority verification attribute.
(25) Further, the processor 201 is specifically configured to store the event corresponding to the operation in a shared storage area. The shared storage area is a storage area that is shared by the first operating environment and the second operating environment.
(26) The user equipment further includes an interrupt in the first operating environment (which is not shown in
(27) Further, the processor 201 is specifically configured to hide the preset display area.
(28) User equipment to which a data input method put forward in an embodiment of the present invention is applied may be a mobile phone, a tablet, a personal digital assistant (Personal Digital Assistant, PDA), or the like. Referring to
(29) The user equipment 300 mainly includes a memory 320, a processor 360, and an input unit 330. The input unit 330 is configured to receive an event generated when a user performs an operation on a terminal. The memory 320 is configured to store program instructions of an operating system and various application programs.
(30) In a technical solution put forward in this embodiment of the present invention, a first operating environment and a second operating environment are put forward. Correspondingly, the memory 320 may be divided into a secure memory (which may also be referred to as a secure storage area), a non-secure memory (which may also be referred to as a non-secure storage area), and a shared memory (which may also be referred to as a shared storage area). The non-secure memory is disposed in the first operating environment, and the secure memory is disposed in the second operating environment. The second operating environment has a higher security level than the first operating environment. A processor or an interrupt disposed in the first operating environment cannot directly access the secure memory in the second operating environment. A processor or an interrupt in the second operating environment may access the non-secure processor disposed in the first operating environment, and access the non-secure storage area. For the shared memory, data stored in the shared memory is data that may be accessed by processors or interrupts in both the first operating environment and the second operating environment. That is, the processors or the interrupts in the first operating environment and the second operating environment may access the shared memory to obtain the data in the shared memory.
(31) It may be understood that for a specific implementation function of the processor 360, reference may be made to the detailed descriptions of the processor 201, and details are not described herein again.
(32) The memory 320 may be a memory of the user equipment 300. The memory may be divided into three storage spaces. The three storage spaces are separately corresponding to a secure memory disposed in the first operating environment, a non-secure memory disposed in the second environment, and a shared memory that may be accessed by application programs or hardware in both the first operating environment and the second operating environment. The secure memory, the non-secure memory, and the shared memory may have spaces of a same size, or may have spaces of different sizes according to different stored data input events.
(33) The input unit 330 of the user equipment may be configured to receive number or character information that is entered by the user, so as to generate a signal input related to user settings or function control of the user equipment 300. Specifically, in this embodiment of the present invention, the input unit 330 may include a touch panel 331. The touch panel 331 may collect an operation (such as an operation performed by the user on the touch panel 331 by using any proper object or accessory, such as a finger or a stylus) performed by the user on the touch panel 331, and drive, according to a preset program instruction, a corresponding apparatus connected to the touch panel 331. Optionally, the touch panel 331 may include two parts: a touch detection apparatus and a touch controller. The touch detection apparatus detects a touch location of the user, detects a signal brought by the touch operation, and sends the signal to the touch controller. The touch controller receives touch information received from the touch detection apparatus, converts the touch information into touch coordinates, and sends the touch coordinates to the processor 360. The touch controller can further receive and execute a command sent by the processor 360. In addition, the touch panel 331 may be implemented by using multiple types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 331, the input unit 330 may further include another input device 332. The another input device 332 may include but is not limited to one or more of a physical keyboard, a functional key (such as a volume control key or an on/off key), a trackball, a mouse, a joystick, or the like.
(34) The user equipment 300 may further include a display unit 340. The display unit 340 may be configured to display information entered by the user or information provided for the user and various menu interfaces of the user equipment 300. The display unit 340 may include a display panel 341. Optionally, the display panel 341 may be configured in a form such as a liquid crystal display (Liquid Crystal Display, LCD) or an organic light-emitting diode (Organic Light-Emitting Diode, OLED).
(35) Referring to
(36) In this embodiment of the present invention, the touch display screen includes different display areas. Each display area may include at least one interface element such as an icon of an application program and/or a widget home screen widget.
(37) The processor 360 is a control center of the user equipment 300, is connected to each part of an entire mobile phone by using various interfaces and lines, and performs various functions of the user equipment 300 and data processing by running or executing the software program and/or the module that are/is stored in the memory 320, so as to perform overall monitoring on the user equipment 300.
(38) It may be understood that during initiation, the processor 360 first enters the second operating environment, and performs initialization setting of the operating system in the second operating environment, so as to ensure security of the operating system.
(39) The initialization setting includes initialization of a monitor mode. In a system initiation process, all memories (the secure memory, the non-secure memory, and the shared memory) in the operating system of the user equipment are in the second operating environment. Then an operating system image that needs to run in the first operating environment is loaded into the non-secure memory, and then the system image in the first operating environment runs.
(40) Optionally, the user equipment 300 may further include an RF circuit 310, a WiFi module 380 that is configured to provide a wireless connection, a power supply 390, and an audio frequency circuit 370 that is configured to provide sound input and output.
(41) Based on the user equipment 300 with the touch display screen shown in
(42) As shown in
(43) SoC components are connected to each other by using an Advanced Extensible Interface (Advanced eXtensible Interactive, AXI) 411. The SoC communicates with the peripheral by using an Advanced Extensible Interface to Advanced Peripheral Bus Bridge (Advanced eXtensible Interactive to Advanced Peripheral Bus Bridge, AXI2APB) bridge 412. The AXI2APB may sense a security attribute of an event that currently accesses the peripheral. When an event in the first operating environment accesses a peripheral whose attribute is set to secure, the AXI2APB refuses this access. A secure RAM and a secure ROM are isolated by using a software and hardware mechanism, and the secure RAM and the secure ROM are configured to store an operating system that runs in the second operating environment.
(44) In the data input method put forward in this embodiment of the present invention, the SoC system is initiated after powered on. During starting, the system first enters the second operating environment, and then performs initiation setting in the second operating environment. The initiation setting includes initiation of the operating system in the second operating environment. In a process of initiating the system, all memories in the operating system of the user equipment are in the second operating environment. Then the operating system image that needs to run in the first operating environment is loaded to a memory, and some memories are allocated to the first operating environment. Security attributes of the some memories allocated to the first operating environment are set to non-secure. Then the system image in the first operating environment runs.
(45) The following describes in detail a processing procedure of a data input method put forward in an embodiment of the present invention. As shown in
(46) Step 1: A display unit presents an input area to a user, and the user performs an operation in the input area to generate an event corresponding to the operation.
(47) Detailed description is provided by using an example in which the user enters a payment password of a numeric type in the input area presented by the display unit. The display unit may include a touch panel of a touch nature. The user touches the touch panel, enters a payment account in the input area, and continues to enter a payment password after entering the payment account. A processor receives an event generated when the user operates the touch panel. Specifically, a non-secure core in the first operating environment may receive the event generated when the user operates the touch panel.
(48) Step 2: The processor determines whether the event generated when the user operates performs the operation in the input area is a secure input event. If it is determined that the event is not a secure input event, the user continues to perform the operation in the input area to generate an event corresponding to the operation, and the processor continues to process the event.
(49) The secure input event is an event generated only when the user enters a password with an authority verification attribute. For example, in a payment application, after the user enters a user name, the user needs to continue to enter a payment password corresponding to the user name, and after the payment password and the user name are matched, payment is completed. An event corresponding to an operation that the user continues to enter the payment password corresponding to the user name is a secure input event.
(50) A security attribute of the input area presented by the display unit may be edited in advance. The input area is set to a non-secure display area that runs in the first operating environment and a secure display area that runs in the second operating environment. For example, in a specific implementation process, as shown in
(51) Detailed description is provided below by still using the example in which the user enters the payment password of the numeric type. When the user is about to enter the payment password of the numeric type, for example, the payment password of the user is 12345678, when the user triggers a number, it is determined that a data input event operated by the user is a secure input event.
(52) Step 3: The processor triggers a TZ driver when it is determined that a data input event operated by the user is a secure input event. The TZ driver triggers a monitor (monitor) mode used for switching between the first operating environment and the second operating environment, and the processor enters the second operating environment by using a monitor.
(53) Step 4: The processor backs up a current event in the first operating environment in the monitor mode. The processor triggers an interrupt in the first operating environment, and stores the currently determined secure input event in a shared storage area. After saving of the secure input event is completed, an interrupt in the second operating environment is triggered in the monitor mode, and a processor in the second operating environment, that is, a secure core, is triggered by using the interrupt in the second operating environment.
(54) Step 5: The secure core (that is, the processor in the second operating environment) triggers the interrupt, starts a preset display area, and presents the preset display area to the user by using the display unit. A following operation of the user is performed in the preset display area.
(55) The preset display area runs in the second operating environment. The preset display area may be a part of a screen of the user equipment, and the user may perform an input operation in the preset display area. Correspondingly, the preset display area may be an input edit box that has a fixed shape and size and has a security attribute. As shown in
(56) For example, the preset display area is started, and it is assumed that the specified input type is a display area of the nine-key numeric type. In the display unit, the display area of the nine-key numeric type is presented to the user, and the user enters the payment password in the preset display area of the nine-key numeric type.
(57) Step 6: The processor delivers the event to the second operating environment for processing.
(58) By using the foregoing technical solution, determining is performed on a corresponding event generated when the user performs an operation in the input area that runs in the first operating environment, whether the event is a secure input event is determined, and when it is determined that the event is a secure input event, switching from the first operating environment to the second operating environment is performed, that is, the preset display area is presented to the user, so that a secure input time generated when the user performs an operation on the user equipment may be switched to the second operating environment for processing. In this case, security of an event generated when the user performs the operation on the user equipment can be better ensured.
(59) As shown in
(60) Step 7: A user performs an operation in a preset display area of user equipment.
(61) Step 8: A processor in the second operating environment obtains an event corresponding to the operation.
(62) For a detailed description of the preset display area, refer to the detailed description in step 5. Details are not described herein again.
(63) Likewise, description is provided by using an example in which the user enters a payment password of a numeric type. In step 8, the user enters the payment password in the preset display area.
(64) Step 9: The processor determines whether the operation of the user on the UE is performed in the preset display area, and if it is determined that the operation of the user on the UE is performed in the preset display area, perform step 10, or if it is determined that the operation of the user on the UE is not performed in the preset display area, perform step 12.
(65) Specifically, the user may perform an operation in a preset display area of a display unit, or may perform an operation outside the preset display area. A corresponding event generated by the operation of the user is transmitted to a secure core. The secure core determines whether the event is corresponding to an operation that falls in the preset display area. For example, the user enters the payment password in the preset display area, and the secure core determines whether a touch point of the user is in the preset display area. When the user triggers, for example, entering an account type (that is, performs an operation in the input area) during the foregoing operation, it is determined that the operation of the user is not performed in the preset display area; or when the user does not trigger entering an account type, it is determined that the operation of the user is performed in the preset display area. For example, the user is about to enter a payment password 12345678 by using the preset display area. When the user enters 123, the user equipment receives short message service message presentation or calling line identification presentation. If the user taps the short message service message presentation, the operation of the user on the user equipment at this time falls in a short message service message presentation box. In this case, it is determined that the operation of the user on the UE is not performed in the preset display area.
(66) Step 10: Continue to receive an event generated when the user performs the operation on the user equipment in the preset display area.
(67) Step 11: When it is determined that the user ends the operation, the processor performs verification processing on the received event, delivers the event to the first operating environment, and feeds back a verification processing result to the user.
(68) For example, when the user ends entering the payment password, the received payment password is verified in the second operating environment, and a verification result is fed back to the user.
(69) Step 12: When it is determined that the operation of the user on the user equipment is not performed in the preset display area, the processor delivers the event corresponding to the operation to the first operating environment for processing.
(70) There may be two implementations of delivering the event corresponding to the operation to the first operating environment for processing.
(71) Manner 1: An interrupt may be triggered to deliver the event corresponding to the operation to the first operating environment for processing.
(72) In Manner 1, the processor may trigger an interrupt in the second operating environment, and store, by using the interrupt in the second operating environment, the event corresponding to the operation of the user in the shared storage area. In this case, in the monitor mode, the processor triggers an interrupt in the first operating environment, to deliver the event stored in the shared storage area to the first operating environment for processing.
(73) For example, the processor triggers a fast interrupt request (Fast Interrupt Reques, FIQ), and stores the event corresponding to the operation of the user in the shared storage area. Then in the monitor mode, the processor triggers the interrupt in the first operating environment to obtain the event stored in the shared storage area. The interrupt in the first operating environment delivers the obtained event to the first operating environment for processing.
(74) Manner 2: The event corresponding to the operation is delivered, by using a daemon thread, to the first operating environment for processing.
(75) In Manner 2, a daemon process is a process with a relatively long lifetime, and is usually independent of the user equipment and periodically executes a task or waits to process an event that is to occur. The daemon process is usually started when the system is bootloaded, and ended when the system is disabled. In Manner 2, the processor may trigger an interrupt in the second operating environment, and store the event corresponding to the operation of the user in the shared storage area. Then in the monitor mode, the processor triggers an interrupt in the first operating environment, and triggers a daemon thread in the first operating environment by using the interrupt in the first operating environment. The daemon thread obtains the event stored in the shared storage area, and the daemon thread sends the obtained event to the first operating environment for processing.
(76) In the foregoing two specific implementations of delivering the event corresponding to the operation to the first operating environment for processing, before the event is delivered, a current event needs to be stored in the shared storage area. In this case, the interrupt in the second operating environment may be triggered, and the event may be stored in the shared storage area by using the interrupt that runs in the second environment. Alternatively, a driver of the display unit may transmit the event to an upper-layer application, and the event may be stored in the shared storage area by using the upper-layer application.
(77) Optionally, after delivering the event corresponding to the operation to the first operating environment for processing, the method further includes: hiding the preset display area.
(78) For example, after entering 12345678, the user does not need to perform any other operation, and in this case, the processor hides the preset display area.
(79) Correspondingly, an embodiment of the present invention further puts forward a data input method. As shown in
(80) Step 91: A user performs an operation in a preset display area of user equipment.
(81) Step 92: A processor in a second operating environment obtains an event corresponding to the operation.
(82) For a detailed description of the preset display area, refer to the detailed description in step 5. Details are not described herein again.
(83) Likewise, description is provided by using an example in which the user enters a payment password of a numeric type. The user enters the payment password in the preset display area.
(84) Step 93: The processor determines whether the operation of the user on the UE is performed in the preset display area, and if it is determined that the operation of the user on the UE is performed in the preset display area, perform step 94, or if it is determined that the operation of the user on the UE is not performed in the preset display area, perform step 96.
(85) Step 94: Continue to receive an event generated when the user performs the operation on the user equipment in the preset display area.
(86) Step 95: When it is determined that the user ends the operation, the processor performs verification processing on the received event, delivers the received event to a first operating environment, and feeds back a verification processing result to the user.
(87) For example, when the user ends entering the payment password, the received payment password is verified in the second operating environment, and a verification result is fed back to the user.
(88) Step 96: When it is determined that the operation of the user on the user equipment is not performed in the preset display area, the processor delivers the event corresponding to the operation to the first operating environment for processing.
(89) There may be two implementations of delivering the event corresponding to the operation to the first operating environment for processing.
(90) Manner 1: An interrupt may be triggered to deliver the event corresponding to the operation to the first operating environment for processing.
(91) In Manner 1, the processor may trigger an interrupt in the second operating environment, and store, by using the interrupt in the second operating environment, the event corresponding to the operation of the user in the shared storage area. In this case, in the monitor mode, the processor triggers an interrupt in the first operating environment, to deliver the event stored in the shared storage area to the first operating environment for processing.
(92) For example, the processor triggers a fast interrupt request (Fast Interrupt Reques, FIQ), and stores the event corresponding to the operation of the user in the shared storage area. Then in the monitor mode, the processor triggers the interrupt in the first operating environment to obtain the event stored in the shared storage area. The interrupt in the first operating environment delivers the obtained event to the first operating environment for processing.
(93) Manner 2: The event corresponding to the operation is delivered, by using a daemon thread, to the first operating environment for processing.
(94) In Manner 2, a daemon process is a process with a relatively long lifetime, and is usually independent of the user equipment and periodically executes a task or waits to process an event that is to occur. The daemon process is usually started when the system is bootloaded, and ended when the system is disabled. In Manner 2, the processor may trigger an interrupt in the second operating environment, and store the event corresponding to the operation of the user in the shared storage area. Then in the monitor mode, the processor triggers an interrupt in the first operating environment, and triggers a daemon thread in the first operating environment by using the interrupt in the first operating environment. The daemon thread obtains the event stored in the shared storage area, and the daemon thread sends the obtained event to the first operating environment for processing.
(95) In the foregoing two specific implementations of delivering the event corresponding to the operation to the first operating environment for processing, before the event is delivered, a current event needs to be stored in the shared storage area. In this case, the interrupt in the second operating environment may be triggered, and the event may be stored in the shared storage area by using the interrupt that runs in the second environment. Alternatively, a driver of the display unit may transmit the event to an upper-layer application, and the event may be stored in the shared storage area by using the upper-layer application.
(96) Optionally, after delivering the event corresponding to the operation to the first operating environment for processing, the method further includes: hiding the preset display area.
(97) For example, after entering 12345678, the user does not need to perform any other operation, and in this case, the processor hides the preset display area.
(98) Correspondingly, an embodiment of the present invention further puts forward a data input apparatus. As shown in
(99) a receiving unit 1001, configured to receive an event generated when a user performs an operation on UE in a preset display area;
(100) a determining unit 1002, configured to determine whether the operation of the user on the UE is performed in the preset display area; and
(101) an execution unit 1003, configured to: when it is determined that the operation of the user on the UE is not performed in the preset display area, deliver an event corresponding to the operation to a first operating environment for processing.
(102) The preset display area runs in a second operating environment of the UE, and the second operating environment has a higher security level than the first operating environment.
(103) Optionally, in the foregoing apparatus, the execution unit 1003 is specifically configured to: store the event corresponding to the operation in a shared storage area, where the shared storage area is a storage area that is shared by the first operating environment and the second operating environment; and trigger an interrupt in the first operating environment, to deliver the event stored in the shared storage area to the first operating environment for processing.
(104) Specifically, the execution unit 1003 is specifically configured to: trigger the interrupt in the first operating environment, and invoke a daemon thread in the first secure environment, so as to deliver, by using the daemon thread, the event stored in the shared storage area to the first operating environment for processing.
(105) Specifically, the execution unit 1003 is further configured to: when it is determined that the event corresponding to the operation is a secure input event, display the preset display area, so that the user performs the operation in the preset display area. The secure input event is a data input event with an authority verification attribute.
(106) Specifically, the execution unit 1003 is further configured to hide the preset display area after delivering the event corresponding to the operation to the first operating environment for processing.
(107) Specifically, the preset display area includes an input edit box with a security attribute.
(108) The present invention further provides a computer storage medium, configured to store a computer software instruction used by the data input apparatus according to the foregoing aspect. The computer software instruction includes a program designed to execute the foregoing aspect.
(109) A person skilled in the art should understand that the embodiments of the present invention may be provided as a method, an apparatus (device), or a computer program product. Therefore, the present invention may use a form of hardware only embodiments, software only embodiments, or embodiments with a combination of software and hardware. Moreover, the present invention may use a form of a computer program product that is implemented on one or more computer-usable storage media (including but not limited to a disk memory, a CD-ROM, an optical memory, and the like) that include computer-usable program code.
(110) The present invention is described with reference to the flowcharts and/or block diagrams of the method, the apparatus (device), and the computer program product according to the embodiments of the present invention. It should be understood that computer program instructions may be used to implement each process and/or each block in the flowcharts and/or the block diagrams and a combination of a process and/or a block in the flowcharts and/or the block diagrams. These computer program instructions may be provided for a general-purpose computer, a dedicated computer, an embedded processor, or a processor of any other programmable data processing device to generate a machine, so that the instructions executed by a computer or a processor of any other programmable data processing device generate an apparatus for implementing a specific function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.
(111) These computer program instructions may also be stored in a computer readable memory that can instruct the computer or any other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory generate an artifact that includes an instruction apparatus. The instruction apparatus implements a specific function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.
(112) These computer program instructions may also be loaded onto a computer or another programmable data processing device, so that a series of operations and steps are performed on the computer or the another programmable device, thereby generating computer-implemented processing. Therefore, the instructions executed on the computer or the another programmable device provide steps for implementing a specific function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.
(113) Although some preferred embodiments of the present invention have been described, a person skilled in the art can make changes and modifications to these embodiments once they learn the basic inventive concept. Therefore, the following claims are intended to be construed as to cover the preferred embodiments and all changes and modifications falling within the scope of the present invention.
(114) Obviously, a person skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. The present invention is intended to cover these modifications and variations provided that they fall within the scope of protection defined by the following claims and their equivalent technologies.