Touch operation recognition method and electronic device

By introducing preset scenarios and parameter characterization mechanisms in electronic devices, knuckle-related algorithms are only executed when necessary, the problem of high power consumption during touch operation recognition in the prior art is solved, and more efficient energy efficiency performance is achieved.

CN118444797BActive Publication Date: 2025-04-29HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311525200.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-15
Publication Date
2025-04-29
Estimated Expiration
2043-11-15

AI Technical Summary

Technical Problem

Existing electronic devices consume a high power consumption during touch operation recognition, especially the increase in power consumption caused by frequent call to knuckle-related algorithms.

Method used

By introducing preset scenarios and parameter characterization mechanisms in electronic devices, knuckle-related algorithms are executed only when necessary, reducing unnecessary algorithm calls. Specific implementation includes avoiding the execution of knuckle-related algorithms when the user scenario is a preset scenario (such as application startup process, game scenario, accessibility mode) or parameter representation does not require processing operations.

Benefits of technology

It effectively reduces the processing power consumption of electronic devices during touch operation identification and improves the energy efficiency performance of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118444797B_ABST
    Figure CN118444797B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method for identifying a touch operation and an electronic device, the method is performed by an electronic device, the electronic device includes a touch screen, the method includes: in response to a first touch operation performed by a user on the touch screen, obtaining corresponding touch data; when the current user scene is a preset scene, and / or the first parameter indicates that the first processing operation does not need to be performed, not performing the first processing operation, the first processing operation includes identifying whether the first touch operation is a finger joint touch operation based on the touch data, the preset scene includes a preset scene that does not respond to finger joint touch operations, and the first parameter is a parameter determined according to the validity of the touch data and the pressure data corresponding to the first touch operation; when the current user scene is not a preset scene, and the first parameter indicates that the first processing operation needs to be performed, the first processing operation is performed. In this way, the processing power consumption of the electronic device during the identification of the touch operation can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to a touch operation recognition method and electronic device. Background Art

[0002] With the diversification of the functions of electronic devices, users can input various instructions to electronic devices through touch operations. For example, they can switch the display interface of the electronic device by swiping left, right, up or down on the touch screen, or they can use their knuckles to perform touch operations such as single-clicking, double-clicking, and drawing circles on the touch screen to start functions such as screenshots and screen recording.

[0003] Generally, electronic devices need to identify touch operations on the touch screen to determine the type of the touch operation, such as whether it is a knuckle touch operation. However, in related technologies, the electronic device consumes a lot of power in the process of identifying touch operations. Summary of the invention

[0004] The present application provides a touch operation recognition method and an electronic device, which can reduce the processing power consumption of the electronic device during the touch operation recognition process.

[0005] In a first aspect, the present application provides a method for identifying a touch operation, which is executed by an electronic device, the electronic device including a touch screen, the method including: in response to a first touch operation performed by a user on the touch screen, obtaining corresponding touch data; when the current user scenario is a preset scenario, and / or a first parameter indicates that there is no need to perform a first processing operation, not performing the first processing operation, the first processing operation including identifying whether the first touch operation is a touch operation of a finger joint based on the touch data, the preset scenario including a preset scenario that does not respond to touch operations of the finger joints, the first parameter being a parameter determined based on the validity of the touch data and the pressure data corresponding to the first touch operation; when the current user scenario is not a preset scenario and the first parameter indicates that the first processing operation needs to be performed, performing the first processing operation.

[0006] The first touch operation input by the user can be any touch operation on the touch screen, such as a touch operation of a finger or a touch operation of a knuckle. The present application aims to reduce the number of times the knuckle-related algorithm is called, and it is not necessary to execute the knuckle-related algorithm for each touch operation. Therefore, the electronic device does not execute the first processing operation in a preset scenario where it does not respond to the knuckle touch operation and / or in a scenario where it is not necessary to execute the first processing operation, so as to reduce the processing power consumption of the electronic device.

[0007] Optionally, the touch data acquired by the electronic device may be capacitance data obtained after the TP IC converts the collected capacitance electrical signal.

[0008] In combination with the first aspect, in some implementations of the first aspect, the preset scene is a scene in which the application window is in the startup process, a game scene, or an accessibility mode scene.

[0009] Among them, when an application is started or a window within an application is started, since the window content has not been loaded in this process, the application can set the window startup scenario as a scenario that disables knuckle-related algorithms. The game scenario is that the electronic device is currently running a game application. In order to prevent the user from accidentally touching the game interface, the application can also set the game scenario as a scenario that disables knuckle-related algorithms. Accessibility mode is an operating mode developed for special groups of users to use electronic devices. In order to ensure that users can use electronic devices more conveniently, the application also sets this mode as a scenario that disables knuckle-related algorithms. This scenario of disabling knuckle-related algorithms is a scenario that does not respond to knuckle touch operations. Even if the user has knuckle touch operations, the touch operation will not be responded to. Therefore, in this scenario, the electronic device does not have to perform the first processing operation, reducing processing power consumption.

[0010] In combination with the first aspect, in some implementations of the first aspect, the electronic device includes an input module of a local framework layer and an input framework of an application framework layer, and the current user scene is a preset scene, including: the input module registers a listening event with the input framework; when the input framework determines that the current user scene is the preset scene, the input framework returns a callback status to the input module, and the callback status indicates that the current user scene is the preset scene.

[0011] Among them, when the electronic device is turned on, the input module of the local framework layer can call the interface of the input framework and register a monitoring event with the input framework to monitor whether the current user scene determined by the input framework is a preset scene. When the current user scene is a preset scene, the input framework returns a callback status to the input module, that is, it informs the input module that the current user scene is a preset scene, and the knuckle-related algorithms will no longer be executed in the future to reduce the processing power consumption of the electronic device.

[0012] In combination with the first aspect, in some implementations of the first aspect, after obtaining the corresponding touch data, the method further includes: processing the touch data to obtain capacitance data of each capacitor node on the touch screen corresponding to the first touch operation, and the validity of the touch data includes the validity of the capacitance data of each capacitor node.

[0013] Since touch data is generally collected by TP IC, which may be composed of IC electrodes, the collected touch data includes capacitance data of multiple capacitor nodes. Then, the electronic device may process the touch data, for example, including but not limited to packaging, normalization, data calibration, etc., to obtain capacitance data of each capacitor node. Accordingly, the validity of the touch data on which the above-mentioned first parameter depends is the validity of the capacitance data of each capacitor node.

[0014] Optionally, when the electronic device determines whether the capacitance data of each capacitor node is valid, it can be determined based on the data arrangement of the capacitance data. Through research, it is found that if there are at least n rows or columns of values ​​​​of the capacitance data of each capacitor node that are 0, the corresponding scene is sliding from the top edge, sliding from the bottom edge, sliding from the left edge, and sliding from the right edge on the touch screen. This type of scene is usually an invalid scene. Then, the electronic device can determine the capacitance data of each capacitor node corresponding to the scene as invalid data, and the capacitance data of each capacitor node corresponding to other scenes is determined as valid data. Optionally, n=2.

[0015] In combination with the first aspect, in some implementations of the first aspect, the first parameter indicating that the first processing operation does not need to be performed includes: when the first parameter is a first value, indicating that the first processing operation does not need to be performed.

[0016] In combination with the first aspect, in some implementations of the first aspect, the first parameter indicating that the first processing operation needs to be performed includes: when the first parameter is a second value, indicating that the first processing operation needs to be performed.

[0017] It can be seen from the above implementation that the first parameter is used to indicate whether the first processing operation needs to be performed. When the first parameter is a first value, it can indicate that the first processing operation does not need to be performed; when the first parameter is a second value, it can indicate that the first processing operation needs to be performed. Optionally, the first value can be 0 and the second value can be 1.

[0018] In one implementation, when the electronic device determines the first parameter according to the validity of the touch data and the pressure data corresponding to the first touch operation, if the validity of the capacitance data of each capacitor node is invalid, and / or the pressure data is greater than a preset threshold, the first parameter is set to a first value. Optionally, the pressure data can be obtained by a pressure sensor in the electronic device. Optionally, the preset threshold value set can be 600. That is, in this implementation, the electronic device sets the first parameter to the first value, indicating that the above-mentioned first processing operation does not need to be performed, thereby reducing the processing power consumption of the electronic device.

[0019] In another implementation, when the electronic device determines the first parameter according to the validity of the touch data and the pressure data corresponding to the first touch operation, if the validity of the capacitance data of each capacitor node is valid and the pressure data is not greater than the preset threshold, the first parameter is set to the second value. That is, at this time, the first touch operation may be a touch operation of the user's finger joint, and the first processing operation needs to be performed.

[0020] In combination with the first aspect, in some implementations of the first aspect, the electronic device includes a touch screen main algorithm THP module of the hardware abstraction layer and a TP driver of the kernel layer, which processes touch data to obtain capacitance data of each capacitor node on the touch screen corresponding to the first touch operation, including: the THP module processes the touch data to obtain capacitance data of each capacitor node; the THP module writes the capacitance data of each capacitor node into the TP driver.

[0021] The above-mentioned process of processing the touch data can be performed by the THP module in the electronic device, and the THP module can write the obtained capacitance data of each capacitor node into the TP driver, so that the subsequent input module can obtain the capacitance data from the TP driver for processing. Optionally, after the THP module processes the touch data, in addition to obtaining the capacitance data of each capacitor node, it can also obtain the coordinate data of each capacitor node, so that the TP driver can generate an input event and upload it to the upper module.

[0022] In one implementation, after obtaining the capacitance data of each capacitor node, the method further includes: the THP module determines a second parameter based on the validity of the capacitance data of each capacitor node and the pressure data corresponding to the first touch operation, and the second parameter is used to determine the value of the first parameter; the THP module writes the second parameter and the coordinate data of each capacitor node into the TP driver, and the coordinate data of each capacitor node is obtained by the THP module processing the touch data; the TP driver generates an input event based on the second parameter and the coordinate data of each capacitor node, and the input event carries the first parameter.

[0023] In this implementation, after obtaining the capacitance data of each capacitor node, the THP module can determine whether the capacitance data is valid, and determine a second parameter (i.e., a preset parameter) based on the validity of the capacitance data and the pressure data corresponding to the first touch operation. The second parameter is used to determine the value of the first parameter. For example, when the second parameter is 0, the first parameter is also 0, and when the second parameter is 1, the first parameter is also 1. Therefore, the second parameter can also characterize whether the first processing operation needs to be performed. It can be understood that the purpose of determining the second parameter here is to write the second parameter into the TP driver so that the TP driver generates an input event based on the second parameter and the coordinate data of each capacitor node. The generated input event carries the first parameter (i.e., the input event includes a new field). Therefore, after the subsequent TP driver uploads the input event to the upper-level input module, the input module can determine whether to perform the first processing operation based on the value of the first parameter to reduce the processing power consumption of the electronic device.

[0024] Optionally, after the THP determines the second parameter, when the second parameter indicates that the first processing operation does not need to be performed, because the capacitance data will not be used to perform the first processing operation subsequently, the THP module may no longer transmit the capacitance data back to the TP driver, but only transmit the coordinate data and the second parameter back to the TP driver, thereby further reducing processing power consumption.

[0025] In combination with the first aspect, in some implementations of the first aspect, the above method also includes: the TP driver reports the capacitance data and input events of each capacitor node to the input module of the local framework layer; the input module determines whether to execute the first processing operation based on the callback status returned by the input framework and / or the first parameter carried by the input event.

[0026] Among them, the input module determines not to execute the first processing operation when it is determined that the callback state represents that the current user scenario is a preset scenario, and / or the first parameter represents that the first processing operation does not need to be executed; when it is determined that the callback state represents that the current user scenario is not a preset scenario, and the first parameter represents that the first processing operation needs to be executed, it determines to execute the first processing operation, thereby reducing the processing power consumption of the electronic device.

[0027] Optionally, in the case of determining to perform the first processing operation, the above method further includes: the input module obtains sensor data; the input module identifies whether the first touch operation is a touch operation of the finger joint based on the capacitance data of each capacitor node and the sensor data. That is to say, when identifying whether the first touch operation is a touch operation of the finger joint, the input module also obtains sensor data to jointly identify the touch operation based on the capacitance data and the sensor data. Optionally, the sensor data can be acceleration data, and the input module can obtain the acceleration data from the Sensor Client Manager through the inter-core communication mechanism.

[0028] In combination with the first aspect, in some implementations of the first aspect, the first parameter adopts a bitmap data format, and the 0th bit value in the bitmap data format represents whether the first processing operation needs to be performed.

[0029] The first parameter (i.e., the new field in the input event) can adopt a bitmap data format. Optionally, the length of the bitmap data format can be 32 bits. Among them, the 0th bit value can be used to indicate whether the first processing operation needs to be performed. For example, when the 0th bit value is 1, it indicates that the first processing operation needs to be performed, and when the value is 0, it indicates that the first processing operation does not need to be performed. It can be understood that the 1st bit to the 31st bit can be used for subsequent expansion needs.

[0030] In a second aspect, the present application provides a device, which is included in an electronic device, and the device has the function of implementing the electronic device behavior in the above-mentioned first aspect and the possible implementation of the above-mentioned first aspect. The function can be implemented by hardware, or it can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-mentioned functions. For example, a receiving module or unit, a processing module or unit, etc.

[0031] In a third aspect, the present application provides an electronic device, comprising: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other so that the electronic device executes any one of the methods in the technical solution of the first aspect.

[0032] In a fourth aspect, the present application provides a chip, including a processor. The processor is used to read and execute a computer program stored in a memory to perform the method in the first aspect and any possible implementation thereof.

[0033] Optionally, the chip also includes a memory, and the memory is connected to the processor via a circuit or wire.

[0034] Further optionally, the chip also includes a communication interface.

[0035] In a fifth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes any one of the methods in the technical solution of the first aspect.

[0036] In a sixth aspect, the present application provides a computer program product, the computer program product comprising: a computer program code, when the computer program code runs on an electronic device, the electronic device executes any one of the methods in the technical solution of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is an application scenario diagram of a finger touch operation provided in an embodiment of the present application;

[0038] Figure 2 This is an application scenario diagram of a knuckle touch operation provided in an embodiment of the present application;

[0039] Figure 3 is another application scenario diagram of knuckle touch operation provided by an embodiment of the present application;

[0040] Figure 4 It is a schematic diagram of a module for identifying whether a touch operation is a touch operation of a knuckle in the related art;

[0041] Figure 5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0042] Figure 6 is a software structure block diagram of an electronic device provided in an embodiment of the present application;

[0043] Figure 7 is a schematic diagram of an example of a bitmap data format provided in an embodiment of the present application;

[0044] Figure 8 It is a schematic diagram of IC electrode arrangement of a mutual capacitive touch screen provided in an embodiment of the present application;

[0045] Fig. 9 is a schematic diagram of the working principle of a mutual capacitive touch screen provided in an embodiment of the present application;

[0046] Fig.10 This is a schematic diagram of the module interaction flow of a touch operation recognition method provided in an embodiment of the present application;

[0047] Fig.11 is a schematic diagram of an example of invalid capacitance data provided in an embodiment of the present application;

[0048] Fig.12 This is a flowchart of an example of a THP module executing a filtering algorithm provided in an embodiment of the present application;

[0049] Fig.13 is a schematic diagram of a parameter field carried by an input event provided in an embodiment of the present application;

[0050] Fig.14 is a schematic diagram of a module interaction flow of another touch operation recognition method provided in an embodiment of the present application;

[0051] Fig.15 This is a schematic diagram of the module interaction flow of another example of a touch operation recognition method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0053] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.

[0054] In order to better understand the embodiments of the present application, the terms or concepts that may be involved in the embodiments are explained below.

[0055] Touch panel (TP): also known as a touch screen, is an inductive display device that can receive signals input by a stylus pen, finger, etc. In other words, a touch screen is a screen or display screen that has both touch function and display function. The screen or display screen described in the following embodiments of this application refers to a touch screen.

[0056] Generally, a touch screen includes a touch detection component and a touch screen controller. The touch detection component can be installed on the upper layer of the display device to detect touch information such as the user's touch position, and transmit the detected touch information to the touch screen controller. The touch screen controller is used to process the touch information and send the corresponding signal to the processor of the electronic device. Then, after the processor processes the signal, it executes the corresponding response action, such as screenshot, screen recording, or window switching.

[0057] The touch detection components usually include various types of sensors, such as acceleration (ACC) sensors, capacitance (CAP) sensors, piezoelectric bending elements, displacement sensors, velocity sensors, vibration sensors, laser microphones, and liquid microphones, etc. When the user's knuckles, palms, fingertips, fingernails, etc. act on the touch screen, a touch event will occur, and at this time, different sensors can collect different touch data.

[0058] As the functions of electronic devices become more diverse, users can input various commands to electronic devices through touch operations. For example, users can switch the display interface of the electronic device by performing touch operations such as swiping left, right, up, or down on the touch screen. For example, Figure 1 As shown in FIG. 1 , on the web browsing interface, the user can slide his finger upward to move the web interface of the electronic device upward. For another example, the user can also use the knuckles to perform touch operations such as single-clicking, double-clicking, and drawing circles on the touch screen to start functions such as screenshots and screen recording. For example, Figure 2 As shown in FIG. 1 , on the desktop interface of the electronic device, the user can use a single finger joint to tap twice on the touch screen (double-click) to trigger the electronic device to take a screenshot of the current interface, or as shown in FIG. Figure 3 As shown, the user can use a single finger joint to draw a circle on the touch screen to trigger the electronic device to take a partial screenshot of the content in the circled area.

[0059] exist Figures 1 to 3 In the scenario, users use their hands to perform touch operations. The difference is that Figure 1 is to use fingers for touch, and Figure 2 and Figure 3 The knuckles are used for touch control. When the user inputs a touch operation, the electronic device needs to identify the touch operation applied by the user on the touch screen to determine which type of touch operation it is. In actual usage scenarios, the usage rate of users using the touch operation of their knuckles to start functions such as screenshots and screen recordings is relatively low. This operation is only performed when screenshots and screen recordings are required, while the usage rate of finger touch operations is relatively high. However, in related technologies, when an electronic device receives any touch operation, it calls a knuckle-related algorithm to determine whether the current operation is a knuckle touch operation and whether the corresponding shortcut function needs to be triggered. Therefore, this leads to the problem of high processing power consumption of electronic devices.

[0060] For example, Figure 4As shown, in a related technology, when a user touches the touch screen of an electronic device with his hand, the touch chip (TP IC) in the electronic device can report the capacitance data generated by the touch to the upper layer, for example, to the TP driver of the kernel layer, and then the TP driver uploads the capacitance data to the local framework (Native) layer. The finger joint module of the Native layer obtains the ACC data in the baseband processor (cooperate processor, CP) subsystem through the finger joint driver of the kernel layer based on the inter-core communication mechanism, and then identifies the capacitance data and ACC data to determine whether it is a touch operation of the finger joint, and returns or reports the identification result to the upper application. Among them, because each touch operation must execute the above process of determining whether it is a touch operation of the finger joint, this will undoubtedly increase the load of the electronic device, resulting in higher processing power consumption of the electronic device.

[0061] In view of this, the embodiment of the present application provides a method for identifying a touch operation. When an electronic device receives a touch operation, the operation that is obviously not a finger joint touch is filtered out by judging the preset conditions, and the finger joint algorithm is no longer called to judge whether it is a finger joint touch operation for these touch operations, and / or, when the current user scene is a preset scene, the finger joint algorithm is no longer called to judge whether it is a finger joint touch operation, thereby reducing the processing power consumption of the electronic device. It can be understood that the touch operation method provided by the embodiment of the present application can be applied to mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA) and other electronic devices with touch screens that can respond to touch operations. The embodiment of the present application does not impose any restrictions on the specific types of electronic devices.

[0062] For example, Figure 51 is a schematic diagram of the structure of an example of an electronic device 100 provided in an embodiment of the present application. Taking the electronic device 100 as a mobile phone as an example, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E (i.e., an ACC sensor), a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0063] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0064] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0065] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0066] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0067] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0068] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0069] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0070] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0071] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0072] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0073] The following describes the software system of the electronic device 100 and the coordination process between the software system and hardware.

[0074] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0075] Figure 6 1 is a system structure block diagram of an electronic device 100 of an embodiment of the present application, which includes a software architecture and a hardware layer. The software architecture adopts a layered architecture. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system includes an application (application, APP) layer, an application framework (framework, FWK) layer, a native framework (Native) layer, a hardware abstraction layer (hardware abstraction layer, HAL) and a kernel (kernel) layer from top to bottom.

[0076] The application layer can include a series of application packages. Figure 6 As shown, the application package may include applications such as Smartshot, System User Interface (SystemUI), etc. Of course, the application package may also include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. Figure 6Not shown in FIG.

[0077] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0078] like Figure 6 As shown, in an embodiment of the present application, the application framework layer (FWK) may include an input framework, which can judge the current user scenario through interaction with other services or applications (modules), determine whether it is one or more of the preset scenarios, and call back the judgment result of the current user scenario to the input reader of the input module described below. The application framework layer may also include a window manager (or window management service), which is used to manage window programs and can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, start the window, etc. Exemplarily, the input framework can obtain from the window manager whether the current state is the window startup state.

[0079] In addition, the application framework layer can also include screen state management module, content provider, view system, phone manager, resource manager, notification manager, etc. Figure 6 Not shown in the figure. The screen state management module is used to manage the state of the touch screen according to the user's operation. The state of the screen may include a screen-on state, a screen-off state, etc. In the embodiment of the present application, the screen state management module may provide the state of the screen to other modules or applications based on subscription or registration. For example, a screenshot application of the application layer may register a service with the screen state management module, and when a screenshot is required, the corresponding content is captured according to the state of the touch screen and the display screen. The content provider is used to store and obtain data and make the data accessible to the application. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text notification icon may include a view for displaying text and a view for displaying pictures. The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. The notification manager can also be a notification that appears in the top status bar of the system in the form of an icon or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0080] The Native layer may include an input module, which may include an event hub, an input reader, an input dispatcher, and a knuckle module.

[0081] Among them, the event hub is a highly scalable, distributed, time-series-based event center that can process streaming events (such as input events, which can be touch events) in real time and issue alarms and reminders.

[0082] The input reader is used to read and process input events from the event hub. In the embodiment of the present application, the input reader is used to call the finger joint module after reading the input event, and determine whether the operation corresponding to the input event is a finger joint touch operation through the finger joint related algorithm. In some embodiments, a group of input events is also called a group of touch events, which can include a press (down) event, several move (move) events and a lift (up) event.

[0083] The knuckle module is used to identify whether the operation corresponding to the input event is a knuckle touch operation and which knuckle operation it is, for example, a knuckle double-click operation or a knuckle circle operation, based on the capacitance data and the ACC data. At the same time, after obtaining the recognition result, the knuckle module can return the recognition result to the input reader. In some embodiments, the knuckle module can call the knuckle driver, initiate inter-core communication through sensors-hal, and obtain ACC data from the sensor client manager.

[0084] The input dispatcher can obtain the recognition result from the input reader and call the corresponding application for processing based on the recognition result. For example, when the recognition result is a double-click operation of a knuckle, the input dispatcher can call Smartshot to take a screenshot.

[0085] The hardware abstraction layer is used to abstract the hardware. In an embodiment of the present application, the hardware abstraction layer may include a touch screen host processing (THP) module, a sensor hardware abstraction layer (sensors-hal) and a sensor (Sensor) subsystem framework. As an algorithm module of the touch screen, the THP module is used to process the capacitance data collected by the touch chip (TP IC) to obtain the capacitance data and coordinate data of each capacitance node in the capacitance matrix. Optionally, the capacitance matrix may include m×n capacitance nodes, for example, 7×7 capacitance nodes. Optionally, the THP module can implement its functions based on the operation of the aptouch_daemon process. In some embodiments, the capacitance data of each capacitance node in the capacitance matrix processed by the THP module can be written into the following finger joint nodes, and the obtained coordinate data can be written into the following coordinate nodes.

[0086] The sensor hardware abstraction layer is used to abstract sensors.

[0087] The sensor subsystem framework may include a sensor client manager. The sensor client management module is used to implement sensor detection and identification, sensor data reading, sensor event monitoring, sensor parameter setting, and energy consumption management. The sensor subsystem is used to collect sensor data, including but not limited to ACC data. The embodiment of the present application mainly describes the relevant modules for collecting ACC data. In the embodiment of the present application, the sensor client manager can call the finger joint virtual sensor to obtain ACC data, and send ACC data to the finger joint driver through the inter-core communication mechanism.

[0088] The kernel layer is a layer between hardware and software. In the embodiment of the present application, the kernel layer may include TP driver, finger joint driver, finger joint virtual sensor and ACC driver.

[0089] The TP driver may include several TP driver nodes and a TP driver cache (TP cache for short). The TP cache is used to cache data related to the TP driver operation, such as capacitance data. The TP driver node is used to store logical files and data related to the TP driver operation. Other modules can obtain data stored in the TP driver node as needed.

[0090] Optionally, the nodes driven by TP may include but are not limited to device input nodes, coordinate nodes, finger joint nodes, and device thp nodes. It can be understood that, depending on the number of touch screens included in the electronic device, the number of each node driven by TP may be one or more. For example, when the electronic device is a single-screen device (containing only one touch screen), the number of each of the above nodes is one, and when the electronic device is a folding screen device (containing two touch screens, an inner screen and an outer screen), the number of each of the above nodes is two, one for storing logical files and data related to the inner screen, and the other for storing logical files and data related to the outer screen. The coordinate node is used to store the coordinate data corresponding to the input event (touch event) (i.e., the coordinate data processed by the THP module), and the TP driver writes the coordinate data into the device input node to generate an input event. For example, the path of the coordinate node of the single-screen device may be / dev / input_mt_wrapper, the path of the coordinate node of the inner screen of the folding screen may be / dev / input_mt_wrapper0, and the path of the coordinate node of the outer screen of the folding screen may be / dev / input_mt_wrapper1. The device input node is used to store input events and the TP driver reports the input events to the event hub. Exemplarily, the path of the device input node can be / dev / input. The finger joint node is used to store the capacitance data processed by the THP module. Exemplarily, the path of the finger joint node of a single-screen device can be / sys / touchscreen / roi_data, the path of the finger joint node of the inner screen of the folding screen can be / sys / touchscreen0 / roi_data, and the path of the finger joint node of the outer screen of the folding screen can be / sys / touchscreen1 / roi_data. The device thp node is used to store the capacitance data collected by the TP IC, and the THP module obtains the capacitance data from the device thp node for processing; Exemplarily, the path of the device thp node of a single-screen device can be / dev / thp, the path of the device thp node of the inner screen of the folding screen is / dev / thp0; the path of the device thp node of the outer screen of the folding screen is / dev / thp1.

[0091] In some embodiments, the above-mentioned finger joint module can register a monitoring event with the TP driver. When the finger joint node has capacitance data written, the TP driver can notify the finger joint module and instruct the finger joint module to obtain ACC data.

[0092] The knuckle driver may include knuckle driver nodes and other modules. The knuckle driver nodes may include knuckle file nodes and the like. The knuckle file nodes are used to store logic files and information related to the knuckle driver operation, including but not limited to ACC sensor information, ACC data preparation status, display screen status (such as folding and unfolding status, etc.), main ACC data, secondary ACC data, request ACC data, enable knuckle process, etc.

[0093] The path for storing various types of data in the finger joint file node can be set according to actual needs. For example, the path of the finger joint file node can be / sys / devices / platform / honor_sensor / , the path of ACC sensor information can be / sys / devices / platform / honor_sensor / acc_info, the path of ACC data readiness can be / sys / devices / platform / honor_sensor / fingersense_data_ready, and the path of display status can be / sys / devices / platform / honor_sensor / fingersense_expand. The path of the main ACC data can be / sys / devices / platform / honor_sensor / fingersense_latch_data, the path of the secondary ACC data can be / sys / devices / platform / honor_sensor / fingersense_latch_data2, the path of the request ACC data can be / sys / devices / platform / honor_sensor / fingersense_req_data, and the path of enabling the finger joint process can be / sys / devices / platform / honor_sensor / set_fingersense_enable.

[0094] The knuckle virtual sensor is used to instruct the ACC driver to work, drive the ACC sensor, and obtain ACC data. The ACC driver is used to store ACC data.

[0095] It can be understood that in addition to the above modules, the kernel layer can also include display drivers, camera drivers, audio drivers, etc. Figure 6 Not shown.

[0096] The hardware layer may include TP IC and ACC sensor. TP IC is used to collect the capacitance value electrical signal generated by the user touching the touch screen, and convert the capacitance value electrical signal into a digital signal to obtain capacitance value data. ACC sensor is used to collect ACC data.

[0097] In some embodiments, the above-mentioned application, input module, THP module, TP driver and finger joint module can run in the application processor AP, the Sensor client manager, the finger joint virtual sensor and the ACC driver can run in the baseband processor CP subsystem, and the AP and the CP can communicate based on the inter-core communication mechanism. Specifically, the hardware abstraction layer running on the AP can also include an inter-core communication interface, and the Sensor subsystem framework running on the CP can also include an inter-core communication interface. The inter-core communication interface is used to implement inter-core communication. Exemplarily, the inter-core communication interface can be, for example, a Qualcomm messaging interface (QMI).

[0098] By the above Figure 6 It can be seen from the described system structure that the input reader in the input module will call the knuckle module every time after reading the input event, and determine whether the operation corresponding to the input event is a touch operation of the knuckle through the knuckle-related algorithm. Therefore, in order to reduce the number of times the input reader calls the knuckle module and the number of times the knuckle-related algorithm is executed, so as to reduce the processing power consumption of the electronic device, on the first hand, when the Native layer is initialized, the embodiment of the present application will call the interface of the input framework and register the monitoring event with the input framework. If the input framework determines that the current user scene is one or more of the preset scenes, it will return the monitoring callback status to the input reader of the Native layer, so that the input reader knows that the current user scene is a preset scene. Among them, the preset scene here is a preset scene that disables the knuckle-related algorithm. Then, even if the input reader reads the input event, the knuckle module will no longer be called to execute the knuckle-related algorithm in this scene.

[0099] In the second aspect, the embodiment of the present application can allocate a new field in the input event, and the new field is used to indicate whether it is necessary to call the finger joint module to execute the finger joint related algorithm. Exemplarily, the new field can be of int type, for example, when the field value is 1, it indicates that the input reader needs to call the finger joint module to execute the finger joint related algorithm, and when the field value is 0, it indicates that the input reader does not need to call the finger joint module to execute the finger joint related algorithm.

[0100] Preferably, the new field may adopt an ABS field and a bitmap data format, and its length may be 32 bits. For example, a schematic diagram of the bitmap data format may be shown in Figure 7 , wherein the 0th bit value can be used to indicate whether it is necessary to call the finger joint module to execute the finger joint related algorithm. For example, when the 0th bit value is 1, it indicates that the finger joint module needs to be called to execute the finger joint related algorithm, and when the value is 0, it indicates that the finger joint module does not need to be called to execute the finger joint related algorithm. It can be understood that the 1st bit to the 31st bit can be used for subsequent expansion needs.

[0101] Furthermore, the input event read by the input reader is reported from the device input node to the event hub by the above-mentioned TP driver. The input event in the device input node is generated based on the coordinate data in the coordinate node, and the coordinate data in the coordinate node comes from the processing result of the THP module. Therefore, the embodiment of the present application can add a filtering algorithm in the THP module. The filtering algorithm can filter the operations that are obviously not knuckle touch by judging the preset conditions (the specific judgment process can be referred to the description of the following embodiment), and record this result in the preset parameters. Then, when the THP module writes data to the coordinate node, it can write the preset parameters at the same time, and the input event in the device input node can also carry the information of the preset parameters, that is, fill the information of the preset parameters into the new field of the input event, such as filling the 0th bit in the bitmap. After that, when the TP driver reports the input event to the event hub, it will carry the new field, and then the input reader will read the input event carrying the new field, and determine whether it is necessary to call the knuckle module to execute the knuckle-related algorithm according to the new field. In this way, the processing power consumption of the electronic device can be reduced.

[0102] Combining the above-mentioned first and second aspects, preferably, in an embodiment of the present application, if the current user scenario is a preset scenario, and / or the new field representation does not need to call the finger joint module to execute the finger joint related algorithm, the input reader does not call the finger joint module to execute the finger joint related algorithm to reduce the processing power consumption of the electronic device.

[0103] For ease of understanding, the following embodiments of the present application will be described in detail with Figure 5 and Figure 6 Taking the electronic device with the structure shown as an example, the touch operation recognition method provided in the embodiment of the present application is specifically described in combination with the accompanying drawings and application scenarios.

[0104] Based on the above Figure 6From the system structure, we can know that the finger joint module determines whether it is a touch operation of the finger joint based on the capacitance data and ACC data. The capacitance data is initially collected by the touch control chip (TP IC). Therefore, we first briefly introduce the collected capacitance data.

[0105] The TP IC may be composed of IC electrodes, and the TP IC may also be integrated in a capacitive sensor CAP, and may collect capacitance electrical signals, and convert the capacitance electrical signals into digital signals to obtain capacitance data. For example, Figure 8 A schematic diagram of the IC electrode arrangement of a mutual capacitive touch screen is shown. The mutual capacitive touch screen etches different ITO conductive circuit modules on two layers of indium-tin-oxide (ITO) conductive glass layers. The two layers of conductive circuit modules are perpendicular to each other on the display of the touch screen to form horizontal electrodes and vertical electrodes. The horizontal electrodes and the vertical electrodes can be regarded as sliders that change continuously in the X-axis and Y-axis directions. Since the horizontal electrodes and the vertical electrodes are located on different surfaces, a capacitance node will be formed where the two groups of electrodes intersect. One slider can be regarded as a driving line, and the other slider can be regarded as a detection line. When current passes through a wire in the driving line, if there is a capacitance change in the outside world, it will cause a change in the capacitance node on the other layer of wire.

[0106] Please refer to Fig. 9 , Fig. 9 A schematic diagram of the working principle of a mutual capacitive touch screen is shown as an example. The controller of the mutual capacitive touch screen periodically sends out excitation signals, also called drive signals, to the horizontal electrodes in sequence. Then, the vertical electrodes obtain response signals, so that the capacitance values ​​of all the intersection points of the horizontal electrodes and the vertical electrodes can be obtained, that is, the capacitance value of the two-dimensional plane of the entire mutual capacitive touch screen is obtained. When a finger touches the mutual capacitive touch screen, coupling between the two electrodes near the touch point is caused, which is equivalent to introducing a new capacitor for the two electrodes, thereby changing the charge size measured by the vertical electrode, so that the capacitance value between the two electrodes changes. Since the mutual capacitive touch screen usually includes a large number of capacitor nodes, when a finger touches the mutual capacitive touch screen, only the capacitance value of the capacitor node near the touch point will be changed, so the TP IC can extract the capacitance value electrical signal from the response signal according to the touch point. The capacitance value electrical signal is used to indicate the capacitance value of each capacitor node in a node matrix. Among them, the node matrix can be composed of m rows and n columns of capacitor nodes.

[0107] It should be noted that the specific values ​​of m and n can be set according to the identification method, the number of capacitance nodes of the touch screen, etc., and are not limited in the present embodiment. m and n are positive integers.

[0108] Fig.10is a flow chart of a touch operation recognition method provided in an embodiment of the present application, which can be applied to the above Figure 6 The system structure shown may specifically include:

[0109] S11. The input module of the Native layer registers the listening event with the input framework of the application framework layer.

[0110] Optionally, when the electronic device is turned on, the input module of the Native layer can call the interface of the input framework and register a listening event to the input framework to listen to whether the current user scene determined by the input framework is a preset scene. The preset scene is a preset scene in which the knuckle-related algorithms are disabled, that is, under the preset scene, the knuckle-related algorithms will no longer be called subsequently.

[0111] S12: The input framework determines whether the current user scenario is a preset scenario.

[0112] Among them, the preset scene may include but is not limited to a window startup scene, a game scene, and an accessible mode scene. In general, when an application is started or a window in an application is started, a window loading startup process will be experienced. During this process, the window content has not yet been loaded. Therefore, the embodiment of the present application can be set to a scene that disables the knuckle-related algorithm for this window startup scene. Optionally, the input framework can determine whether it is a window startup scene based on the window state recorded by the window manager. The game scene is that the electronic device is currently running a game application. To prevent the user from accidentally touching the game interface, the embodiment of the present application can set the game scene to a scene that disables the knuckle-related algorithm. Optionally, a game assistant (or game space) application can be installed in the electronic device, and the game assistant can manage the game application when the game application is running. Optionally, the input framework can query the game assistant application whether it is a game scene. The accessible mode is an operating mode formulated for special groups of users to use electronic devices. To ensure that users can use electronic devices more conveniently, the embodiment of the present application also sets the mode to a scene that disables the knuckle-related algorithm. That is to say, in a preset scenario, the electronic device does not respond to the user's touch operation using the knuckles on the touch screen.

[0113] S13. If the current user scenario is a preset scenario, the input framework returns a callback status to the input module of the Native layer.

[0114] Among them, the input framework returns the callback status to the input module of the Native layer, which informs the input module that the current user scenario is the preset scenario, and the knuckle module will no longer be called to execute knuckle-related algorithms in the future.

[0115] Optionally, the input framework may return a callback status to the input reader of the input module. Optionally, when the callback status returned by the input framework is a first value, it indicates that the current user scenario is a preset scenario.

[0116] It can be understood that if the current user scenario is not a preset scenario, the input framework does not return the callback status to the input module.

[0117] It can also be understood that after the Native layer in S11 registers the listening event with the input framework, the input framework can continue to judge the user scene and return the callback status to the input module when the user scene is the preset scene. After the input module receives the callback status, it can store the callback status for subsequent reading when it needs to judge whether to execute the knuckle algorithm.

[0118] S14. In response to the touch operation performed by the user on the touch screen, the TP IC of the hardware layer detects the capacitance electrical signal and converts the capacitance electrical signal into a digital signal to obtain capacitance data.

[0119] Optionally, the TP IC may convert the capacitance electrical signal by capacitance sampling, and the digital signal obtained after the conversion is called capacitance data.

[0120] S15. The TP IC reports the capacitance data to the TP driver of the kernel layer.

[0121] S16. The THP module of the hardware abstraction layer reads the capacitance data from the TP driver.

[0122] S17. The THP module processes the capacitance data to obtain capacitance data and coordinate data of each capacitor node.

[0123] Among them, the THP module can encapsulate, normalize, calibrate the capacitance data, and obtain the capacitance data of each capacitance node in the capacitance matrix (for example, 7×7), as well as the coordinate data of each capacitance node, and the capacitance data corresponds to the coordinate data one by one. Optionally, the coordinate data can be represented by an XOY coordinate system, and the coordinate origin of the XOY coordinate system can be the upper left vertex of the touch screen when the user faces the touch screen placed forward. Exemplarily, when placed forward, the touch screen of the electronic device faces the user, the unlock button is located on the right or upper side of the touch screen, and the charging port is located on the lower side of the touch screen.

[0124] Optionally, when the user inputs a touch operation, different touch operations correspond to different capacitance data, and the THP module may also determine whether the current event is a down event, a move event, or an up event according to the size of the capacitance data.

[0125] S18. The THP module executes the filtering algorithm and records the result in the preset parameters.

[0126] Specifically, in the filtering algorithm, the embodiment of the present application considers two filtering conditions (or preset conditions), one is the pressure signal generated when the user touches the touch screen, and the other is the validity of the capacitance data.

[0127] On the one hand, when the user performs a touch operation on the touch screen, in addition to the capacitance electrical signal, some other signals, such as Pressure signals, are also generated. Exemplarily, the Pressure signal generated by touching the touch screen can be expressed as: / dev / input / event8:EV_ABS ABS_MT_PRESSURE 00000310, where 00000310 is in hexadecimal format, which is 784 when converted to decimal. Since the Pressure signal value generated when using the knuckles for touch control is generally not too large, the THP module can divide the Pressure signal value according to the preset threshold, and filter it when the Pressure signal value is greater than the preset threshold, that is, the knuckle-related algorithm is no longer executed in the end, and the Pressure signal value is not filtered when it is not greater than the preset threshold, that is, the knuckle-related algorithm needs to be executed in the end. Optionally, the preset threshold can be 600 (decimal).

[0128] On the other hand, for the capacitance data obtained by the above S17, there may be scenarios where the capacitance is invalid. For example, if the user is performing touch sliding on the four edges of the touch screen (such as sliding from the top edge, sliding from the bottom edge, sliding from the left edge, and sliding from the right edge), this is a scenario where the capacitance is invalid. Then the THP module can filter this scenario, that is, the knuckle-related algorithm will no longer be executed in the end. In the process of analyzing scenarios where the capacitance is invalid, we can obtain the capacitance data through the adb shell tpd roidata command after turning off security-enhanced Linux (seLinux). For example, for the scenarios of sliding from the top edge, sliding from the bottom edge, sliding from the left edge, and sliding from the right edge, the obtained 7×7 capacitance data can be seen in Fig.11 As can be seen from the figure, the capacitance data of these scenarios all contain at least two rows or two columns of all 0. Therefore, the THP module can determine whether the capacitance data is valid based on the 0s in the capacitance data. If at least two rows or two columns are all 0, the capacitance data is considered invalid. If at least two rows or two columns are all 0, the capacitance data is considered valid.

[0129] Optionally, the THP module may determine whether the capacitance data of each of the above-mentioned capacitor nodes is valid through the IsCapValid(const short*) function, and return True if the capacitance data is valid, and return False if the capacitance data is invalid.

[0130] Optionally, in a scenario where filtering is performed, the THP module may set the preset parameter to a first value; in a scenario where filtering is not performed, the THP module may set the preset parameter to a second value. Exemplarily, the first value may be 0, and the second value may be 1.

[0131] If we combine the above two aspects, Fig.12 As shown, the process of the THP module executing the filtering algorithm may include steps S181-S182:

[0132] S181, determine whether the Pressure signal value is greater than a preset threshold, if it is greater than the preset threshold, filter it, if not greater than the preset threshold, execute S182.

[0133] S182, determine whether the capacitance data is valid, if not valid, filter it, if valid, do not filter it.

[0134] Optionally, the THP module can determine whether the capacitance data is valid according to the return value of the IsCapValid function. In the case of filtering, the knuckle-related algorithm is no longer executed, thereby reducing the processing power consumption of the electronic device.

[0135] S19, the THP module transmits the obtained capacitance data and coordinate data of each capacitor node and the preset parameters back to the TP driver.

[0136] S20. The TP driver generates an input event according to preset parameters and coordinate data.

[0137] The input event here includes the above-mentioned new field, and the value of the new field depends on the value of the preset parameter. For example, when the preset parameter is 0 (indicating filtering), the value of the bit 0 in the new field is 0; when the preset parameter is 1 (indicating no filtering), the value of the bit 0 in the new field is 1.

[0138] S21. The TP driver reports the input event to the input module of the Native layer, and reports the capacity data to the knuckle module in the input module.

[0139] S22. After receiving the capacitance data, the finger joint module obtains the ACC data from the Sensor client manager.

[0140] Optionally, the knuckle module can call the knuckle driver to initiate inter-core communication through sensors-hal to obtain ACC data from the Sensor Client Manager.

[0141] Furthermore, if the finger joint module initiates inter-core communication through sensors-hal to obtain ACC data, the inter-core communication may also bring some communication power consumption. However, if the subsequent input module does not need to call the finger joint module, the finger joint module does not need to obtain ACC data. Therefore, when the TP driver reports the input event to the input module earlier than the time when the capacitance data is reported to the finger joint module, and the input module determines that the finger joint module does not need to be called according to the value of the new field, the finger joint module does not need to obtain ACC data from the Sensor Client Manager to further reduce the processing power consumption of the electronic device.

[0142] Optionally, in the scenario where the above-mentioned preset parameter representation needs to be filtered, the THP module may no longer transmit the capacitance data back to the TP driver, but only transmit the coordinate data and the preset parameters back to the TP driver. Because at this time, there is no need to execute the finger joint related algorithms later, even if the capacitance data is transmitted back to the TP driver, the capacitance data is not used for processing. Therefore, the finger joint module no longer receives the capacitance data, nor does it need to obtain the ACC data, which also reduces the processing power consumption of the electronic device.

[0143] S23. The input module determines whether the knuckle module needs to be called according to the callback state and / or the value of the new field in the input event.

[0144] In this step, if the callback state represents that the current user scenario is a preset scenario, the input module does not need to call the finger joint module; or, if the value of the new field in the input event represents filtering, the input module does not need to call the finger joint module; or, if the callback state represents that the current user scenario is a preset scenario, and the value of the new field in the input event represents filtering, the input module does not need to call the finger joint module.

[0145] If the callback state indicates that the current user scenario is not the preset scenario, and the value of the new field in the input event indicates that no filtering is performed, the input module needs to call the knuckle module.

[0146] Optionally, the input module determines whether to perform filtering according to the bit value of the 0th bit in the new field in the input event. For example, filtering is performed when the bit value of the 0th bit in the new field is 0, and not filtering is performed when the bit value of the 0th bit in the new field is 1.

[0147] For example, Fig.13As shown, if the parameter field carried by the input event is obtained through script interception, it can be seen that the value of the new field ABS_MT_001 is 00000001 (hexadecimal), and the value of the 0th bit is 1, indicating that no filtering is currently performed. It can be understood that Fig.13 The first two rows of fields represent the X and Y coordinates of the touch point.

[0148] S24. When the knuckle module needs to be called, the input module calls the knuckle module to execute knuckle-related algorithms to obtain knuckle recognition results.

[0149] The input module calls the finger joint module to execute the finger joint related algorithm, that is, the finger joint module calculates according to the received capacitance data and the acquired ACC data to determine the finger joint recognition result. Optionally, the finger joint recognition result indicates whether the user's touch operation is a finger joint touch operation.

[0150] In some implementations, when the user inputs a touch operation, if the touch operation corresponding to the down event is a touch operation of the finger joints, then the subsequent move events and up events should also correspond to touch operations of the finger joints. If the touch operation corresponding to the down event is not a touch operation of the finger joints, then the subsequent move events and up events will not correspond to touch operations of the finger joints. Therefore, in the embodiment of the present application, the input module can call the finger joint module to execute the finger joint related algorithm only when receiving the down event.

[0151] In other implementations, when the knuckle module executes knuckle-related algorithms, if the knuckle recognition results are to be determined, the capacitance data corresponding to multiple touch events (including down events, move events, and up events) may be required for calculation. In this case, the TP driver is required to report the capacitance data corresponding to the multiple touch operations. The execution process is similar and will not be repeated here.

[0152] S25, the input module calls the corresponding application program for processing according to the knuckle recognition result.

[0153] That is, after the input module determines that it is a touch operation of the knuckles, the corresponding application (APP) can be called for processing, such as calling smartshot to perform screenshot processing.

[0154] S26: When there is no need to call the knuckle module, the input module waits for receiving the next input event.

[0155] That is, when there is no need to call the knuckle module, the input module will end this round of processing operations and can wait for the next input event. If the next input event is received, it can return to execute step S23.

[0156] According to the above touch operation recognition method, when the electronic device receives a touch operation input by the user, it filters out the operations that are obviously not knuckle touches by judging the filtering conditions, and no longer calls the knuckle algorithm to judge whether these touch operations are knuckle touch operations, and / or, when the current user scenario is a scenario where the use of knuckles is prohibited, the knuckle algorithm is no longer called to judge whether it is a knuckle touch operation, thereby reducing the processing power consumption of the electronic device.

[0157] Fig.14 is a flow chart of another touch operation recognition method provided in an embodiment of the present application, which can also be applied to the above Figure 6 The system structure shown may specifically include:

[0158] S31. The input reader in the input module of the Native layer registers the listening event with the input framework of the application framework layer.

[0159] S32: The input framework determines whether the current user scenario is a preset scenario.

[0160] S33. If the current user scenario is a preset scenario, the input framework returns a callback status to the input reader in the input module.

[0161] The implementation process of steps S31 to S33 may refer to S11 to S13 in the above embodiment, and the implementation principles are similar, which will not be repeated here.

[0162] S34. In response to the touch operation performed by the user on the touch screen, the TP IC of the hardware layer detects the capacitance electrical signal and converts the capacitance electrical signal into a digital signal to obtain capacitance data.

[0163] S35. The TP IC reports the capacitance data to the TP cache of the kernel layer TP driver.

[0164] S36. The TP driver writes the capacity value data in the TP cache to the device thp node.

[0165] Since the device thp node is used to store the capacitance data collected by the TP IC, the TP driver can write the capacitance data in the TP cache into the device thp node.

[0166] S37. The THP module of the hardware abstraction layer reads the capacitance data from the device thp node driven by the TP.

[0167] S38, the THP module processes the capacitance data to obtain capacitance data and coordinate data of each capacitor node.

[0168] S39. The THP module executes the filtering algorithm and records the result in the preset parameters.

[0169] Among them, the implementation process of steps S37 to S39 can refer to S16 to S18 in the above embodiment, and the implementation principles are similar, which will not be repeated here.

[0170] S40 , the THP module writes the obtained capacitance data of each capacitor node into the finger joint node driven by the TP.

[0171] S41, the THP module writes the obtained coordinate data and preset parameters into the coordinate node driven by the TP.

[0172] Among them, the THP module writes the capacitance data into the finger joint node, so that the finger joint module can monitor the write operation through the monitoring mechanism to obtain the capacitance data. The THP module writes the coordinate data and preset parameters into the coordinate node, so that the coordinate data can be written into the device input node to generate an input event.

[0173] S42. The finger joint module in the input module monitors the write operation of the finger joint node and obtains the capacity value data.

[0174] S43. The knuckle module obtains ACC data from the Sensor Client Manager.

[0175] In one achievable approach, Fig.15 As shown, the step of S43 may include the following S431 to S435:

[0176] S431, the knuckle module writes an acquisition request for ACC data to the knuckle driver.

[0177] Optionally, the knuckle module may write an acquisition request for ACC data to the knuckle file node of the knuckle driver.

[0178] S432, the knuckle driver initiates inter-core communication to the Sensor Client Manager through sensors-hal.

[0179] S433. The Sensor client manager calls the knuckle virtual sensor to obtain ACC data.

[0180] S434. The Sensor Client Manager sends the ACC data to the finger joint driver through inter-core communication.

[0181] S435, the knuckle driver reports the ACC data to the knuckle module.

[0182] The process in which the knuckle driver obtains ACC data from the sensor client manager through the inter-core communication mechanism can be understood as the communication process between the AP and the CP. Optionally, the obtained ACC data can be 128 groups of ACC data.

[0183] S44. The TP driver writes the coordinate data and preset parameters in the coordinate node into the device input node, generating an input event.

[0184] S45. The TP driver reports the input event to the event hub of the Native layer input module.

[0185] S46. The event hub distributes the input event to the input reader.

[0186] S47, the input reader determines whether the knuckle module needs to be called according to the callback state and / or the value of the new field in the input event.

[0187] The implementation process of step S47 may refer to S23 in the above embodiment, and the implementation principle is similar and will not be repeated here.

[0188] S48. When the knuckle module needs to be called, the input reader calls the knuckle module to execute knuckle-related algorithms to obtain knuckle recognition results.

[0189] S49, the input reader sends the knuckle recognition result to the input dispatcher.

[0190] S50. The input dispatcher calls a corresponding application program for processing according to the knuckle recognition result.

[0191] S51. When there is no need to call the knuckle module, the input reader waits for receiving the next input event.

[0192] Among them, the implementation process of steps S48 to S51 can refer to S24 to S26 in the above embodiment, and the implementation principles are similar, which will not be repeated here.

[0193] According to the above touch operation recognition method, when the electronic device receives a touch operation input by the user, it filters out the operations that are obviously not knuckle touches by judging the filtering conditions, and no longer calls the knuckle algorithm to judge whether these touch operations are knuckle touch operations, and / or, when the current user scenario is a scenario where the use of knuckles is prohibited, the knuckle algorithm is no longer called to judge whether it is a knuckle touch operation, thereby reducing the processing power consumption of the electronic device.

[0194] The above describes in detail an example of a method for identifying a touch operation provided in an embodiment of the present application. It is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of the present application.

[0195] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0196] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0197] The electronic device provided in this embodiment is used to execute the above touch operation recognition method, and thus can achieve the same effect as the above implementation method.

[0198] In the case of an integrated unit, the electronic device may further include a processing module, a storage module and a communication module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device to execute stored program codes and data, etc. The communication module may be used to support the electronic device to communicate with other devices.

[0199] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor (DSP) and a microprocessor, and so on. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.

[0200] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 5 Device of the structure shown.

[0201] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the touch operation recognition method of any of the above embodiments.

[0202] The embodiment of the present application further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the touch operation recognition method in the above-mentioned embodiment.

[0203] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the touch operation recognition method in the above-mentioned method embodiments.

[0204] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

[0205] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0206] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of 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 device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0207] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0208] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0209] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment 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, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0210] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for identifying a touch operation, the method being executed by an electronic device, the electronic device comprising a touch screen, characterized in that: The method comprises: In response to a first touch operation performed by a user on the touch screen, acquiring corresponding touch data; When the current user scenario is a preset scenario, and / or the first parameter indicates that a first processing operation does not need to be performed, the first processing operation is not performed, the first processing operation includes identifying whether the first touch operation is a finger joint touch operation based on the touch data, the preset scenario includes a preset scenario that does not respond to finger joint touch operations, and the first parameter is a parameter determined according to the validity of the touch data and the pressure data corresponding to the first touch operation; When the current user scenario is not a preset scenario and the first parameter indicates that a first processing operation needs to be performed, performing the first processing operation; The current user scenario is a preset scenario including: Registering a monitoring event with an input framework of an application framework layer through an input module of a local framework layer in the electronic device; When the input framework determines that the current user scenario is the preset scenario, the input framework returns a callback status to the input module, where the callback status indicates that the current user scenario is the preset scenario.

2. The method according to claim 1, characterized in that The preset scene is a scene in which the application window is in the startup process, a game scene, or an accessibility mode scene.

3. The method according to claim 1 or 2, characterized in that: After acquiring the corresponding touch data, the method further includes: The touch data is processed to obtain capacitance data of each capacitance node on the touch screen corresponding to the first touch operation, wherein the validity of the touch data includes the validity of the capacitance data of each capacitance node.

4. The method according to claim 3, characterized in that The first parameter indicating that the first processing operation does not need to be performed includes: when the first parameter is a first value, it indicates that the first processing operation does not need to be performed.

5. The method according to claim 4, characterized in that The method further comprises: If the validity of the capacitance data of each capacitor node is invalid, and / or the pressure data is greater than a preset threshold, the first parameter is set to the first value.

6. The method according to claim 5, characterized in that The validity of the capacitance data of each capacitor node being invalid includes: values ​​of at least n rows or n columns of the capacitance data of each capacitor node are 0, and n is a positive integer.

7. The method according to claim 6, characterized in that Said n=2.

8. The method according to claim 3, characterized in that The first parameter indicating that the first processing operation needs to be performed includes: when the first parameter is a second value, it indicates that the first processing operation needs to be performed.

9. The method according to claim 8, characterized in that The method further comprises: If the validity of the capacitance data of each capacitor node is valid and the pressure data is not greater than a preset threshold, the first parameter is set to the second value.

10. The method according to any one of claims 3 to 9, characterized in that The electronic device includes a touch screen main algorithm THP module of a hardware abstraction layer and a touch screen TP driver of a core layer, and the touch data is processed to obtain capacitance data of each capacitor node on the touch screen corresponding to the first touch operation, including: The THP module processes the touch data to obtain capacitance data of each capacitor node; The THP module writes the capacitance data of each capacitor node into the TP driver.

11. The method according to claim 10, characterized in that After obtaining the capacitance data of each capacitor node, the method further includes: The THP module determines a second parameter according to the validity of the capacitance data of each capacitor node and the pressure data corresponding to the first touch operation, where the second parameter is used to determine the value of the first parameter; The THP module writes the second parameter and the coordinate data of each capacitor node into the TP driver, where the coordinate data of each capacitor node is obtained by the THP module processing the touch data; The TP driver generates an input event according to the second parameter and the coordinate data of each capacitor node, and the input event carries the first parameter.

12. The method according to claim 11, characterized in that In the case where the second parameter indicates that the first processing operation does not need to be performed, the method further includes: The THP module does not write the capacitance data of each capacitor node into the TP driver.

13. The method according to claim 11, characterized in that The method further comprises: The TP driver reports the capacitance data of each capacitor node and the input event to the input module of the local framework layer; The input module determines whether to execute the first processing operation according to the callback status returned by the input framework and / or the first parameter carried by the input event.

14. The method according to claim 13, characterized in that In the case where it is determined to perform the first processing operation, the method further includes: The input module obtains sensor data; The input module identifies whether the first touch operation is a touch operation of a finger joint based on the capacitance data of each capacitor node and the sensor data.

15. The method according to any one of claims 1 to 14, characterized in that The first parameter adopts a bitmap data format, and the 0th bit value in the bitmap data format represents whether the first processing operation needs to be performed.

16. The method according to claim 15, characterized in that The length of the bitmap data format is 32 bits.

17. An electronic device, characterized in that: include: one or more processors; one or more memories; The memory stores one or more programs, and when the one or more programs are executed by the processor, the electronic device executes the method according to any one of claims 1 to 16.

18. 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 processor is caused to perform the method according to any one of claims 1 to 16.

Citation Information

Patent Citations

  • Bio-identification module processing method and apparatus, and mobile terminal

    CN107808151A