Abnormal event processing method, electronic equipment and storage medium
By detecting and blocking interrupt requests from the touch chip, switching to interrupt protection mode, and restoring after power-down, the problem of invalid interrupt requests caused by touch chip malfunctions is solved, improving the stability of electronic devices and user experience.
Patent Information
- Application Number
- CN202310843612.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-10
- Publication Date
- 2025-01-10
AI Technical Summary
When the touch chip of an electronic device malfunctions, it can cause a large number of invalid interrupt requests, resulting in abnormal resource consumption or even system crashes, thus affecting the user experience.
By detecting the frequency and time interval of interrupt requests from the touch chip, it can determine whether an interrupt exception has occurred. If an exception occurs, it can block interrupt requests, disable interrupt response, switch to interrupt protection state, force power-down recovery, and notify the system process to no longer respond to interrupt requests.
This reduces the impact of touch chip interruption events on electronic devices, lowers the risk of system crashes, and improves the user experience.
Smart Images

Figure CN119292808A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular to an abnormal event processing method, an electronic device, and a storage medium. Background Art
[0002] In order to facilitate user operation, electronic devices usually have a touch function. For example, if the electronic device is a mobile phone, the mobile phone is usually equipped with a touch screen. The mobile phone recognizes the user's gestures, fingerprints, etc. on the touch screen to implement corresponding functions or services, such as turning on or off the phone.
[0003] The touch function of an electronic device can be realized by a touch panel integrated circuit (TPIC). The touch chip can detect the user's operation on the touch panel and notify the electronic device of the user operation in the form of an interrupt request. In this way, the electronic device can respond to the user operation and provide the user with corresponding functions or services.
[0004] However, in some cases, the touch chip of the electronic device may be abnormal, and the electronic device may receive a large number of invalid interrupts. In this case, the electronic device may occupy resources abnormally or even freeze, which seriously affects the user experience. Summary of the invention
[0005] The embodiments of the present application provide an abnormal event processing method, an electronic device, and a storage medium, which are used to reduce the impact of invalid interrupts on the electronic device and improve user experience when an abnormality occurs in a touch chip of the electronic device.
[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, a method for handling an abnormal event is provided, the method comprising: an electronic device detects a first interrupt request from a touch chip. In response to the first interrupt request, the electronic device can determine whether an interrupt abnormal event has occurred in the touch chip. The interrupt abnormal event indicates that the frequency of the interrupt request of the touch chip is greater than a preset frequency threshold. If an interrupt abnormal event occurs in the touch chip, the electronic device shields the interrupt request of the touch chip and notifies the system process of the user layer through the first notification information, so that the system process no longer instructs to start an interrupt response for responding to the interrupt message of the touch chip.
[0008] In this way, when the electronic device receives a large number of interrupt requests from the touch chip within a period of time, for example, when the average receiving time interval of the electronic device receiving a preset number of interrupt requests is less than the preset time length, the electronic device can shield the interrupt request of the touch chip and turn off the interrupt response of the interrupt request. This can reduce the impact of the abnormal interrupt event of the touch chip on the electronic device and reduce the occurrence of electronic device crashes. At the same time, during the process of the abnormal interrupt event of the touch chip, the electronic device will not turn on the interrupt response of the interrupt request again, thereby minimizing the impact of the abnormal interrupt event.
[0009] In a possible implementation of the first aspect, when the working state of the touch chip is a screen-on state or a gesture screen-off state, the electronic device determines whether an abnormal interrupt event occurs in the touch chip. The gesture screen-off state is a state in which the electronic device turns off the screen but responds to a touch gesture operation.
[0010] In this implementation, in the screen-on state and the gesture-off screen state, the electronic device will enable detection of abnormal interruption events to reduce the impact of abnormal interruption events of the touch chip on the user's operation of the mobile phone.
[0011] In another possible implementation manner of the first aspect, if the working state of the touch chip is a screen-on state, the electronic device determines whether an abnormal interrupt event occurs in the touch chip when the first interrupt request is an invalid interrupt.
[0012] In this implementation, the user frequently operates the mobile phone in the bright screen state, and the electronic device can confirm whether the first interrupt message currently received is an invalid interrupt. If the first interrupt message is an invalid interrupt, the electronic device then detects whether an abnormal interrupt event occurs in the touch chip. This can reduce the misjudgment of abnormal interrupt events in the bright screen state.
[0013] In another possible implementation manner of the first aspect, if an abnormal interrupt event occurs in the touch control chip, the electronic device turns off the touch control chip.
[0014] In this implementation, the electronic device can also control the touch chip to power off and shut down the touch chip, so that the touch chip can recover better in the event of an abnormality.
[0015] In another possible implementation of the first aspect, the working state of the touch chip is any one of a screen-on state, a gesture-off screen state, a power-off state, and an interrupt protection state. The power-off state is a state in which the electronic device is screen-off and does not respond to touch gesture operations.
[0016] In another possible implementation manner of the first aspect, if an abnormal interrupt event occurs in the touch control chip, the working state of the touch control chip is an interrupt protection state.
[0017] In this implementation, the interrupt protection state may be a temporary abnormal working state added by the electronic device when an abnormal interrupt event occurs in the touch chip. When the electronic device detects that an abnormal interrupt event occurs in the touch chip, the electronic device may switch the working state to the interrupt protection state. In the interrupt protection state, the electronic device shields the interrupt request received from the touch chip and forces the touch chip to power off. The electronic device may respond to the abnormal interrupt event that occurs in the touch chip through the interrupt protection state.
[0018] In another possible implementation of the first aspect, the electronic device receives an abnormal recovery indication, which is used to instruct the touch chip to recover from the interrupt abnormal event. In response to the abnormal recovery indication, the electronic device obtains the current working state of the touch chip, and if the current working state of the touch chip is an interrupt protection state, controls the touch chip to recover to the previous working state of the interrupt protection state.
[0019] In this implementation, the touch chip of the electronic device will recover from the interruption abnormality event. Since the interruption abnormality state is a temporary abnormal working state, the electronic device can control the touch driving touch chip to switch to the working state before the interruption protection state.
[0020] In another possible implementation manner of the first aspect, if the current working state of the touch chip is not the interruption protection state, the electronic device restores the touch chip to the current working state of the touch chip after the touch chip is powered off.
[0021] In this implementation, if the current working state of the touch control chip is not the interrupt protection state, the electronic device controls the touch control driver to switch the touch control chip to the current working state after restarting.
[0022] In another possible implementation of the first aspect, the electronic device may further send second notification information to the system process, where the second notification information is used to notify the system process to instruct to enable an interrupt response.
[0023] In this implementation, after the touch chip returns to normal, the electronic device can also notify the system process through the second notification information. The system process can instruct to start the interrupt response so that the electronic device can normally respond to the user's touch operation.
[0024] In a second aspect, the present application provides an electronic device, comprising: a touch chip, a memory and one or more processors, wherein the memory is coupled to the processor. The touch chip is used to receive a touch signal. The memory stores a computer program code, and the computer program code includes computer instructions. When the computer instructions are executed by the processor, the electronic device performs the following steps: detecting a first interrupt request from the touch chip; in response to the first interrupt request, determining whether an interrupt abnormality event occurs in the touch chip; wherein the interrupt abnormality event indicates that an interrupt request of the touch chip is abnormal; if an interrupt abnormality event occurs in the touch chip, a first notification message is sent to the system process of the electronic device, and the interrupt request of the touch chip is shielded; wherein the first notification message is used to notify the system process not to indicate to start an interrupt response, and the interrupt response is used to respond to the interrupt request of the touch chip.
[0025] In a possible implementation of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device further performs the following steps: when the working state of the touch chip is the screen-on state or the gesture-off state, determine whether an abnormal interrupt event occurs in the touch chip; wherein the gesture-off state is a state in which the electronic device turns off the screen but responds to touch gesture operations.
[0026] In another possible implementation of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device further performs the following steps: if the working state of the touch chip is the screen-on state, then when the first interrupt request is an invalid interrupt, determine whether an abnormal interrupt event occurs in the touch chip.
[0027] In another possible implementation manner of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device further executes the following steps: if an abnormal interrupt event occurs in the touch control chip, shut down the touch control chip.
[0028] In another possible implementation of the second aspect, the working state of the touch chip is any one of the screen-on state, the screen-off state, the power-off state and the interrupt protection state; wherein the power-off state is a state in which the electronic device screen is off and does not respond to touch gesture operations.
[0029] In another possible implementation manner of the second aspect, if an abnormal interrupt event occurs in the touch control chip, the working state of the touch control chip is an interrupt protection state.
[0030] In another possible implementation of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device also performs the following steps: receiving an abnormal recovery indication; wherein the abnormal recovery indication is used to instruct the touch chip to recover from an interrupt abnormal event; in response to the abnormal recovery indication, obtaining the current working state of the touch chip; if the current working state of the touch chip is an interrupt protection state, controlling the touch chip to recover to the previous working state of the interrupt protection state.
[0031] In another possible implementation of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device further performs the following steps: if the current working state of the touch chip is not the interrupt protection state, the touch chip is restored to the current working state of the touch chip after the touch chip is powered off.
[0032] In another possible implementation of the second aspect, when the above-mentioned computer instructions are executed by the processor, the electronic device further performs the following steps: sending a second notification message to the system process; wherein the second notification message is used to notify the system process to indicate to enable an interrupt response.
[0033] In a third aspect, the present application provides a computer-readable storage medium, including computer instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation thereof.
[0034] In a fourth aspect, the present application provides a computer program product including program instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect and any possible implementation thereof. For example, the computer may be the electronic device described above.
[0035] In a fifth aspect, the present application provides a chip system, which is applied to the above-mentioned electronic device. The chip system includes an interface circuit and a processor. The interface circuit and the processor are interconnected by a line. The interface circuit is used to receive a signal from a memory and send a signal to the processor, and the signal includes a computer instruction stored in the memory. When the processor executes the computer instruction, the electronic device executes the method described in the above-mentioned first aspect and any possible implementation thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of the structure of an example of a display screen provided in an embodiment of the present application;
[0037] Figure 2 A schematic diagram of an example of switching between different working states provided in an embodiment of the present application;
[0038] Figure 3A schematic diagram of another example of switching between different working states provided in an embodiment of the present application;
[0039] Figure 4 A hardware structure block diagram of a mobile phone 100, an example of an electronic device provided in an embodiment of the present application;
[0040] Figure 5 A software structure block diagram of a mobile phone 100, an example of an electronic device provided in an embodiment of the present application;
[0041] Figure 6 A flowchart of an example of an abnormal event processing method provided in an embodiment of the present application;
[0042] Figure 7 A flowchart of an example of abnormal interrupt event detection provided in an embodiment of the present application;
[0043] Figure 8 A flowchart of an example of a power-off process provided in an embodiment of the present application;
[0044] Fig. 9 A flowchart of another example of an interrupt abnormal event detection provided by an embodiment of the present application;
[0045] Fig.10 A flowchart of another example of a method for handling an abnormal event provided in an embodiment of the present application;
[0046] Fig.11 A flowchart of an example of controlling a touch control chip to switch to a target state provided in an embodiment of the present application;
[0047] Fig.12 A flowchart of an example of a method for handling abnormal events in a bright screen state provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to provide users with a better user experience, the display screen of an electronic device usually has a touch function. The electronic device can respond to the user's touch operation such as clicking or sliding on the display screen to implement corresponding functions or services.
[0049] like Figure 1 As shown, the display screen may include a protection layer, a touch panel and a display panel.
[0050] The protective layer is used to protect the structure of the display screen.
[0051] The touch panel may also be referred to as a touch sensor, a touch layer, etc. The touch panel may include a sensing module and a touch chip. The sensing module of the touch panel may sense / respond to a touch operation and transmit a touch signal of the touch operation to the touch chip. The touch chip may analyze the touch signal transmitted by the sensing module, determine the touch point position of the touch operation, and report the touch point position to the processor of the electronic device (such as an application processor) so that the processor of the electronic device responds to the touch operation.
[0052] The display panel can also be called a display layer. The display panel can be used to display the interface of the electronic device. The display panel and the touch panel can be used together to make the display screen have both display function and touch function. The touch panel can be located above the display panel.
[0053] The touch chip may be a control module of the touch panel. The touch chip may work in different working states, and control the touch panel to work in corresponding working states. The touch chip may have multiple different working states. For example, the working state of the touch chip may be a screen-on state or a power-off state. When the working state of the touch chip is a screen-on state, the screen of the electronic device is on. When the working state of the touch chip is a power-off state, the screen of the electronic device is off and does not respond to gesture operations. The power-off state may also be referred to as a power-off screen-off state.
[0054] With the popularization of technologies such as Always On Display (AOD) and under-screen fingerprint, electronic devices must respond to user gestures even when the screen is off. In this case, the multiple working states of the touch chip may also include a gesture screen-off state. The gesture screen-off state may refer to the display panel of the electronic device not being lit, the electronic device being in the screen-off state, but the touch panel can work, for example, the sensing module and the touch chip in the touch panel are both working / powered on, and can sense touch operations and report the touch point position. In other words, when the working state of the touch chip is the gesture screen-off state, the electronic device turns off the screen but responds to touch operations, such as touch operations.
[0055] Electronic devices can switch between different working states to control the touch chip to work in different scenarios. For example, an electronic device can switch between a screen-on state, a gesture-off state, and a power-off state.
[0056] like Figure 2 As shown, in the screen-on state, the electronic device turns on the screen and responds to the user's touch operation. The electronic device can switch from the screen-on state to the power-off state. For example, when the electronic device receives the user's screen-off operation, if the gesture function is not turned on, the electronic device can switch the working state of the touch chip from the screen-on state to the power-off state. In the power-off state, the electronic device turns off the screen and does not respond to any touch operation of the user.
[0057] The electronic device can also switch from the screen-on state to the gesture screen-off state. For example, when the electronic device receives the screen-off operation from the user, and the gesture function is turned on, the electronic device can switch the working state of the touch chip from the screen-on state to the gesture screen-off state. In the gesture screen-off state, the electronic device turns off the screen and responds to the user's touch operation.
[0058] It is understandable that the gesture function of the electronic device can be turned on or off according to the user's instructions. For example, the electronic device may provide a setting option for the gesture function. The user can choose to turn on or off the gesture function in the setting option of the gesture function. The electronic device turns on or off the gesture function in response to the user's instruction to turn on or off the gesture function. When the gesture function is turned on, the electronic device will respond to the user's touch operation even in the off-screen state.
[0059] In the gesture screen-off state, the electronic device turns off the screen but responds to the user's touch operation. The electronic device can switch from the gesture screen-off state to the screen-on state. For example, the electronic device receives a user's touch operation in the gesture screen-off state. For example, the touch operation can be an "L"-shaped touch gesture. If the electronic device receives an "L"-shaped touch operation in the gesture screen-off state, the electronic device switches to the screen-on state in response to the touch operation.
[0060] In the power-off state, the electronic device turns off the screen and does not respond to the user's touch operation. The electronic device can switch from the power-off state to the screen-on state. For example, in the power-off state, the electronic device receives a user operation of pressing a screen-on button. In response to the user operation, the electronic device switches to the screen-on state.
[0061] It is understandable that the screen of an electronic device is turned on or off in terms of the display panel of the display screen. Since the display screen of the electronic device includes a display panel and a touch panel, the electronic device can control the display panel to perform a display function and the touch panel to perform a touch function respectively, without affecting each other. Therefore, even in the case of the screen being turned off, such as when the electronic device controls the display panel not to work / turns off, the electronic device can respond to the user's touch operation by controlling the touch panel.
[0062] After detecting a user operation (such as a touch operation), the touch chip of the electronic device can notify the processor of the electronic device through an interrupt request. The interrupt request can be triggered by the low level of the interrupt pin of the touch chip. For example, the interrupt pin of the touch chip is pulled up to a high level using the working voltage VDD. After responding to the user operation, the level of the interrupt pin can be set to a low level to trigger an interrupt request, and the electronic device is notified of the user operation in the form of an interrupt request. At the same time, the touch chip can also save the touch point coordinates corresponding to the user operation in the memory, so that the electronic device responds to the interrupt request of the touch chip to obtain the touch point coordinates corresponding to the user operation, determine the touch event corresponding to the user operation, and process the response touch event.
[0063] The interrupt pin of the touch chip will also drop to a low level. Although no touch operation occurs at this time, the interrupt pin falling to a low level will also trigger the touch chip to report an interrupt request. Since the interrupt request in this scenario is not triggered in response to user operations, it can be called an invalid interrupt request. In the case of abnormal power failure of the touch chip, if it is not handled in time, the interrupt pin of the touch chip will be at a low level for a long time, and the touch chip will report a large number of invalid interrupt requests, and the processor of the electronic device will receive a large number of invalid interrupt requests. However, for the processor of the electronic device, after receiving the interrupt request reported by the touch chip, it will still occupy processing resources to analyze and process the interrupt request reported by the touch chip, which will cause the processing resources of the electronic device to be abnormally occupied, and may even cause the electronic device to crash, seriously affecting the user experience.
[0064] In view of this, in the method provided in the embodiment of the present application, the electronic device detects a first interrupt request from the touch chip, and in response to the first interrupt request, the electronic device can determine whether an interrupt abnormality event has occurred in the touch chip. The interrupt abnormality event indicates that an interrupt request of the touch chip is abnormal, such as receiving a large number of interrupt requests (such as invalid interrupt requests) from the touch chip in a short period of time. If an interrupt abnormality event occurs in the touch chip, the electronic device shields the interrupt request of the touch chip and notifies the system process of the user layer of the electronic device through the first notification information, so that the system process no longer indicates to start an interrupt response for responding to the interrupt message of the touch chip.
[0065] In this way, when an electronic device receives a large number of interrupt requests from a touch chip in a short period of time, the electronic device can shield the interrupt request of the touch chip, turn off the interrupt response of the interrupt request, and no longer respond to the interrupt request of the touch chip. This can reduce the impact of the abnormal interrupt event of the touch chip on the electronic device and reduce the occurrence of electronic device crashes. At the same time, during the process of the abnormal interrupt event of the touch chip, the electronic device will not turn on the interrupt response of the interrupt request again, thereby minimizing the impact of the abnormal interrupt event.
[0066] It is understandable that the system process of the electronic device can be a service process of the touch chip at the user layer. The system process can control the touch chip, such as instructing to turn on the interrupt response. If the electronic device turns on the interrupt response again after turning off the interrupt response, the electronic device may receive a large number of invalid interrupt requests from the touch chip again, affecting the performance of the electronic device. In the event of an abnormal interrupt event in the touch chip of the electronic device, the electronic device notifies the system process through the first notification information, instructing the upper-layer system process to no longer instruct to turn on the interrupt response, thereby reducing the possibility that the abnormal interrupt event in the touch chip will affect the electronic device again.
[0067] Here, an abnormal interruption event can be determined in a variety of ways. For example, when the frequency of interruption requests of the touch chip received by the electronic device is greater than a preset frequency threshold, it can be considered that an abnormal interruption event has occurred in the touch chip. For another example, when the average receiving time interval of a preset number of interruption requests received by the electronic device is less than a preset duration, it can be considered that an abnormal interruption event has occurred in the touch chip. The preset frequency threshold, preset number, and preset duration can be set according to the actual application scenario, and the specific data is not limited here.
[0068] In some implementations, the electronic device may also indicate that the touch chip is in a powered-on state or a normal working state through a second state. In the second state of the touch chip, the system process may instruct to enable an interrupt response to an interrupt message. For example, after the touch chip abnormally loses power, if it is powered on again, the system process may instruct the touch driver to enable an interrupt response to an interrupt message to receive an interrupt request from the touch chip.
[0069] In order to handle abnormal interrupt events occurring in the touch chip, in some implementations, in addition to the screen-on state, gesture-off state, and power-off state, the electronic device also adds an interrupt protection state.
[0070] The interrupt protection state can be a temporary abnormal working state added by the electronic device when an abnormal interrupt event occurs in the touch chip. When the electronic device detects that an abnormal interrupt event occurs in the touch chip, the electronic device can switch the working state to the interrupt protection state. In the interrupt protection state, the electronic device shields the interrupt request received from the touch chip and forces the touch chip to power off. The interrupt protection state is similar to the power-off state. However, unlike the power-off state, in the interrupt protection state, the electronic device can turn on the screen but will not respond to the user's touch operation. In this way, the abnormality of the touch chip can be handled without affecting the operation of the display panel of the electronic device.
[0071] like Figure 3As shown, the touch chip of the electronic device can switch between the screen-on state, the gesture-off state, the power-off state and the interrupt protection state.
[0072] In the screen-on state, the display panel of the electronic device turns on the screen and responds to the user's touch operation. If the electronic device detects an abnormal interruption event when the screen is on, it can switch from the screen-on state to the interruption protection state. At this time, the electronic device can turn on the screen but not respond to any touch operation of the user. Alternatively, when the electronic device receives the user's screen-off operation when the screen is on, if the gesture function is not turned on, the electronic device can switch the working state of the touch chip from the screen-on state to the interruption protection state. At this time, the electronic device turns off the screen and does not respond to any touch operation of the user.
[0073] In the gesture screen-off state, the electronic device turns off the screen and responds to the user's touch operation. If the electronic device detects an abnormal interruption event in the gesture screen-off state, it can switch from the gesture screen-off state to the interruption protection state. At this time, the electronic device turns off the screen and does not respond to any touch operation of the user.
[0074] The electronic device can also switch from the interrupt protection state to the screen-on state or the power-off state. For example, when the electronic device receives a user operation of pressing a switch button, it can switch from the interrupt protection state to the screen-on state or the power-off state. For another example, when the electronic device receives an abnormal recovery notification, it can switch from the interrupt protection state to the screen-on state or the power-off state.
[0075] The process of switching between the screen-on state, gesture-off state and power-off state of an electronic device can be seen in the above Figure 2 The description content will not be repeated here.
[0076] For example, the electronic device described in the embodiments of the present application may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) / virtual reality (VR) device, a media player, a wearable device, etc. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.
[0077] In the embodiment of the present application, the electronic device is a mobile phone 100 as an example, and the hardware structure of the electronic device is introduced through the mobile phone 100. Figure 4As shown, the mobile phone 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.
[0078] Among them, the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (neural-network processing unit, NPU), a driver processor, etc. Among them, different processing units can be independent devices or integrated in one or more processors. The processor 110 can be the nerve center and command center of the mobile phone 100. The processor 110 can generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.
[0079] 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.
[0080] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0081] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 may execute the instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.
[0082] 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.), a configuration file of the motor 191, etc. The data storage area may store data created during the use of the mobile phone 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.
[0083] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also power the mobile phone 100 through the power management module 141.
[0084] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. In some embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0085] The wireless communication function of the mobile phone 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor. In some embodiments, the antenna 1 of the mobile phone 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.
[0086] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0087] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the mobile phone 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
[0088] The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the same device as at least some modules of the processor 110.
[0089] The wireless communication module 160 can provide wireless communication solutions for application in the mobile phone 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0090] The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 may also receive a signal to be sent from the processor 110, modulate the signal, amplify the signal, and convert it into an electromagnetic wave for radiation via the antenna 2.
[0091] The mobile phone 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.
[0092] The sensor module 180 may include sensors such as a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a Hall sensor, a touch sensor, an ambient light sensor, and a bone conduction sensor. The mobile phone 100 may collect various data through the sensor module 180 .
[0093] The mobile phone 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.
[0094] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel and a touch 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. A touch panel is also called a "touch sensor". The touch panel can be set on the display screen 194, and the touch panel and the display panel form a touch screen, also called a "touch screen". The touch panel is used to detect touch operations acting on or near it. The display panel can pass the detected touch operation to the application processor to determine the type of touch event. The display screen 194 can provide visual output related to the touch operation. In other embodiments, the touch panel can also be set on the surface of the display screen 194, which is different from the position of the display panel.
[0095] The mobile phone 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor. The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture a still image or a video. In some embodiments, the mobile phone 100 may include one or more cameras 193.
[0096] The button 190 includes a power button, a volume button, etc. The button 190 may be a mechanical button. It may also be a touch button. The motor 191 may generate a vibration prompt. The motor 191 may be used for an incoming call vibration prompt or for touch vibration feedback. The indicator 192 may be an indicator light, which may be used to indicate the charging status, the change in power, or may be used to indicate messages, missed calls, notifications, etc.
[0097] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the mobile phone 100 by inserting the SIM card interface 195 or pulling the SIM card interface 195 out. The mobile phone 100 can support one or more SIM card interfaces. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0098] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments, the electronic device may also include more or fewer modules than those provided in the above embodiments, and different interface connection methods in the above embodiments may be used between the modules, or a combination of multiple interface connection methods. The hardware structure of the electronic device provided in the embodiments of the present application can also refer to the hardware structure of the mobile phone 100 as shown in the figure. The methods in the following embodiments can all be implemented in an electronic device having the above hardware structure.
[0099] The software system of electronic devices can adopt layered architecture, event-driven architecture, micro-kernel architecture, micro-service architecture or cloud architecture. Figure 5 As shown, in the embodiment of the present application, the electronic device is the above-mentioned mobile phone 100, and the software system of the electronic device adopts the layered architecture of the Android system as an example to illustrate the software structure of the electronic device.
[0100] Figure 5 1 is a software structure diagram of an example mobile phone 100 of an electronic device in an embodiment of the present application. 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 may include an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, a hardware abstraction layer (HAL) and a kernel layer.
[0101] The application layer may include a series of application packages. For example, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications, and the present application embodiment does not impose any restrictions on this.
[0102] The application framework layer provides an application programming interface (API) and a programming framework for the application programs of the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a power manager, a resource manager, and a notification manager, etc., and the embodiments of the present application do not impose any restrictions on this.
[0103] The Android runtime consists of a core library and a virtual machine. The Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0104] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0105] The HAL layer encapsulates the Linux kernel driver, provides an interface to the upper layer, and shields the implementation details of the underlying hardware. For example, the HAL layer may include display HAL, touch HAL, audio HAL, etc.
[0106] The kernel layer is the layer between hardware and software. The kernel layer includes drivers and system programs. Drivers include at least display drivers, Bluetooth drivers, audio drivers, touch drivers, etc.
[0107] The following is an example of the workflow of the software and hardware of the mobile phone 100 in combination with the touch screen lighting scenario.
[0108] When the mobile phone 100 is in the screen-off state, the touch panel of the mobile phone 100 receives a touch operation from the user, such as a touch operation of double-clicking the screen. The touch chip of the touch panel sends an interrupt request to the kernel layer of the mobile phone 100 to notify the kernel layer of the preset touch operation. The kernel layer processes the touch operation into an original input event (including touch coordinates, timestamp of the touch operation, and other information). The information of the original input event is stored in the kernel layer. The application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the original input event. Taking the touch operation corresponding to the screen-on event in the screen-off scenario as an example, the control corresponding to the touch operation can be a power manager. The power manager calls the display driver of the kernel layer, and the display driver controls the display screen to light up.
[0109] In the following embodiments, the electronic device is as follows Figure 4 Taking the mobile phone shown as an example, the method provided by the embodiment of the present application is introduced. In the embodiment of the present application, the display screen of the mobile phone includes a touch panel and a display panel. The touch panel includes a touch chip, and the touch chip is a control module of the touch panel. The core layer of the mobile phone includes a touch driver. The mobile phone can interact with the touch chip through the touch driver to control the touch chip.
[0110] like Figure 6 As shown, the method provided in the embodiment of the present application may include the following steps.
[0111] S601: The touch driver of the mobile phone receives a first interrupt request from the touch chip.
[0112] The touch chip of the mobile phone can send a first interrupt request to the application processor of the mobile phone through the interrupt pin. For example, when the touch chip receives a touch operation from the user, the interrupt pin can be set to a low level, and the first interrupt request is triggered by the low level. The touch driver of the application processor receives the first interrupt request from the touch chip. At this time, the touch chip of the mobile phone can be in any one of the following states: the screen-on state, the gesture-off state, and the interrupt protection state.
[0113] For example, the touch control driver includes an interrupt thread (irq_thread) that receives a first interrupt request from the touch control chip.
[0114] Here, the interrupt pin of the touch chip can be connected to the receiving pin of the application processor. The touch driver of the application processor can directly receive the first interrupt request sent by the touch chip through the interrupt pin through the receiving pin. Alternatively, the mobile phone may also include an interrupt controller. The interrupt controller is connected to the touch chip and the application processor respectively. The interrupt controller receives the first interrupt request of the touch chip and forwards the first interrupt request to the application processor.
[0115] S602: The touch control driver of the mobile phone responds to the first interrupt request and determines whether an abnormal interrupt event occurs in the touch control chip.
[0116] The touch control driver of the mobile phone responds to the first interrupt request and detects whether an abnormal interrupt event occurs in the touch control chip. For example, in response to the first interrupt request, the touch control driver calls an interrupt thread to determine whether an abnormal interrupt event occurs in the touch control chip.
[0117] An interruption abnormality event indicates a large number of interruption requests received in a short period of time, or it can be understood that the number of terminal requests received in a short period of time is relatively large and greater than a preset number threshold; or it can be understood that the sending state of the interruption request is abnormal (such as the single sending duration, sending interval and / or sending number) is abnormal and does not meet the requirements. This application does not limit the naming of interruption abnormality events, and it can also be replaced by an interruption storm or other names.
[0118] Exemplarily, when the average receiving time interval of the received interrupt requests is less than the preset time length, a large number of interrupt requests received in a short time are determined. Specifically, the touch driver of the mobile phone can count the total time length for receiving a preset number of interrupt requests, and then calculate the ratio of the total time length to the preset number to obtain the average time interval for the touch driver to receive interrupt requests. If the average time interval is less than the preset time length, it means that the touch driver receives a large number of interrupt requests from the touch chip in a short time, and it can be considered that an abnormal interrupt event may have occurred in the touch chip. If the average time interval is greater than or equal to the preset time length, the touch driver has not received a large number of interrupt requests from the touch chip in a short time, and it can be considered that no abnormal interrupt event has occurred in the touch chip.
[0119] The mobile phone will respond to the user's touch operation in both the screen-on state and the gesture-off state of the touch chip. In some implementations, the touch driver of the mobile phone responds to the first interrupt request, and determines whether an interrupt abnormal event occurs in the touch chip when the working state of the touch chip is the screen-on state or the gesture-off state. In this way, in the screen-on state and the gesture-off state, the mobile phone will start the detection of interrupt abnormal events to reduce the impact of the touch chip's interrupt abnormal events on the user's operation of the mobile phone.
[0120] When the screen is on, users use their phones more frequently. The touch driver of the phone may receive a large number of touch messages from the touch chip when the screen is on. In order to reduce the false detection of abnormal interrupt events when the screen is on, in some implementations, after the touch driver of the phone receives the first interrupt request from the touch chip, it can first determine whether the current working state of the touch chip is the screen on state. Figure 7 As shown, the method provided by the implementation may include the following steps:
[0121] S701: The touch driver of the mobile phone receives a first interrupt request from the touch chip.
[0122] For this step, please refer to the description of S601 above, which will not be repeated here.
[0123] S702, the touch driver of the mobile phone determines whether the current working state of the touch chip is the screen-on state.
[0124] The touch driver of the mobile phone can obtain the working state of the touch chip in response to the first interrupt request. For example, the working state of the touch chip can be represented by a working state identifier. The working state identifier can be a first identifier, a second identifier, a third identifier, or a fourth identifier. The first identifier indicates a screen-on state, the second identifier can indicate a gesture screen-off state, the third identifier indicates a power-off state, and the fourth identifier indicates an interrupt abnormal state. The touch driver can obtain the working state identifier of the touch chip. If the working state identifier is the first identifier, it can be considered that the current working state of the touch chip is a screen-on state.
[0125] If the working state of the touch chip is the screen-on state, the touch driver of the mobile phone executes S703.
[0126] If the working state of the touch chip is not the screen-on state, the touch driver of the mobile phone executes S704.
[0127] S703: The touch driver of the mobile phone determines whether the first interrupt request is an invalid interrupt.
[0128] If the working state of the touch chip is the screen-on state, the mobile phone turns on the screen and responds to the user's touch operation. In the screen-on state, the touch driver may receive a large number of interrupt requests from the touch chip. In order to reduce the misjudgment of abnormal interrupt events, the touch driver can further determine whether the first interrupt request received is an invalid interrupt after confirming that the current working state of the touch chip is the screen-on state.
[0129] For example, the touch driver of the mobile phone can read the touch data (such as the above-mentioned touch point coordinates) corresponding to the first interrupt request. If the touch data is not in a preset data format (such as the touch data is not in a two-dimensional array format), or the touch data is a preset invalid value (such as "0, 0"), the first interrupt request can be considered to be an invalid interrupt.
[0130] If the first interrupt request is an invalid interrupt, the touch driver of the mobile phone executes S704.
[0131] If the first interrupt request is not an invalid interrupt, the touch driver of the mobile phone reports the touch event of the first interrupt request to the user layer. For example, the first interrupt request may be a touch operation of the user to open a video application. After confirming that the first interrupt request is not an invalid interrupt, the touch driver of the mobile phone may report the touch event of opening the video application to the user layer. After receiving the touch event, the user layer of the mobile phone may start the video application.
[0132] S704, the touch driver of the mobile phone detects whether an abnormal interrupt event occurs in the touch chip.
[0133] The touch driver of the mobile phone detects whether an abnormal interrupt event occurs in the touch chip. The abnormal interrupt event means that the average receiving time interval of the preset number of interrupt requests received by the touch driver is less than the preset time length.
[0134] Here, the preset number and the preset duration can be set according to the actual application scenario or requirements. For example, the preset number can be set to a value such as 100 or 200. The preset duration can be set to a value such as 2.5 milliseconds, 2.7 milliseconds, etc.
[0135] It is understandable that the touch driver of the mobile phone can perform different processing for interrupt requests received in the screen-on state and interrupt requests received in the gesture-off screen state.
[0136] When the screen is on, users operate their phones at a high frequency, and the touch chip of the phone reports to the application processor of the phone (i.e., sends an interrupt request) at a maximum frequency of 360 Hz. The average reporting cycle of the touch chip is short, up to 2.7 milliseconds. The application processor will receive a large number of interrupt messages in a short period of time, but this situation is likely caused by the user's frequent operation of the phone. Therefore, in the screen-on state, the touch driver in the application processor can also confirm whether the first interrupt message currently received is an invalid interrupt. If the first interrupt message is an invalid interrupt, the touch driver detects whether an abnormal interrupt event has occurred in the touch chip. This can reduce the misjudgment of abnormal interrupt events in the screen-on state.
[0137] In the gesture screen-off state, the user operates the phone less frequently, and the touch chip does not report frequently to the application processor under normal circumstances. If the application processor receives a large number of interrupt messages in a short period of time, it may be caused by an abnormality in the touch chip. Therefore, in the gesture screen-off state, the touch driver in the application processor can detect whether an abnormal interrupt event has occurred in the touch chip when receiving an interrupt request (such as the first interrupt request).
[0138] In the power-off state, the touch driver of the mobile phone does not respond to any interrupt request from the touch chip. In the interrupt abnormal state, the touch driver of the mobile phone has detected the interrupt abnormal event of the touch chip. In this case, the touch driver will no longer detect the interrupt abnormal event of the touch chip again.
[0139] S603: If an abnormal interrupt event occurs in the touch chip, the touch driver of the mobile phone sends a first notification message to the system process of the mobile phone and shields the interrupt request of the touch chip.
[0140] The first notification information is used to notify the system process not to instruct the touch driver to enable interrupt response. When an abnormal interrupt event occurs in the touch chip of the mobile phone, the touch driver of the mobile phone notifies the system process through the first notification information, instructing the system process not to instruct the touch driver to enable interrupt response.
[0141] When confirming that an abnormal interrupt event occurs in the touch chip, the touch driver of the mobile phone will not only send the first notification information to the system process, but also shield the interrupt request of the touch chip, that is, turn off the interrupt response of the interrupt request. For example, the mobile phone has an interrupt enable flag for controlling whether the application processor responds to the interrupt request of the touch chip. The touch driver of the application processor can set the interrupt enable flag to 0. When the interrupt enable flag is 0, the application processor no longer responds to the interrupt request of the touch chip.
[0142] In this way, when an abnormal interrupt event occurs in the touch chip, the touch driver of the mobile phone no longer responds to the interrupt request from the touch chip, which can reduce the impact of the abnormal interrupt event of the touch chip on other functions of the mobile phone besides the touch function.
[0143] S604, the system process of the mobile phone enters a suspended state.
[0144] The system process can be a service process at the system level in the user layer of the mobile phone. For example, the system process can be a daemon process. The system process can communicate with the touch driver and control the touch chip through the touch driver. For example, the system process can instruct the touch driver to enable interrupt response. Or, the system process can instruct the touch driver to update the driver program (or firmware upgrade). The touch driver can control the touch chip according to the instructions of the system process.
[0145] After the system process obtains the first notification information of the touch driver, it can enter a suspended state. The suspended state can be a state in which no instruction is sent to the touch driver. After the system process of the mobile phone obtains the first notification information of the touch driver, the system process no longer sends a control instruction to the touch driver to instruct the touch driver to start an interrupt response.
[0146] In this way, when an abnormal interrupt event occurs in the touch chip, the upper system process of the mobile phone will not instruct the touch driver to enable interrupt response again. In this way, the mobile phone can keep the interrupt response disabled during the abnormal interrupt event of the touch chip.
[0147] In the embodiment of the present application, if an abnormal interrupt event occurs in the touch chip, the touch driver of the mobile phone will receive a large number of invalid interrupt requests. In order to make the touch chip recover better in the abnormality, in some implementations, if an abnormal interrupt event occurs in the touch chip, the embodiment of the present application also includes the following steps:
[0148] S605, the touch driver of the mobile phone turns off the touch chip.
[0149] If an abnormal interrupt event occurs in the touch chip of the mobile phone, the touch driver of the mobile phone can force the touch chip to power off. For example, the touch driver of the mobile phone can call a power-off thread to control the touch chip to power off through the called power-off thread.
[0150] Here, in order to reduce the situation where the power-off operation of the touch chip blocks other processes running in the mobile phone, the touch driver of the mobile phone can asynchronously process the power-off of the touch chip. For example, the touch driver of the mobile phone can add a power-off command for powering off the touch chip in the asynchronously processed command queue. The touch driver can call the power-off thread to process the power-off command in the task queue to power off the touch chip.
[0151] Asynchronous processing of powering off the touch chip can be understood as the interrupt thread that responds to the first interrupt request and the power-off thread that executes the power-off of the touch chip are different threads. The detection of interrupt abnormal events runs in the interrupt thread, and the interrupt thread usually does not run more time-consuming operations. When the touch driver detects an interrupt abnormal event, the touch driver calls the power-off thread through the command queue to asynchronously execute the power-off operation of the touch chip, thereby realizing asynchronous processing of the touch chip power-off. In this way, it is possible to reduce the situation where the processing of interrupt abnormal events blocks other threads in the mobile phone system and reduce the impact of interrupt abnormal events on mobile phone performance.
[0152] The following example introduces the power-off process of the touch driver asynchronously after detecting an abnormal interrupt event. Figure 8 As shown, the power-off process executed after an abnormal interrupt event occurs may include the following steps:
[0153] S801, the touch driver of the mobile phone determines whether the touch chip is powered off.
[0154] The touch driver of the mobile phone can call the power-off thread to execute the power-off process of the touch chip. The touch driver can first determine whether the touch chip is currently powered off. For example, the touch driver of the mobile phone can obtain the working state of the touch chip and determine whether the working state of the touch chip is a power-off state.
[0155] If the touch chip has been powered off, the touch driver of the mobile phone can execute S805.
[0156] If the touch chip is not powered off, the touch driver of the mobile phone can execute S802.
[0157] S802, the touch driver of the mobile phone determines whether the touch chip is in the screen-off state of the mobile phone.
[0158] If the touch chip is not powered off, the touch chip of the mobile phone further determines whether the working state of the touch chip is the screen-off state of the mobile phone.
[0159] If the touch chip is in the gesture screen-off state, the touch driver of the mobile phone can execute S803.
[0160] If the working state of the touch chip is not the gesture screen-off state, the touch driver of the mobile phone can execute S804.
[0161] S803, the touch driver of the mobile phone wakes up the touch chip.
[0162] If the working state of the touch chip is the gesture screen-off state, the touch driver of the mobile phone can first wake up the touch chip to put the mobile phone in the screen-on state.
[0163] S804: The touch driver of the mobile phone controls the touch chip to power off.
[0164] When the touch chip is in the screen-on state, the touch driver of the mobile phone controls the touch chip to power off.
[0165] S805, the touch driver of the mobile phone switches the working state of the touch chip to the interrupt protection state.
[0166] After controlling the touch chip to power off, the touch driver of the mobile phone can switch the working state of the touch chip to an interrupt protection state.
[0167] In the example, when the touch driver controls the touch chip to power off, it can first switch the touch chip to the screen-on state, and then switch from the screen-on state to the interrupt protection state. The touch driver can interact with multiple other modules (such as the power manager, display panel, etc.). In order to improve the stability of the touch chip's working state switching, the touch driver can switch according to a fixed switching process when switching the touch chip's working state. The switching process can be found in Figure 3 The solid arrow in the middle indicates the direction. It can be seen that the screen-on state points to the interrupt protection state. Therefore, when the touch chip is in a working state other than the screen-on state, the touch driver of the mobile phone can first switch the working state of the touch chip to the screen-on state, and then switch to the interrupt protection state. This can improve the stability of the touch chip working state switching.
[0168] It is understandable that when the touch chip is working normally, the touch driver of the mobile phone can also power off the touch chip through the above-mentioned power-off process. After the touch driver controls the touch chip to power off, the touch driver can switch the working state of the touch chip to the power-off state. Therefore, when the touch driver controls the touch chip to power off, if the working state of the touch chip is the gesture screen-off state, the touch driver first executes the screen-on process of the touch chip, and then executes the power-off process of the touch chip to switch the working state to the interrupt protection state or the power-off state. If the working state of the touch chip is the screen-on state, the touch driver directly executes the power-off process to switch the working state to the interrupt protection state or the power-off state.
[0169] In the above S602, the touch driver of the mobile phone determines whether an abnormal interruption event occurs in the touch chip. Here, an example is used to introduce the detection process of abnormal interruption events provided by the embodiment of the present application. In the example, the preset number is 200 and the preset duration is 2.5 milliseconds. Fig. 9 As shown, the process of interrupting abnormal event detection may include the following steps:
[0170] S901, the touch driver of the mobile phone determines whether the current working state is an interrupt protection state.
[0171] The touch driver of the mobile phone detects whether an abnormal interrupt event occurs in the touch chip, and can first determine whether the current working state of the touch chip is an interrupt protection state.
[0172] If the current working state of the touch chip is the interrupt protection state, it means that an interrupt abnormal event has occurred in the touch chip, and the touch chip has not yet recovered from the interrupt abnormal event. In this case, the touch driver may no longer detect whether an interrupt abnormal event has occurred in the touch chip. The touch driver may end the current judgment process of the interrupt abnormal event.
[0173] If the current working state of the touch control chip is not the interrupt protection state, the touch control driver may continue to execute S902.
[0174] S902: The touch driver of the mobile phone determines whether the number of interrupt requests is 0.
[0175] The number of interrupt requests may be recorded in the mobile phone. The number of interrupt requests is used to count the interrupt requests received from the touch chip. The touch driver of the mobile phone may obtain the number of interrupt requests and determine whether the number of interrupt requests is 0.
[0176] If the interrupt request quantity is 0, the touch chip of the mobile phone executes S903.
[0177] If the interrupt request quantity is not 0, the touch chip of the mobile phone executes S904.
[0178] S903: The touch driver of the mobile phone records the current first timestamp.
[0179] If the number of interrupt requests is 0, it means that the current is a new statistical cycle of the number of interrupt requests. The touch driver of the mobile phone can record the current time as the first timestamp.
[0180] S904: The touch driver of the mobile phone increases the number of interrupt requests by 1.
[0181] The touch control driver of the mobile phone receives the first interrupt request. The first interrupt request is an interrupt request from the touch control chip. The touch control driver can count the first interrupt request. The touch control driver increases the count of the number of interrupt requests, so that the number of interrupt requests increases by 1.
[0182] S905: The touch driver of the mobile phone determines whether the number of interrupt requests reaches 200.
[0183] The touch driver of the mobile phone compares the current number of interrupt requests with the preset number 200 to determine whether the current number of interrupt requests has reached 200.
[0184] If the current number of interrupt requests reaches 200, the touch control driver of the mobile phone executes S906. For example, if the current number of interrupt requests is equal to 200, the touch control driver of the mobile phone continues to execute S906.
[0185] If the current number of interrupt requests does not reach 200, it means that the current number of interrupt requests has not reached the maximum count value, and it cannot be determined that an abnormal interrupt event has occurred in the touch chip. In this case, the touch driver of the mobile phone can end the current judgment process of the abnormal interrupt event. For example, if the current number of interrupt requests is 50, which is less than 200, the touch chip of the mobile phone ends the judgment process of the abnormal interrupt event.
[0186] S906: The touch driver of the mobile phone records the current second timestamp.
[0187] If the current number of interrupt requests reaches 200, it indicates that the current number of interrupt requests reaches the maximum value of the count. The touch chip of the mobile phone records the current time as the second timestamp.
[0188] S907: The touch driver of the mobile phone calculates an average reception time interval of the interrupt request.
[0189] The touch control driver of the mobile phone can calculate the duration of receiving 200 interrupt requests according to the first timestamp and the second timestamp. The touch control driver calculates the ratio of the duration to 200 to obtain the average receiving time interval of each interrupt request.
[0190] S908: The touch driver of the mobile phone determines whether the average receiving time interval of the interrupt request is less than 2.5 milliseconds.
[0191] The average receiving time interval can reflect the frequency of the touch chip receiving interrupt messages. If the average receiving time interval is too small, it means that the frequency of interrupt messages from the touch chip is too high, and an abnormal interrupt event may occur. The touch driver of the mobile phone can compare the calculated average receiving time interval of the interrupt message with the preset time length of 2.5 milliseconds to determine whether the average receiving time interval is less than 2.5 milliseconds.
[0192] If the average receiving time interval of the interrupt request is less than 2.5 milliseconds, it can be considered that an abnormal interrupt event has occurred in the touch chip, and the touch driver of the mobile phone can execute S909.
[0193] If the average receiving time interval of the interrupt request is greater than or equal to 2.5 milliseconds, it can be considered that no abnormal interrupt event occurs to the touch chip. The touch driver of the mobile phone then executes S910.
[0194] S909: The touch driver of the mobile phone records the current working state and switches the working state to an interrupt protection state.
[0195] If the touch driver of the mobile phone determines that an abnormal interrupt event has occurred in the touch chip, it can record the current working state and switch the working state to an interrupt protection state.
[0196] Here, the touch driver of the mobile phone switches the working state to the interrupt protection state. Figure 8 The operation process shown will not be repeated here.
[0197] S910, the touch driver of the mobile phone clears the number of interrupt requests.
[0198] After completing the detection of the interrupt exception event, the touch driver of the mobile phone may reset the number of interrupt requests to 0, so as to count the number of interrupt requests again in a new round of interrupt exception event detection.
[0199] In the embodiment of the present application, if the touch driver of the mobile phone confirms that an abnormal interrupt event occurs in the touch chip, the touch driver can turn off the interrupt response and switch the working state of the touch chip to an interrupt protection state. In some implementations, the touch chip of the mobile phone will recover from the abnormal interrupt event. In order to restore the touch function of the touch chip as soon as possible, the touch driver of the mobile phone can control the touch driver to switch the touch chip to a normal working state, such as controlling the touch chip to return to the screen-on state, the gesture-off state, or the power-off state. Fig.10 As shown, the method provided in the embodiment of the present application may also include the following steps:
[0200] S1001, the touch driver of the mobile phone receives an abnormal recovery instruction.
[0201] The touch driver of a mobile phone can interact with multiple other modules of the mobile phone (such as the power manager, display panel, etc.). After an abnormal interrupt event occurs in the touch chip, the touch chip of the mobile phone may receive an abnormal recovery instruction sent by other modules. The abnormal recovery instruction is used to instruct the touch chip to recover from the abnormal interrupt event. For example, the abnormal interrupt event of the mobile phone is caused by an abnormal power failure of the touch chip. The touch driver of the mobile phone can receive an abnormal recovery instruction sent by the display panel, indicating that the power supply of the touch chip has been restored.
[0202] S1002, in response to the abnormal recovery indication, the touch driver of the mobile phone determines whether the current working state of the touch chip is an interrupt abnormal state.
[0203] After the touch driver of the mobile phone receives the abnormal recovery instruction from other modules, it can first determine whether the current working state of the touch chip is an interrupt abnormal state. Since the interrupt abnormal state is a temporary abnormal working state, the touch chip of the mobile phone can perform different processing for the interrupt abnormal state and other working states other than the interrupt abnormal state. Therefore, after receiving the abnormal recovery instruction, the touch driver of the mobile phone can determine whether the current working state of the touch chip is an interrupt abnormal state.
[0204] S1003: If the current working state of the touch control chip is the interrupt protection state, the touch control chip controls the touch control chip to recover to the previous working state of the interrupt protection state.
[0205] If the current working state of the touch chip is the interrupt protection state, it means that an abnormality occurred in the touch chip before. Therefore, the touch driver can control the touch chip to recover to the previous working state of the interrupt protection state, that is, to control the touch chip to recover to the working state before the abnormal interrupt event occurred.
[0206] S1004: If the current working state of the touch chip is not the interrupt protection state, the touch driver restores the touch chip to the current working state of the touch chip after the touch chip is powered off.
[0207] If the current working state of the touch chip is not the interrupt protection state, it is possible that during the abnormal interrupt event of the touch chip, the mobile phone changed the working state of the touch chip in response to the user operation. In this case, the touch driver of the mobile phone can restore the touch chip to the current working state after the touch chip is powered off.
[0208] For example, in response to the user pressing the power off button, the mobile phone switches the working state of the touch chip to the power off state. At this time, the current working state of the touch chip is the power off state. In this case, the touch chip has been powered off, and the touch driver of the mobile phone directly switches the working state of the touch chip to the power off state.
[0209] S1005, the touch chip of the mobile phone sends a second notification message to the system process of the mobile phone.
[0210] In addition to controlling the touch chip to resume working state, the touch driver of the mobile phone can also send a second notification message to the upper layer system process of the mobile phone. The second notification message is used to notify the system process to instruct to start the interrupt response. For example, the touch driver of the mobile phone can send the second notification message to the daemon process of the mobile phone.
[0211] After obtaining the second notification information, the system process of the mobile phone can exit the suspended state. Further, the system process of the mobile phone can instruct the touch driver to start the interrupt response. Alternatively, the system process can instruct the touch driver to update the driver program.
[0212] In the embodiment of the present application, after receiving the abnormal recovery indication, the touch chip of the mobile phone can control the touch chip to recover to the last working state of the interrupt protection state or the current working state. For the convenience of description, the working state after the touch chip is recovered is referred to as the target state. The target state can be the screen-on state, the gesture screen-off state, and the power-off state.
[0213] Here, if the target state is the power-off state, the touch driver of the mobile phone can execute the above Figure 8 The operation process shown will not be repeated here.
[0214] The following uses the target states of the screen-on state and the gesture-off screen state as examples to introduce the process in which the touch driver of the mobile phone responds to the abnormal recovery indication and controls the touch chip to switch to the target state.
[0215] Take the target state as the screen-on state as an example. Fig.11 As shown in (1), the touch driver of the mobile phone can first control the touch chip to power off and execute the power-off process of the touch chip (for example, execute as follows Figure 8 The touch driver then controls the touch chip to power on and switches the working state of the touch chip to the screen-on state. In this example, if the target state is the screen-on state, the touch driver of the mobile phone can restart the touch chip to switch the screen-on state.
[0216] Take the target state as the gesture power-off state as an example. Fig.11 As shown in (2), the touch driver of the mobile phone can first control the touch chip to power off and execute the power-off process of the touch chip (for example, execute as follows Figure 8 The touch driver then controls the touch chip to power on and restart the touch chip. Furthermore, the touch driver of the mobile phone controls the touch chip to sleep and realizes the switching of the gesture screen off state.
[0217] In the example, if the target state is the screen-on state, the touch driver controls the touch chip to restart, and can control the touch chip to power on again through the screen-on process based on the touch chip power-off process. If the target state is the gesture screen-off state, the touch driver controls the touch chip to sleep, and can control the touch chip to switch to the gesture screen-off state through the sleep process based on the touch chip power-off process and power-on process.
[0218] The method provided in the embodiment of the present application protects against abnormal situations that occur in the touch chip by detecting abnormal interrupt events, and adopts different recovery schemes for different target states. The following takes the abnormal situation that occurs in the touch chip in the bright screen state as an example to introduce the method provided in the embodiment of the present application. Fig.12 As shown, the touch control driver of the mobile phone includes an interrupt module, a communication module and an asynchronous command module.
[0219] S1201: An interrupt module receives a first interrupt request from a touch control chip.
[0220] The interrupt module of the touch driver can call the interrupt thread to receive the first interrupt request of the touch chip. The interrupt thread receives the first interrupt request of the touch chip, which can refer to the description of S601 above and will not be repeated here.
[0221] S1202: In response to the first interrupt request, the interrupt module determines whether the first interrupt request is an invalid interrupt.
[0222] The interrupt thread of the interrupt module determines whether the first interrupt request is an invalid interrupt. The interrupt thread determines whether the first interrupt request is an invalid interrupt. Please refer to the description of S703 above, which will not be repeated here.
[0223] S1203: If the first interrupt request is an invalid interrupt, the interrupt module detects whether an abnormal interrupt event occurs in the touch chip.
[0224] If the first interrupt request is an invalid interrupt, the interrupt thread of the interrupt module detects whether an interrupt abnormality event occurs in the touch chip. The interrupt thread detects an interrupt abnormality event, which can be seen in the above Fig. 9 The description content will not be repeated here.
[0225] S1204: If an abnormal interrupt event is detected, the interrupt module instructs the asynchronous command module to control the touch chip to power off.
[0226] The interrupt module can instruct the asynchronous command module to control the touch chip to power off through the interrupt thread.
[0227] S1205: The asynchronous command module sends a first notification message to the upper-layer system process.
[0228] For the asynchronous command module sending the first notification information to the upper-level system process, please refer to the description of S603 and S604 above, which will not be repeated here.
[0229] S1206, the asynchronous command module controls the touch chip to power off, switches the working state of the touch chip to the interrupt protection state, and disables the interrupt response.
[0230] This step can be seen above Figure 8 The operation process shown will not be repeated here.
[0231] S1207 , the display panel notifies the touch control driver that power supply has been restored through an abnormal recovery instruction.
[0232] When the power supply has been restored, the display panel of the mobile phone can indicate that the power supply of the touch chip has been restored through an abnormal recovery instruction.
[0233] S1208: The communication module of the touch control driver instructs the asynchronous command module to restart the touch control chip.
[0234] When determining that the touch chip is in the interrupt protection state, the communication module can instruct the asynchronous command module to restart the touch chip so that the touch chip is restored to the last working state of the interrupt protection state, that is, the touch chip is restored to the screen-on state.
[0235] S1209: The asynchronous command module restarts the touch chip and switches the working state of the touch chip to the screen-on state.
[0236] This step can be seen above Fig.11 The process shown in (1) will not be repeated here.
[0237] S1210: The asynchronous command module sends a second notification message to the upper-layer system process.
[0238] For this step, please refer to the description of S1005 above, which will not be repeated here.
[0239] S1211, the system process instructs the interrupt module to start interrupt response.
[0240] After the system process obtains the second notification information, it can instruct the interrupt module to enable the interrupt response. The interrupt module enables the interrupt response and can restore the response of the touch chip to the interrupt message. The touch chip restores the touch function in the bright screen state and responds to the user's touch operation. For example, the touch driver of the application processor can set the interrupt enable flag to 1. When the interrupt enable flag is 1, the application processor no longer responds to the interrupt request of the touch chip.
[0241] In some other embodiments of the present application, an electronic device is provided, including: a touch chip, a memory and at least one processor. The memory is coupled to the processor. The touch chip is used to receive touch signals. The memory stores computer program code, which includes computer instructions. When the computer instructions are executed by the processor, the electronic device can execute each function or step in the above method embodiment. Of course, the electronic device can also include other hardware structures such as other antennas for receiving signals. For example, the electronic device also includes hardware structures such as sensors and display screens. The structure of the electronic device can refer to Figure 4 The structure of the mobile phone 100 is shown.
[0242] The embodiment of the present application also provides a chip system, which is applied to an electronic device. The chip system includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected by lines. For example, the interface circuit can be used to receive signals from other devices (such as memory). For another example, the interface circuit can be used to send signals to other devices (such as processors). Exemplarily, the interface circuit can read instructions stored in the memory and send the instructions to the processor. When the instruction is executed by the processor, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.
[0243] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step in the above-mentioned method embodiment.
[0244] The present application also provides a computer program product, which, when executed on a computer, enables the computer to perform various functions or steps in the above method embodiment. For example, the computer may be the above electronic device.
[0245] Through the description of the above implementation methods, technical personnel in the relevant field can clearly 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.
[0246] 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 the modules or units is only a logical function division. 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.
[0247] 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.
[0248] 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.
[0249] 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 method described in each embodiment 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.
[0250] 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 changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for handling abnormal events, characterized in that: Applied to an electronic device, the electronic device includes a touch control chip; the method includes: Detecting a first interrupt request from the touch control chip; In response to the first interrupt request, determining whether an abnormal interrupt event occurs in the touch control chip; wherein the abnormal interrupt event indicates that an abnormal interrupt request occurs in the touch control chip; If an abnormal interrupt event occurs in the touch chip, a first notification message is sent to the system process of the electronic device, and the interrupt request of the touch chip is shielded; wherein the first notification message is used to notify the system process not to instruct to enable an interrupt response, and the interrupt response is used to respond to the interrupt request of the touch chip.
2. The method according to claim 1, characterized in that The determining whether an abnormal interrupt event occurs in the touch control chip includes: When the working state of the touch chip is a screen-on state or a screen-off state using a gesture, determine whether an abnormal interrupt event occurs to the touch chip; wherein the screen-off state using a gesture is a state in which the electronic device is screen-off but responds to a touch gesture operation.
3. The method according to claim 2, characterized in that When the working state of the touch chip is a screen-on state or a gesture-off state, determining whether an abnormal interrupt event occurs in the touch chip includes: If the working state of the touch control chip is the screen-on state, then in the case that the first interrupt request is an invalid interrupt, it is determined whether an abnormal interrupt event occurs in the touch control chip.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: If an abnormal interrupt event occurs to the touch control chip, the touch control chip is turned off.
5. The method according to any one of claims 1 to 4, characterized in that The working state of the touch chip is any one of a screen-on state, a gesture-off state, a power-off state, and an interrupt protection state; The power-off state is a state in which the screen of the electronic device is off and does not respond to touch gesture operations.
6. The method according to claim 5, characterized in that If an abnormal interrupt event occurs in the touch control chip, the working state of the touch control chip is the interrupt protection state.
7. The method according to claim 6, characterized in that The method further comprises: Receiving an abnormal recovery indication; wherein the abnormal recovery indication is used to instruct the touch control chip to recover from an abnormal interrupt event; In response to the abnormal recovery indication, obtaining the current working state of the touch control chip; If the current working state of the touch control chip is the interrupt protection state, the touch control chip is controlled to recover to the previous working state of the interrupt protection state.
8. The method according to claim 7, characterized in that The method further comprises: If the current working state of the touch control chip is not the interrupt protection state, the touch control chip is restored to the current working state of the touch control chip after the touch control chip is powered off.
9. The method according to claim 7 or 8, characterized in that: The method further comprises: Sending second notification information to the system process; wherein the second notification information is used to notify the system process to instruct to enable interrupt response.
10. An electronic device, characterized in that: include: A touch chip, a memory and at least one processor; the touch chip, the memory and the processor are coupled; wherein the touch chip is used to receive touch signals; the memory stores computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 9.
Citation Information
Cited By
Anomaly event processing method, electronic device, and storage medium
EP4671993A1
Anomaly event processing method, electronic device, and storage medium
WO2025011093A1