Application recovery method and device and electronic equipment

By detecting transparency and recovering during user operations, the freeze problem caused by transparent windows is solved, the user experience is improved, and the automatic solution to the freeze screen is achieved.

CN119025199APending Publication Date: 2024-11-26HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310611578.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-26
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect the freezing phenomenon caused by transparent windows and recover in time, resulting in extremely poor user experience. It is necessary to develop a method that can accurately detect abnormal window failures and automatically recover.

Method used

By obtaining relevant information when the application interface switches or loads, the transparency of the window is detected. If the transparency is lower than the minimum visible value, it is judged as an abnormal window and resume operations during user operation, including clicking or sliding operations, automatic or Recover by reminding the user.

Benefits of technology

Accurate detection and timely recovery of transparent window faults is achieved, avoiding long-term interface jamming, improving user experience, reducing the need for forced restarts, and reducing user anxiety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025199A_ABST
    Figure CN119025199A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an application recovery method and device and electronic device.By means of the method and device or the electronic device, when it is detected that interface switching happens to a first application or the first application is loaded, first information corresponding to the first application is obtained; when the first window is determined to be an abnormal window according to the first information, the first application is recovered in response to a first operation of a user on the first window, and the first window is a window related to the first application. By means of the method and device or the electronic equipment, the frozen screen phenomenon caused by abnormal window faults can be accurately detected, application recovery can be carried out in time, the situation that an interface is stuck for a long time and cannot be operated is avoided, a user does not need to adopt operations such as forced restarting to solve the frozen screen problem, the user can be prevented from generating frozen screen anxiety, and the user experience is improved. And the use experience of the user is obviously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of application recovery, and more specifically, to a method, device, and electronic device for application recovery. Background Art

[0002] Current users have increasingly higher requirements for the basic experience of terminal products. When terminal products experience screen freezing (for example, page freezing, inability to scroll, etc.), especially when the screen freezing problem is caused by abnormally transparent application windows, it brings an extremely poor experience to users. After encountering this problem, many users are unable to recover automatically for a long time and can only force a restart to recover.

[0003] Therefore, accurately detecting the frozen screen phenomenon caused by the transparent window and restoring it in time is a problem that needs to be solved. Summary of the invention

[0004] The present application provides a method, device and electronic device for application recovery. Through this method, device or electronic device, the frozen screen phenomenon caused by abnormal window failure can be accurately detected, and the application can be restored in time, thereby avoiding the situation where the interface is stuck and cannot be operated for a long time. The user does not need to use forced restart and other operations to solve the frozen screen problem, which can avoid the user's anxiety about the frozen screen, thereby significantly improving the user's usage experience.

[0005] In a first aspect, a method for application recovery is provided, the method comprising: when it is detected that an interface switch of a first application occurs, or the first application is loaded, obtaining first information corresponding to the first application; when it is determined that a first window is an abnormal window based on the first information, in response to a first operation of the user on the first window, restoring the first application, wherein the first window is a window related to the first application.

[0006] Optionally, the first information includes one or more of an application package name of the first application, a window name of the first window, a view of the first window, and a layout attribute parameter of the first window.

[0007] Optionally, the first operation includes a click operation or a slide operation.

[0008] Optionally, the interface switching of the first application may be the appearance of a pop-up window in the first application, or the interface of the first application may be switched from the current interface to the next interface, or other forms of interface switching of the first application, which is not limited in this application.

[0009] Optionally, the first application is loaded by switching from the background to the foreground, or by loading from the current interface to the next interface, or by other forms of loading of the first application, which is not limited in the present application.

[0010] The abnormal window may refer to a window with abnormal transparency, for example, a window with a transparency value lower than a minimum visible value.

[0011] In the embodiment of the present application, when the application interface switches or the application is loaded, the relevant information of the application can be accurately obtained, and the application-related window can be detected based on the relevant information of the application. When the application-related window is detected as an abnormal window, it means that the application-related window has a frozen screen failure. After the system recognizes the triggering operation of application recovery, the application can be further restored. In this method, the frozen screen detection of the application loading scenario is taken into account, which can avoid the false alarm of fault information; and the method can accurately detect the frozen screen phenomenon caused by abnormal window failure, and can restore the application in time, thereby avoiding the situation where the interface is stuck and cannot be operated for a long time. The user does not need to use forced restart and other operations to solve the frozen screen problem, which can avoid the user's frozen screen anxiety, thereby significantly improving the user experience.

[0012] In combination with the first aspect, in a possible implementation method, when the first window is determined to be an abnormal window based on the first information, in response to the user's first operation on the first window, before restoring the first application, the method also includes: detecting the transparency of the first window based on the first information; determining that the first window is an abnormal window based on the first information, including: when the result of detecting the transparency of the first window is transparent or semi-transparent, determining that the first window is an abnormal window.

[0013] In some embodiments, when the layout attribute parameters of the first window conform to PixelFormat.TRANSPARENT, the transparency pre-detection result of the first window is determined to be transparent, or when the layout attribute parameters of the first window conform to PixelFormat.TRANSLUCENT, the transparency pre-detection result of the first window is determined to be semi-transparent.

[0014] In some embodiments, when it is detected that the transparency of the window is less than a minimum visible value, the window is determined to be transparent or semi-transparent.

[0015] Among them, the two methods described above that can be implemented in some embodiments (i.e., methods of determining whether a window is transparent or translucent) can be implemented separately or in combination. For example, the first method described above can be used as a pre-detection step, and the second method described above can be used as a formal detection step. When the pre-detection result is opaque, the formal detection step is not performed.

[0016] In the embodiment of the present application, it is possible to determine whether the window is an abnormal window based on the transparency of the detected window, and the two methods of determining whether the window is a transparent or semi-transparent window, when implemented in combination, can improve the accuracy of the window transparency judgment. In addition, since the first method can be used as a pre-detection step, when the pre-detection fails, the second method will not be executed. In this way, power consumption overhead can also be saved to a certain extent.

[0017] In combination with the first aspect, in a possible implementation method, the transparency of the first window is detected based on the first information, including: the transparency of the first window is detected based on the layout attribute parameters of the first window and / or the view of the first window, wherein the first information includes the layout attribute parameters of the first window and / or the view of the first window.

[0018] In some embodiments, when the layout attribute parameters of the first window conform to PixelFormat.TRANSPARENT, the transparency pre-detection result of the first window is determined to be transparent, or when the layout attribute parameters of the first window conform to PixelFormat.TRANSLUCENT, the transparency detection result of the first window is determined to be semi-transparent.

[0019] In some embodiments, when it is detected that the transparency of the window is less than a minimum visible value based on the layout attribute parameters of the first window and the view of the first window, the window is determined to be a transparent window or a semi-transparent window.

[0020] Among them, the two methods described above that can be implemented in some embodiments (i.e., methods of determining whether a window is transparent or translucent) can be implemented separately or in combination. For example, the first method described above can be used as a pre-detection step, and the second method described above can be used as a formal detection step. When the pre-detection result is opaque, the formal detection step is not performed.

[0021] In an embodiment of the present application, the two methods of judging whether a window is a transparent or semi-transparent window can improve the accuracy of judging the transparency of the window when implemented in combination. Before formally detecting the application-related window (detecting whether it is an abnormal window, which can also be understood as a formal detection of transparency), the application-related window can be pre-detected for transparency. Furthermore, since the first method can be used as a pre-detection step, when the pre-detection fails, the subsequent formal detection will not be executed to execute the second method. In this way, power consumption can be saved to a certain extent.

[0022] In combination with the first aspect, in a possible implementation method, when the first window is determined to be an abnormal window based on the first information, the first application is restored in response to the user's first operation on the first window, including: if the interface of the first application remains unchanged during the first time period, whether the first window is an abnormal window is determined based on the first information, and when it is determined that the first window is an abnormal window, the first application is restored in response to the user's first operation on the first window, wherein the first time period starts from the time when the interface switching of the first application is detected; or, if the loading status of the first application remains unchanged during the first time period, whether the first window is an abnormal window is determined based on the first information, and when it is determined that the first window is an abnormal window, the first application is restored in response to the user's first operation on the first window, wherein the first time period starts from the time when the first application is detected to be loaded.

[0023] Optionally, the first period is 6 seconds.

[0024] In an embodiment of the present application, when it is detected that an application interface switches or an application is loaded, after obtaining application-related parameters and other information, application detection will not be started immediately. Instead, application detection will be performed after a delay condition is met (for example, after an application interface switches or an application is loaded, the interface does not change or the loading status does not change within 6 seconds). In this way, frequent detection of applications and some unnecessary detections (for example, when the screen is not frozen and the system process is slow, no detection is required), can be avoided, thereby saving power consumption.

[0025] In combination with the first aspect, in a possible implementation, in response to a user's first operation on the first window, restoring the first application includes: in response to the user's first operation on the first window, issuing a first reminder to the user, the first reminder being used to remind the user that the first application has a freeze screen failure; in response to the user determining to restore the operation of the first application, restoring the first application.

[0026] In an embodiment of the present application, after detecting that an application has a frozen screen failure, the user can be reminded of the failure and guided to trigger an application recovery operation. The user can continue to perform subsequent normal operations after waiting for the application to recover in the current interface. The user does not need to recover the application through means such as forced restart, which can significantly improve the user's usage experience and avoid user anxiety.

[0027] In combination with the first aspect, in a possible implementation, in response to a first operation of the user on the first window, restoring the first application includes: in response to at least two first operations of the user on the first window within a second time period, restoring the first application.

[0028] Optionally, the second time period is 3 seconds.

[0029] In an embodiment of the present application, after detecting that an application freezes, the application recovery operation can be automatically executed. The user is unaware of the fault recovery process. The user only needs to wait for the application to recover in the current interface and then continue to perform subsequent normal operations. The user does not need to restore the application through means such as forced restart, which can significantly improve the user experience and avoid user anxiety.

[0030] In combination with the first aspect, in a possible implementation manner, restoring the first application includes: removing the first window; or exiting the first application.

[0031] In one example, when the system resynthesizes the correct first window, the system restores the first application by removing the first window; when the system does not synthesize the correct first window, the system restores the first application by exiting the current first application.

[0032] In the embodiment of the present application, after a freezing screen failure occurs in an application, the application can be automatically repaired or repaired in response to a trigger operation of the user. The user does not need to restore the application through means such as forced restart, which can significantly improve the user experience and avoid user anxiety.

[0033] In combination with the first aspect, in a possible implementation, the method further includes: when it is detected that the first application stops running, or when it is detected that the page loaded by the first application stops displaying, ending the detection and recovery process of the first application.

[0034] In an embodiment of the present application, during the freeze screen detection process, as long as the first application stops running or the page loaded by the first application stops being displayed, the current detection process will be ended. In this way, some unnecessary freeze screen detections can be avoided (for example, when the user switches the application to the background and does not need to use the application at the moment, there is no need to perform freeze screen detection related to the application), thereby avoiding unnecessary troubles for the user (for example, unnecessary pop-up reminders, etc.) and saving the system's power consumption overhead.

[0035] In a second aspect, a device for application recovery is provided, the device comprising: an acquisition module for acquiring first information corresponding to the first application when it is detected that an interface switch of the first application occurs or the first application is loaded; and a recovery module for recovering the first application in response to a first operation of the user on the first window when it is determined that the first window is an abnormal window based on the first information, wherein the first window is a window related to the first application.

[0036] Optionally, the first information includes one or more of an application package name of the first application, a window name of the first window, a view of the first window, and a layout attribute parameter of the first window.

[0037] Optionally, the first operation includes a click operation or a slide operation.

[0038] Optionally, the interface switching of the first application may be the appearance of a pop-up window in the first application, or the interface of the first application may be switched from the current interface to the next interface, or other forms of interface switching of the first application, which is not limited in this application.

[0039] Optionally, the first application is loaded by switching from the background to the foreground, or by loading from the current interface to the next interface, or by other forms of loading of the first application, which is not limited in the present application.

[0040] The abnormal window may refer to a window with abnormal transparency, for example, a window with a transparency value lower than a minimum visible value.

[0041] Optionally, the device further includes a determining module, configured to determine that the first window is an abnormal window according to the first information.

[0042] In the embodiment of the present application, when the application interface switches or the application is loaded, the relevant information of the application can be accurately obtained, and the application-related window can be detected based on the relevant information of the application. When the application-related window is detected as an abnormal window, it means that the application-related window has a frozen screen failure. After the system recognizes the triggering operation of application recovery, the application can be further restored. Through this device, the frozen screen detection of the application loading scenario is taken into account, and the false alarm of fault information can be avoided; and the device can accurately detect the frozen screen phenomenon caused by abnormal window failure, and can restore the application in time, thereby avoiding the situation where the interface is stuck and cannot be operated for a long time. The user does not need to use forced restart and other operations to solve the frozen screen problem, which can avoid the user's frozen screen anxiety, thereby significantly improving the user experience.

[0043] In combination with the second aspect, in a possible implementation, the device also includes: a detection module, used to detect the transparency of the first window based on the first information; and a determination module, used to determine that the first window is an abnormal window when the result of the detection module detecting the transparency of the first window is transparent or translucent.

[0044] In some embodiments, when the layout attribute parameters of the first window conform to PixelFormat.TRANSPARENT, the determination module determines that the transparency pre-detection result of the first window is transparent, or when the layout attribute parameters of the first window conform to PixelFormat.TRANSLUCENT, the determination module determines that the transparency pre-detection result of the first window is semi-transparent.

[0045] In some embodiments, when it is detected that the transparency of the window is less than the minimum visible value, the determination module determines that the window is transparent or semi-transparent.

[0046] Among them, the two methods described above that can be implemented in some embodiments (i.e., methods of determining whether a window is transparent or translucent) can be implemented separately or in combination. For example, the first method described above can be used as a pre-detection step, and the second method described above can be used as a formal detection step. When the pre-detection result is opaque, the formal detection step is not performed.

[0047] In an embodiment of the present application, the determination module can determine whether the window is an abnormal window based on the transparency of the window detected by the detection module, and the determination module can combine the two methods of determining whether the window is a transparent or semi-transparent window, which can improve the accuracy of the window transparency judgment. In addition, because the determination module can use the first method as a pre-detection step, when the pre-detection fails, the determination module will not execute the second method. In this way, power consumption overhead can also be saved to a certain extent.

[0048] In combination with the second aspect, in a possible implementation method, the detection module is specifically used to: detect the transparency of the first window based on the layout attribute parameters of the first window and / or the view of the first window, wherein the first information includes the layout attribute parameters of the first window and / or the view of the first window.

[0049] In some embodiments, when the layout attribute parameters of the first window conform to PixelFormat.TRANSPARENT, the determination module determines that the transparency pre-detection result of the first window is transparent, or when the layout attribute parameters of the first window conform to PixelFormat.TRANSLUCENT, the determination module determines that the transparency detection result of the first window is semi-transparent.

[0050] In some embodiments, when the detection module detects that the transparency of the window is less than a minimum visible value based on the layout attribute parameters of the first window and the view of the first window, the determination module determines that the window is a transparent window or a semi-transparent window.

[0051] Among them, the two methods described above that can be implemented in some embodiments (i.e., methods of determining whether a window is transparent or translucent) can be implemented separately or in combination. For example, the first method described above can be used as a pre-detection step, and the second method described above can be used as a formal detection step. When the pre-detection result is opaque, the formal detection step is not performed.

[0052] In an embodiment of the present application, the determination module can combine and implement the two methods of determining whether a window is a transparent or semi-transparent window, which can improve the accuracy of the window transparency judgment. In addition, the determination module can also use the first method as a pre-detection step. When the pre-detection fails, the determination module will not perform subsequent formal detection. In this way, power consumption overhead can also be saved to a certain extent.

[0053] In combination with the second aspect, in a possible implementation method, the recovery module is specifically used to: if the interface of the first application remains unchanged during the first time period, determine whether the first window is an abnormal window based on the first information, and when it is determined that the first window is an abnormal window, restore the first application in response to the user's first operation on the first window, wherein the first time period starts from the time when the interface switching of the first application is detected; or, if the loading status of the first application remains unchanged during the first time period, determine whether the first window is an abnormal window based on the first information, and when it is determined that the first window is an abnormal window, restore the first application in response to the user's first operation on the first window, wherein the first time period starts from the time when the first application is detected to be loaded.

[0054] Optionally, the first period is 6 seconds.

[0055] In some embodiments, the device further includes a determination module, and the determination module is used to determine whether the first window is an abnormal window.

[0056] In an embodiment of the present application, when it is detected that an application interface switches or an application is loaded, after obtaining application-related parameters and other information, application detection will not be started immediately. Instead, application detection will be performed after a delay condition is met (for example, after an application interface switches or an application is loaded, the interface does not change or the loading status does not change within 6 seconds). In this way, frequent detection of applications and some unnecessary detections (for example, when the screen is not frozen and the system process is slow, no detection is required), can be avoided, thereby saving power consumption.

[0057] In combination with the second aspect, in a possible implementation, the recovery module is specifically used to: in response to the user's first operation on the first window, issue a first reminder to the user, and the first reminder is used to remind the user that the first application has a freeze screen failure; in response to the user's determination to restore the first application, restore the first application.

[0058] In an embodiment of the present application, after detecting that an application has a frozen screen failure, the user can be reminded of the failure and guided to trigger an application recovery operation. The user can continue to perform subsequent normal operations after waiting for the application to recover in the current interface. The user does not need to recover the application through means such as forced restart, which can significantly improve the user's usage experience and avoid user anxiety.

[0059] In conjunction with the second aspect, in a possible implementation, the recovery module is specifically configured to: in response to at least two first operations of the user on the first window within a second time period, recover the first application.

[0060] Optionally, the second time period is 3 seconds.

[0061] In an embodiment of the present application, after detecting that an application freezes, the application recovery operation can be automatically executed. The user is unaware of the fault recovery process. The user only needs to wait for the application to recover in the current interface and then continue to perform subsequent normal operations. The user does not need to restore the application through means such as forced restart, which can significantly improve the user experience and avoid user anxiety.

[0062] In combination with the second aspect, in a possible implementation manner, the recovery module is specifically used to: remove the first window; or exit the first application.

[0063] In one example, when the system resynthesizes the correct first window, the system restores the first application by removing the first window; when the system does not synthesize the correct first window, the system restores the first application by exiting the current first application.

[0064] In the embodiment of the present application, after a freezing screen failure occurs in an application, the application can be automatically repaired or repaired in response to a trigger operation of the user. The user does not need to restore the application through means such as forced restart, which can significantly improve the user experience and avoid user anxiety.

[0065] In combination with the second aspect, in a possible implementation, the device also includes: a termination module, which is used to end the detection and recovery process of the first application when it is detected that the first application stops running or detects that the page loaded by the first application stops displaying.

[0066] In an embodiment of the present application, during the freeze screen detection process, as long as the first application stops running or the page loaded by the first application stops being displayed, the current detection process will be ended. In this way, some unnecessary freeze screen detections can be avoided (for example, when the user switches the application to the background and does not need to use the application at the moment, there is no need to perform freeze screen detection related to the application), thereby avoiding unnecessary troubles for the user (for example, unnecessary pop-up reminders, etc.) and saving the system's power consumption overhead.

[0067] In a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store computer program code, and the processor is used to execute the computer program code stored in the memory to implement the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.

[0068] In a fourth aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the method in the above-mentioned first aspect or any possible implementation manner of the first aspect is implemented.

[0069] In a fifth aspect, a chip is provided, in which instructions are stored. When the instructions are executed on a device, the chip executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.

[0070] In a sixth aspect, a computer program product is provided, which includes a computer program code. When the computer program code runs on a computer, it implements the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

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

[0073] Figure 3 is a schematic flow chart of an existing application recovery method provided by an embodiment of the present application;

[0074] Figure 4 This is a schematic diagram of an interface corresponding to a method for application detection and recovery provided in an embodiment of the present application;

[0075] Figure 5 This is a schematic diagram of an interface corresponding to another method for application detection and recovery provided in an embodiment of the present application;

[0076] Figure 6is a schematic diagram of an application detection and recovery method provided in an embodiment of the present application;

[0077] Figure 7 is a schematic diagram of another application detection and recovery method provided in an embodiment of the present application;

[0078] Figure 8 is a schematic diagram of a method for application recovery provided in an embodiment of the present application;

[0079] Fig. 9 is a schematic diagram of a method for ending an application detection process provided by an embodiment of the present application;

[0080] Fig.10 This is a system architecture diagram corresponding to application detection and recovery provided in an embodiment of the present application;

[0081] Fig.11 It is a functional module diagram of an application detection and recovery device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0082] The technical solution in the present application will be described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.

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

[0084] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0085] The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0086] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "one embodiment", "some embodiments", "another embodiment", "some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0087] The method provided in the embodiments of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.

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

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

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

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

[0092] 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.

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

[0094] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0095] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0096] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0097] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0098] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0099] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0100] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0101] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0102] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0103] 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. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0104] The wireless communication function of the electronic device 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.

[0105] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 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.

[0106] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 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, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0107] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0108] The wireless communication module 160 can provide wireless communication solutions 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 (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can 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 frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0109] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

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

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

[0112] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0113] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0114] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0115] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0116] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0117] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0118] 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 electronic device 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.

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

[0120] The electronic device 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 headphone jack 170D, and the application processor.

[0121] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0122] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0123] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0124] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0125] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0126] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0127] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0128] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0129] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

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

[0131] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0132] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0133] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0134] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0135] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

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

[0137] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0138] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0139] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0140] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0141] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an embedded SIM (eSIM) card, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0142] It should be understood that the phone card in the embodiments of the present application includes but is not limited to a SIM card, an eSIM card, a universal subscriber identity module (USIM), a universal integrated circuit card (UICC), and the like.

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

[0144] Figure 2 1 is a software structure diagram of the electronic device 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can include a series of application packages.

[0145] like Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

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

[0147] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0148] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0149] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0150] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0151] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0152] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0153] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0154] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0155] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0156] The application layer and the application framework layer run in a 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.

[0157] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0158] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0159] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0160] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0161] A 2D graphics engine is a drawing engine for 2D drawings.

[0162] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0163] It should be understood that the technical solutions in the embodiments of the present application can be used in Android, IOS, Hongmeng and other systems.

[0164] The technical solution of the embodiment of the present application can be applied to electronic devices.

[0165] The electronic device in the embodiments of the present application may be a television, a desktop computer, a laptop computer, or a portable electronic device such as a mobile phone, a tablet computer, a camera, a camcorder, a video recorder, or other electronic devices with storage functions, electronic devices in a 5G network, or electronic devices in a future evolving public land mobile communication network (public landmobile network, PLMN), etc., and the present application does not limit this.

[0166] Current users have increasingly higher requirements for the basic experience of terminal products. When terminal products experience screen freezing (for example, page freezing, inability to scroll, etc.), especially when the screen freezing problem is caused by abnormally transparent application windows, it brings an extremely poor experience to users. After encountering this problem, many users are unable to recover automatically for a long time and can only force a restart to recover.

[0167] For example, Figure 3 FIG. 3 is a schematic flow chart of an existing method 300 for application recovery. Figure 3 As shown, the method 300 includes:

[0168] S301: Detect and obtain working performance parameters of a touch panel (TP) and a liquid crystal display (LCD) in a terminal display screen, so as to determine whether a frozen screen occurs on the terminal display screen according to the working performance parameters.

[0169] S302: If the terminal display screen is frozen, abnormal information of the system operation in the frozen state is obtained, and a processing rule is determined based on the abnormal information and preset classification rules.

[0170] S303: Process the terminal according to the processing rule to prevent the terminal display screen from freezing.

[0171] Although this method can determine whether the terminal display screen is frozen within a certain range and determine processing rules to eliminate the freezing when it occurs, this method is not applicable to transparent window scenarios, that is, this method cannot effectively detect freezing of transparent windows. In addition, when freezing occurs, it is impossible to alleviate the user's emotions through effective self-recovery measures, resulting in a very poor user experience.

[0172] In response to the above problems, the embodiments of the present application provide a method, device and electronic device for application detection and recovery. Through this method, device or electronic device, the frozen screen phenomenon caused by abnormal window failure can be accurately detected, and the application can be restored in time, thereby avoiding the situation where the interface is stuck and cannot be operated for a long time. The user does not need to use forced restart and other operations to solve the frozen screen problem, which can avoid the user's anxiety about the frozen screen, thereby significantly improving the user's experience.

[0173] For example, Figure 4 A schematic diagram of an interface corresponding to a method for application detection and recovery provided in an embodiment of the present application is shown.

[0174] like Figure 4As shown, when the electronic device 400 detects that the screen is frozen due to a transparent window (which can be understood as a window with abnormal transparency, or also called an abnormal window) failure of the application, a first reminder box 401 can be displayed on the current display interface of the electronic device 400. The first reminder box 401 is used to remind the user that the screen is frozen due to a transparent window failure. The first reminder box 401 may, for example, include text: A transparent theme failure has occurred in the application; the first reminder box 401 may include a first option 402 and a second option 403, wherein the first option 402 is used for the user to choose to clean up the corresponding application to restore the application, and the second option 403 is used for the user to choose to swipe up on the corresponding application to restore the application.

[0175] In some embodiments, the first reminder box 401 can be displayed in the form of a pop-up window, in the form of a message banner, in the form of a notification bar, or in other notification forms (for example, a combination of voice message and pop-up message), which is not limited in this application.

[0176] In some embodiments, when it is detected that a user slides or clicks twice on the same transparent window interface within a certain time period, the electronic device detects that the screen is frozen due to a transparent window failure of the application.

[0177] The above-mentioned time period may refer to any time period within 2 seconds, 3 seconds, 4 seconds, or 5 seconds, or may be other time periods, which is not limited in the present application.

[0178] It should be understood that the embodiments of the present application are only schematic diagrams of an interface display for reminding a user and guiding the user to restore an application when an electronic device detects that the application has a transparent window failure and the screen has been frozen. The interface schematic diagram may also be an interface schematic diagram in other forms. All interface schematic diagrams that can indicate that an electronic device reminds a user and guides the user to restore an application when it detects that the application has a transparent window failure and the screen has been frozen are within the scope of the embodiments of the present application.

[0179] In an embodiment of the present application, an effective application recovery method for transparent window scenarios is provided, which can remind users of the fault after a transparent window failure occurs and guide users to trigger an application recovery operation. Users can continue to perform subsequent normal operations after waiting for the application to recover in the current interface. Users do not need to recover the application through forced restart or other means, which can significantly improve the user experience and avoid user anxiety.

[0180] and Figure 4 The embodiments shown are juxtaposed, exemplarily, Figure 5 A schematic diagram of an interface corresponding to another application detection and recovery method provided in an embodiment of the present application is shown.

[0181] like Figure 5 As shown, when the electronic device 500 detects that the screen is frozen due to a transparent window failure in the application, the electronic device 500 automatically performs the application recovery operation. After the application is successfully restored, the user can perform subsequent operations normally.

[0182] In some embodiments, when it is detected that the user slides or clicks twice on the same transparent window interface within a certain time period, the electronic device 500 detects that the screen is frozen due to a transparent window failure of the application.

[0183] The above-mentioned time period may refer to any time period within 2 seconds, 3 seconds, 4 seconds, or 5 seconds, or may be other time periods, which is not limited in the present application.

[0184] In an embodiment of the present application, an effective application recovery method for transparent window scenarios is provided, which can automatically perform application recovery operations after a transparent window failure occurs. The user is unaware of the failure recovery process. The user only needs to wait for the application to recover in the current interface and then continue to perform subsequent normal operations. The user does not need to recover the application through forced restart or other means, which can significantly improve the user experience and avoid user anxiety.

[0185] For example, Figure 6 FIG. 6 is a schematic diagram of a method 600 for application detection and recovery provided in an embodiment of the present application. Figure 6 As shown, the method 600 includes:

[0186] S601: When it is detected that an interface switch of a first application occurs, or the first application is loaded, first information corresponding to the first application is obtained.

[0187] In some embodiments, the interface switching of the first application may be a pop-up window appearing in the first application, or the interface of the first application may switch from the current interface to the next interface, or other forms of interface switching of the first application, which is not limited in this application.

[0188] In some embodiments, the first application is loaded by switching from the background to the foreground, or by loading from the current interface to the next interface, or by other forms of loading of the first application, which is not limited in the present application.

[0189] Among them, optionally, the first information may include one or more of the application package name of the first application, the window name of the first window, the view (DecorView) of the first window, and the layout attribute parameters of the first window. In addition, the first information may also include other information of the first application or the first window, which is not limited in this application.

[0190] The first window refers to a window related to the first application. More specifically, the first window may be a window related to the current interface of the first application.

[0191] The first information corresponding to the first application may include, for example, one or more parameter information in the following Table 1:

[0192] Table 1

[0193] The key name corresponding to the first information First Information Type of first information decorView The view of the first window (DecorView) DecorView viewFrom Custom tag (TAG) String focusedWinPackageName The package name of the first application String focusedActivityName Application page (Activity) name String focusedWindowName The name of the first window String focusedWindowAlpha Layout attribute parameters of the first window Float

[0194] In some embodiments, a stub may be inserted into the program code related to the interface switching or the program code related to the interface loading, so as to obtain the first information corresponding to the first application when the interface switching or interface loading of the first application is detected, wherein the stub technology refers to inserting a probe into the program on the basis of ensuring the logical integrity of the original program, collecting information in the code (the method itself, method parameter values, return values, etc.) through the probe, inserting a code segment at a specific location, and thus collecting dynamic context information when the program is running. For example, the execution of step S601 can be triggered by inserting a stub in the key switching function (handleResumeActivity). Specifically, by inserting a stub in the key switching function (handleResumeActivity), the first information corresponding to the first application is obtained when the first application is detected to be loaded.

[0195] In some embodiments, the execution of step S601 is triggered by adding a plug-in in the process of popping up / displaying (showing) the first window. Specifically, by adding a plug-in in the process of popping up / displaying (showing) the first window, when the interface switching of the first application is detected, the first information corresponding to the first application is obtained.

[0196] In some embodiments, the layout attribute parameters (LayoutParams) of the first window may be obtained by calling a getAttributes method of the window, and the first information may include the layout attribute parameters of the first window.

[0197] S602: Determine whether the first window is an abnormal window based on the first information.

[0198] In the embodiment of the present application, the transparency of the first window may be detected based on the first information, and then whether the first window is an abnormal window may be determined according to the transparency of the first window.

[0199] In some embodiments, when the delay condition is met, it is determined whether the first window is an abnormal window based on the first information. The timing starts when it is detected that the first application has an interface switch or the first application is loaded. When the time for the first application to keep the interface unchanged after the switch is greater than or equal to the first time threshold, or the time for the loading state of the first application to remain unchanged is greater than or equal to the first time threshold, it means that the delay condition is met.

[0200] In some embodiments, the first time threshold may be 6 seconds, or may be other default time thresholds, or may be a time threshold determined based on user input, which is not limited in the present application.

[0201] In some embodiments, before step S602, it can also be determined whether the layout attribute parameters (LayoutParams) of the first window meet the first condition. If the layout attribute parameters (LayoutParams) of the first window meet the first condition, step S602 is performed, and if the first condition is not met, step S602 is not performed. Exemplarily, the layout attribute parameters (LayoutParams) of the first window meet the first condition when the layout attribute parameters (LayoutParams) of the first window are PixelFormat.TRANSPARENT (transparent) or PixelFormat.TRANSLUCENT (semi-transparent).

[0202] In some embodiments, the method for determining whether the first window is an abnormal window based on the first information may further include:

[0203] Determine whether the window transparency of the first window is less than the minimum visible value. If the window transparency of the first window is less than the minimum visible value, determine that the first window is an abnormal window. Exemplarily, the minimum visible value can be any value in the range of 0-0.05, such as 0.01, 0.02, etc. The minimum visible value can also be a system default value, which is not limited in this application.

[0204] Exemplarily, the pop-up box (Dialog) and the belonging application page (Activity) of the first window can be detected within the same detection time period. Based on the pop-up box (Dialog) and the belonging application page (Activity) of the first window, the sub-views (view) of the view (DecorView) of the first window are traversed, and then the window transparency of the first window is determined according to the visible view parameters (hasVisibleView) and terminal view parameters (terminalViewCount) corresponding to each sub-view.

[0205] Among them, the value of the visible view parameter (hasVisibleView) corresponding to the subview (view) of the view (DecorView) of the first window is equal to the product of the background transparency (alpha) (the background transparency of the subview (view) of the view (DecorView) of the first window) and the layout attribute parameter of the first window, and the visible view parameter (hasVisibleView) is used to indicate whether there is a view combination (ViewGroup) with a visible background in the subview (view); the value of the terminal view parameter (terminalViewCount) is: the number of subviews (view) that are not view combinations (ViewGroup) and have visible background transparency (alpha) in the subview (view) of the view (DecorView) of the first window.

[0206] During the traversal process, if the value of the visible view parameter (hasVisibleView) is less than the minimum visible value, and / or the value of the terminal view parameter (terminalViewCount) is less than the default number, the first window is determined to be an abnormal window and the traversal ends.

[0207] Among them, if the value of the visible view parameter (hasVisibleView) corresponding to a subview (view) is less than the minimum visible value, it means that there is a view group (ViewGroup) with a visible background in the subview.

[0208] Among them, the default number can be 1.

[0209] When the value of the visible view parameter (hasVisibleView) during the entire traversal process (from the beginning of the traversal to the end of the traversal) is greater than or equal to the minimum visible value, and the value of the terminal view parameter (terminalViewCount) is greater than or equal to the default number, the first window is determined to be a normal window.

[0210] S603: When it is determined that the first window is an abnormal window, in response to a first operation of the user on the first window, performing a recovery operation on the first application.

[0211] In an embodiment of the present application, the first operation can be understood as an operation that occurs on the interface where the first window is located. The first operation can be, for example, a click operation or a sliding operation. The first operation can also be other operations that can occur on the interface where the first window is located, such as: a long press operation, an operation of drawing a gesture on the screen, etc. This application does not limit this.

[0212] In some embodiments, the first operation may occur once or multiple times.

[0213] In one example, when it is detected that the first operation occurs at least twice within a certain period of time, a recovery operation is performed on the first application.

[0214] The above-mentioned time period may refer to any time period within 2 seconds, 3 seconds, 4 seconds, or 5 seconds, or may be other time periods, which is not limited in the present application.

[0215] In one example, when it is detected that the user has performed the first operation on the first window at least twice within 3 seconds (for example, the number of clicks + the number of slides performed on the first window within 3 seconds is ≥ 2), a recovery operation is performed on the first application.

[0216] In an embodiment of the present application, when it is determined that the first window is an abnormal window, the focus window corresponding to the current user operation can also be detected. When it is detected that the focus window corresponding to the current user operation is the first window, the first application is restored, wherein the focus window corresponding to the user operation means that the user operation occurs on the focus window.

[0217] In some embodiments, the focus window corresponding to the current user operation can be detected by inserting a stub in the input management service (InputManagerService).

[0218] In some embodiments, when it is detected that at least two user operations (eg, click operations, sliding operations, etc.) occurring within a certain time period are both on the first window, the focus window of the at least two user operations is determined to be the first window.

[0219] In an embodiment of the present application, when the user configures in the settings to allow pop-up boxes, in response to the user's first operation on the first window, a first pop-up box can be displayed on the screen of the electronic device. The first pop-up box is used to remind the user that a frozen screen has occurred due to a transparent window (abnormal window) failure. The first pop-up box may, for example, include text: a transparent theme failure has occurred in the application; the first pop-up box may include a first option and a second option, wherein when the user selects the first option, it indicates that the user chooses to clean up the corresponding application to restore the first application and eliminate the frozen screen; when the user selects the second option, it indicates that the user chooses to swipe up on the corresponding application to restore the first application and eliminate the frozen screen. The interface schematic diagram corresponding to this interface can be referenced. Figure 4 The embodiment shown.

[0220] Among them, optionally, if the user selects the first option, the killProcess interface of the activity manager service (AMS) can be called to clean up the current first window process; if the user selects the second option, the swipe-up exit interface of the desktop (launcher) is called to exit the current application.

[0221] In some embodiments, when the user does not set a permission pop-up window, in response to the user's first operation on the first window, the system calls the AMS killProcess interface by default to clean up the current first window process, and the user is not aware of the application recovery process. The interface diagram corresponding to this interface can be referred to Figure 5 The embodiment shown.

[0222] In some embodiments, if the current system resynthesizes the correct first window, the system automatically clears the current abnormal first window to complete application recovery; if the current system does not resynthesize the correct first window, the system automatically exits the current first application.

[0223] In the embodiment of the present application, when the application interface switches or the application is loaded, the relevant information of the application can be accurately obtained, and the transparency detection of the application-related window can be performed based on the relevant information of the application. When the application-related window is detected as an abnormal window, it means that the application-related window has a frozen screen failure, and the detection result and abnormal data are further reported, so that the system can further perform application recovery based on the detection result and abnormal data after identifying the triggering operation of application recovery. In this method, the frozen screen detection of the application loading scenario is taken into account, which can avoid the false alarm of fault information; the method can accurately detect the frozen screen phenomenon caused by abnormal window failure, and can restore the application in time, thereby avoiding the situation where the interface is stuck and cannot be operated for a long time, and does not require users to use forced restart and other operations to solve the frozen screen problem, which can avoid users from having frozen screen anxiety, thereby significantly improving the user experience.

[0224] For example, Figure 7 FIG. 7 is a schematic diagram showing another application detection and recovery method 700 provided in an embodiment of the present application. Figure 7 As shown, the method 700 includes:

[0225] S701: When it is detected that an interface switch of a first application occurs, or the first application is loaded, first information corresponding to the first application is obtained.

[0226] The explanation of step S701 is as follows: Figure 6 The explanation of step S601 in the illustrated embodiments is the same and will not be repeated here for the sake of brevity.

[0227] S702: When the delay condition is met, determine whether the first information meets the first condition. If so, execute step S703. If not, end the process and no longer execute subsequent steps. The first condition refers to the initial detection condition of window transparency.

[0228] In some embodiments, timing starts when an interface switch of the first application is detected, and the time for which the interface of the first application remains unchanged after the switch is greater than or equal to a first time threshold, or timing starts when loading of the first application is detected, and the loading state of the first application remains unchanged for a time greater than or equal to the first time threshold, indicating that the delay condition is met.

[0229] In some embodiments, if the delay condition is not met, the process is terminated and subsequent steps are not executed.

[0230] Optionally, the first time threshold may be 6 seconds, or may be other default time thresholds, or may be a time threshold determined based on user input, which is not limited in the present application.

[0231] In some embodiments, determining whether the first information satisfies the first condition may include: determining whether the layout attribute parameters of the first window satisfy the first condition, wherein the first information includes the layout attribute parameters of the first window.

[0232] Exemplarily, the layout attribute parameters of the first window satisfying the first condition may mean that the layout attribute parameters (LayoutParams) of the first window are PixelFormat.TRANSPARENT (transparent) or PixelFormat.TRANSLUCENT (semi-transparent).

[0233] S703: Determine whether the first window is an abnormal window according to the first information, wherein the first window is a window related to the first application.

[0234] The explanation of step S703 is as follows: Figure 6 The explanation of step S602 in the illustrated embodiments is the same and will not be repeated here for the sake of brevity.

[0235] In some embodiments, the step of determining whether the delay condition is met may be performed after step S702 and before step S703.

[0236] That is to say, the above steps S702 and S703 can also be described as:

[0237] S702: Determine whether the first information satisfies a first condition. If so, execute step S703; if not, terminate the process. The first condition refers to an initial window transparency detection condition.

[0238] S703: When the delay condition is met, determine whether the first window is an abnormal window according to the first information.

[0239] S704: When it is determined that the first window is an abnormal window, in response to a first operation of the user on the first window, performing a recovery operation on the first application.

[0240] The explanation of step S704 is as follows: Figure 6 The explanation of step S603 in the illustrated embodiments is the same and will not be repeated here for the sake of brevity.

[0241] In an embodiment of the present application, when it is detected that an application interface switches or an application is loaded, after obtaining application-related parameters and other information, the frozen screen detection will not be started immediately. Instead, the frozen screen detection will be performed after the delay condition is met (for example: 6 seconds have passed since the application interface switches or the application is loaded). In this way, frequent detection of terminal devices and some unnecessary detections (for example: when the system process is slow but no frozen screen phenomenon occurs), can be avoided, thereby saving power consumption. Moreover, before formally performing a transparency test on the application-related windows, a transparency pre-test can be performed on the application-related windows. When the pre-test fails, the subsequent formal test will not be performed. In this way, power consumption can be saved to a certain extent.

[0242] In order to more clearly understand the above step S603 (the process of restoring the first application), illustratively, Figure 8 FIG. 8 is a schematic diagram of a method 800 for application recovery provided in an embodiment of the present application. Figure 8 As shown, the method 800 includes:

[0243] S801: When it is determined that the first window is an abnormal window, in response to detecting a first operation of the user on the first window, executing step S802.

[0244] In an embodiment of the present application, the first operation can be understood as an operation that occurs on the interface where the first window is located. The first operation can be, for example, a click operation or a sliding operation. The first operation can also be other operations that can occur on the interface where the first window is located, such as: a long press operation, an operation of drawing a gesture on the screen, etc. This application does not limit this.

[0245] Optionally, the first operation may occur once or multiple times.

[0246] In one example, when it is determined that the first window is an abnormal window, in response to detecting at least two first operations of the user on the first window within a certain time period, step S802 is executed.

[0247] The above-mentioned time period may refer to any time period within 2 seconds, 3 seconds, 4 seconds, or 5 seconds, or may be other time periods, which is not limited in the present application.

[0248] In some embodiments, when it is determined that the first window is an abnormal window, the focus window corresponding to the current user operation can also be detected. When it is detected that the focus window corresponding to the current user operation is the first window, it is determined that the user's first operation on the first window is detected, wherein the user operation corresponding to the focus window means that the user operation occurs on the focus window.

[0249] In some embodiments, the focus window corresponding to the current user operation can be detected by inserting a stub in the input management service (InputManagerService).

[0250] In some embodiments, when it is detected that at least two user operations (eg, click operations, sliding operations, etc.) occurring within a certain time period are both on the first window, the focus window of the at least two user operations is determined to be the first window.

[0251] S802: Determine whether the user has preset a reminder function, if not, execute step S803, if yes, execute step S804.

[0252] In one example, when it is detected that the user performs at least two first operations on the first window within 3 seconds (for example, the number of clicks + the number of slides performed on the first window within 3 seconds is ≥ 2), it is determined whether the user has preset a reminder function.

[0253] Among them, in some embodiments, the reminder function preset by the user can be a pop-up reminder, a voice reminder, or other forms of reminder notifications (for example: notification bar reminder, pop-up reminder, etc.), and this application does not limit this.

[0254] S803: The system automatically restores the first application.

[0255] In some embodiments, the system automatically recovers the first application by: removing the first window; or exiting the current first application.

[0256] In one example, when the system resynthesizes the correct first window, the system restores the first application by removing the first window; when the system does not synthesize the correct first window, the system restores the first application by exiting the current first application.

[0257] That is to say, when the user does not have a preset reminder function, in response to the user's first operation on the first window, the system automatically restores the first application. The user is unaware of the application recovery process and only needs to wait for the application to automatically recover before performing subsequent operations normally.

[0258] S804: Sending a first reminder to the user, where the first reminder is used to remind the user that the first application has a frozen screen failure, and the first reminder is also used to remind the user to restore the first application.

[0259] It can be understood that the first reminder is specifically used to remind the user that a freezing screen is detected due to an abnormal window (ie, the first window).

[0260] In some embodiments, a pop-up window may be used to prompt the user that a freezing failure has occurred in the first application.

[0261] In some embodiments, the first reminder includes a first option and a second option, wherein the first option is for the user to restore the application by performing an operation of cleaning the corresponding application, and the second option is for the user to restore the application by sliding up the corresponding application. The interface diagram corresponding to this process can be referred to Figure 4 The embodiment shown.

[0262] S805: In response to the user's operation of restoring the first application, restoring the first application.

[0263] The operation corresponding to restoring the first application may be: removing the first window, or: exiting the current first application.

[0264] In one example, when the system re-synthesizes the correct first window, in response to the user confirming the operation of restoring the first application, the system restores the first application by removing the first window; when the system does not synthesize the correct first window, in response to the user confirming the operation of restoring the first application, the system restores the first application by exiting the current first application.

[0265] In some embodiments, when the user does not restore the first application, the process returns to step S801.

[0266] In an embodiment of the present application, when a frozen screen phenomenon caused by an abnormal window (transparent window) related to an application is detected, the application can be automatically restored (also called frozen screen recovery) when a trigger operation for application recovery is further detected, or the user can be reminded of the abnormality first, and the application can be restored (also called frozen screen recovery) when the user confirms the recovery. In this way, when the frozen screen phenomenon caused by an abnormal window related to an application is accurately detected, it can be restored in time, thereby avoiding the situation where the interface is stuck and cannot be operated for a long time. Through this method, the user no longer needs to use operations such as forced restart to solve the frozen screen problem, which can avoid the user's frozen screen anxiety and significantly improve the user's experience.

[0267] For example, Fig. 9 FIG. 9 is a schematic diagram showing a method 900 for ending application detection provided by an embodiment of the present application. Fig. 9As shown, the method 900 includes:

[0268] S901: When it is detected that the first application stops running, or the page loaded by the first application stops displaying, the detection process is terminated.

[0269] In some embodiments, the first application ceasing to run may refer to the first application switching from the foreground to the background, or may refer to the first application exiting the application process.

[0270] Among them, in some embodiments, the page loaded by the first application stops displaying, which may mean that the pop-up box on the current interface corresponding to the first application stops displaying, or that the notification bar message on the current interface corresponding to the first application stops displaying, or that the floating window on the current interface corresponding to the first application stops displaying, or that other elements on the current interface corresponding to the first application stop displaying, and this application does not limit this.

[0271] In one example, a stake is inserted in the program code related to interface switching or in the program code related to interface loading, so as to end the detection process when it is detected that the first application stops running or the interface loaded by the first application stops displaying, wherein the stake insertion technology refers to inserting a probe into the program on the basis of ensuring the integrity of the original program logic, and inserting a code segment at a specific location through the information in the probe collection code (the method itself, method parameter values, return values, etc.), so as to collect dynamic context information when the program is running. For example, the execution of step S901 is triggered by inserting a stake in the key switching function (handleResumeActivity). Specifically, by inserting a stake in the key switching function (handleResumeActivity), the frozen screen detection process is ended when it is detected that the first application stops running.

[0272] In another example, the execution of step S901 is triggered by adding a plug-in in the process of popping up / displaying (showing) the first window. Specifically, by adding a plug-in in the process of popping up / displaying (showing) the first window, when it is detected that the page loaded by the first application stops displaying, the frozen screen detection process is terminated.

[0273] S902: Remove detection information.

[0274] The detection information refers to various information required for the detection process and / or various information related to the detection process.

[0275] Optionally, the detection information includes first information related to the first application, and the detection information may also include other messages that can be used for the detection process (for example: information used to indicate whether the first information meets the first condition, information used to indicate whether the first window is an abnormal window, etc.), which is not limited in this application.

[0276] It should be understood that: Fig. 9 The embodiment shown runs through the entire detection process. That is, during the execution of step S601 to step S603, as long as it is detected that the first application stops running, or the page loaded by the first application stops displaying, the current detection process will be terminated.

[0277] In an embodiment of the present application, during the freeze screen detection process, as long as the first application stops running or the page loaded by the first application stops being displayed, the current detection process will be ended. In this way, some unnecessary freeze screen detections can be avoided (for example, when the user switches the application to the background and does not need to use the application at the moment, there is no need to perform freeze screen detection related to the application), thereby avoiding unnecessary troubles for the user (for example, unnecessary pop-up reminders, etc.) and saving the system's power consumption overhead.

[0278] For example, Fig.10 A system architecture diagram corresponding to an application detection and recovery method provided in an embodiment of the present application is shown.

[0279] like Fig.10 As shown, the system architecture diagram includes an application layer, a framework layer, a hardware abstraction layer and a kernel layer, wherein the application layer includes a main thread detection module 1010 and a stability maintenance module 1020; the framework layer includes a first management module 1030, a third management module 1040 and a second management module 1050; specifically, the main thread detection module 1010 includes a pre-detection unit 1011, the stability maintenance module 1020 includes a traversal unit 1021 and a recovery unit 1022, the first management module 1030 includes a first detection trigger unit 1031 and a second detection end unit 1032, the third management module 1040 includes a focus window monitoring unit 1041, and the second management module 1050 includes a first detection trigger unit 1051 and a second detection end unit 1052. Wherein:

[0280] The first management module 1030 is used to add a new insertion point in the process of switching the first application to the foreground (resume) / background (pause) to achieve the purpose of triggering / canceling detection. The operation of triggering detection is performed by the first detection trigger unit 1031, and the operation of canceling detection is performed by the first detection end unit 1032; the first management module 1030 is also used to obtain the first information corresponding to the first application and package it, and pass the packaged first information to the stability maintenance module 1020.

[0281] In some embodiments, the first management module 1030 may be an application lifecycle management module.

[0282] The second management module 1050 is used for interface switching scenario detection. Taking the pop-up box scenario as an example, the second management module 1050 is used to add a new insertion point in the pop-up box display (show) / disappearance (dissmiss) process to achieve the purpose of triggering / canceling detection. The operation of triggering detection is performed by the second detection trigger unit 1051, and the operation of canceling detection is performed by the second detection end unit 1052; the first information corresponding to the first application is obtained and packaged, and the packaged first information is passed to the stability maintenance module 1020.

[0283] In some embodiments, the second management module 1050 may be a pop-up management module.

[0284] The traversal unit 1021 performs algorithm detection and judgment on the first information transmitted by the first management module 1030 and the second management module 1050 to confirm whether it is a transparent window.

[0285] In one feasible scenario, the main thread detection module 1010 includes a pre-detection unit 1011, which is used to perform a pre-detection of the window transparency of the first window based on the first information transmitted by the first management module 1030 or the second management module 1050; and a traversal unit 1021, which is used to perform algorithm detection and judgment based on the first information when the pre-detection passes, to confirm whether the first window is an abnormal window (transparent window).

[0286] The third management module 1040 includes a focus window detection unit 1041 which, after detecting the abnormal window, further detects the user's first operation in the first window. When detecting the user's first operation in the first window, the focus window detection unit 1041 reports the relevant information (for example, the first information related to the first application, information indicating that the first window is an abnormal window, etc.) to the stability maintenance module 1020 to perform a recovery operation on the first application.

[0287] In some embodiments, the third management module 1040 may be an event management module / window management module.

[0288] The restoring unit 1022 is configured to restore the first application when a first operation of the user in the first window is detected.

[0289] For example, Fig.11 FIG. 1 is a functional module diagram of an application detection and recovery device 1100 provided in an embodiment of the present application. Fig.11 As shown, the device 1100 includes:

[0290] The acquisition module 1110 is used to acquire first information corresponding to the first application when it is detected that an interface switch of the first application occurs or the first application is loaded.

[0291] In some embodiments, the interface switching of the first application may be a pop-up window appearing in the first application, or the interface of the first application may switch from the current interface to the next interface, or other forms of interface switching of the first application, which is not limited in this application.

[0292] In some embodiments, the first application is loaded by switching from the background to the foreground, or by loading from the current interface to the next interface, or by other forms of loading of the first application, which is not limited in the present application.

[0293] Optionally, the first information includes one or more of an application package name of the first application, a window name of the first window, a view (DecorView) of the first window, and layout attribute parameters of the first window. In addition, the first information may also include other information of the first application or the first window, which is not limited in this application.

[0294] The first window refers to a window related to the first application. More specifically, the first window may be a window related to the current interface of the first application.

[0295] In one example, a stub is inserted in the program code related to the interface switching or in the program code related to the interface loading, so that when the interface switching or interface loading of the first application is detected, the acquisition module 1110 acquires the first information corresponding to the first application, wherein the stub technology refers to inserting a probe into the program on the basis of ensuring the logical integrity of the original program, and inserting a code segment at a specific location through the information in the probe collection code (the method itself, method parameter values, return values, etc.), so as to collect dynamic context information when the program is running. For example, the acquisition module 1110 is triggered to execute the step of "obtaining the first information corresponding to the first application" by inserting a stub in the key switching function (handleResumeActivity). Specifically, by inserting a stub in the key switching function (handleResumeActivity), the acquisition module 1110 acquires the first information corresponding to the first application when it is detected that the first application is loaded.

[0296] In another example, the acquisition module 1110 is triggered to execute the step of "acquiring the first information corresponding to the first application" by adding a plug-in in the process of popping up / displaying (showing) the first window. Specifically, by adding a plug-in in the process of popping up / displaying (showing) the first window, when it is detected that the interface of the first application is switched, the acquisition module 1110 acquires the first information corresponding to the first application.

[0297] In some embodiments, the acquisition module 1110 may acquire the layout attribute parameters (LayoutParams) of the first window through a getAttributes method of the window, and the first information may include the layout attribute parameters of the first window.

[0298] In some embodiments, the device 1100 may further include an identification module for identifying whether an interface switch occurs in the first application, or whether the first application is loaded.

[0299] The determination module 1120 is configured to determine whether the first window is an abnormal window based on the first information.

[0300] In some embodiments, the device 1100 further includes a detection module, which is used to perform transparency detection on the first window based on the first information, and then the determination module 1120 determines whether the first window is an abnormal window according to the transparency of the first window.

[0301] In some embodiments, timing starts when an interface switch of the first application is detected, and the time for which the interface of the first application remains unchanged after the switch is greater than or equal to a first time threshold, or timing starts when loading of the first application is detected, and the loading state of the first application remains unchanged for a time greater than or equal to the first time threshold, indicating that the delay condition is met.

[0302] Optionally, the first time threshold may be 6 seconds, or may be other default time thresholds, or may be a time threshold determined based on user input, which is not limited in the present application.

[0303] In some embodiments, the detection module 1120 is further configured to pre-detect the transparency of the first window based on the first information corresponding to the first application, that is:

[0304] It is detected whether the layout attribute parameters (LayoutParams) of the first window meet the first condition. Exemplarily, the layout attribute parameters (LayoutParams) of the first window meet the first condition when the layout attribute parameters (LayoutParams) of the first window are PixelFormat.TRANSPARENT (transparent) or PixelFormat.TRANSLUCENT (semi-transparent).

[0305] The determination module 1120 is specifically configured to: when the layout attribute parameters (LayoutParams) of the first window meet the first condition, determine whether the first window is an abnormal window based on the first information.

[0306] The determination module 1120 is further specifically configured to: when the layout attribute parameters (LayoutParams) of the first window meet the first condition and the delay condition, determine whether the first window is an abnormal window based on the first information.

[0307] The method by which the determination module 1120 determines whether the first window is an abnormal window based on the first information may be:

[0308] The determination module 1120 determines whether the window transparency of the first window is less than the minimum visible value. If the window transparency of the first window is less than the minimum visible value, the determination module 1120 determines that the first window is an abnormal window.

[0309] Exemplarily, the minimum visible value may be any value in the range of 0-0.05, for example, 0.01, 0.02, etc. The minimum visible value may also be a system default value, which is not limited in the present application.

[0310] Exemplarily, the determination module 1120 can detect the pop-up box (Dialog) and the belonging application page (Activity) of the first window within the same detection time period, and based on the pop-up box (Dialog) and the belonging application page (Activity) of the first window, traverse the sub-views (view) of the view (DecorView) of the first window, and then determine the window transparency of the first window according to the visible view parameters (hasVisibleView) and terminal view parameters (terminalViewCount) corresponding to each sub-view (view).

[0311] Among them, the value of the visible view parameter (hasVisibleView) is equal to the product of the background transparency (alpha) (the background transparency of the subview (view) of the view (DecorView) of the first window) and the layout attribute parameter of the first window. The visible view parameter (hasVisibleView) is used to indicate whether there is a view combination (ViewGroup) with a visible background in the subview (view); the value of the terminal view parameter (terminalViewCount) is: the number of subviews (view) that are not view combinations (ViewGroup) and have visible background transparency (alpha) in the subviews (view) of the view (DecorView) of the first window.

[0312] During the traversal process, if the value of the visible view parameter (hasVisibleView) is less than the minimum visible value, and / or the value of the terminal view parameter (terminalViewCount) is less than the default number, the determination module 1120 determines that the first window is an abnormal window and ends the traversal.

[0313] Among them, the default number can be 1.

[0314] Among them, if the value of the visible view parameter (hasVisibleView) corresponding to a subview (view) is less than the minimum visible value, it means that there is a view group (ViewGroup) with a visible background in the subview.

[0315] When the value of the visible view parameter (hasVisibleView) during the entire traversal process (from the beginning of the traversal to the end of the traversal) is greater than or equal to the minimum visible value, and the value of the terminal view parameter (terminalViewCount) is greater than or equal to the default number, the determination module 1120 determines that the first window is a normal window.

[0316] The recovery module 1130 is configured to, when determining that the first window is an abnormal window, perform a recovery operation on the first application in response to a first operation performed by a user on the first window.

[0317] In an embodiment of the present application, the first operation can be understood as an operation that occurs on the interface where the first window is located. The first operation can be, for example, a click operation or a sliding operation. The first operation can also be other operations that can occur on the interface where the first window is located, such as: a long press operation, an operation of drawing a gesture on the screen, etc. This application does not limit this.

[0318] Optionally, the first operation may occur once or multiple times.

[0319] In one example, when it is detected that the first operation occurs at least twice within a certain period of time, the recovery module 1130 performs an application recovery operation on the first application.

[0320] The above-mentioned time period may refer to any time period within 2 seconds, 3 seconds, 4 seconds, or 5 seconds, or may be other time periods, which is not limited in the present application.

[0321] In one example, when it is detected that the user performs at least two first operations on the first window within 3 seconds (for example, the number of clicks + the number of slides performed on the first window within 3 seconds is ≥ 2), the recovery module 1130 performs a recovery operation on the first application.

[0322] In some embodiments, when it is determined that the first window is an abnormal window, the focus window corresponding to the current user operation can also be detected. When it is detected that the focus window corresponding to the current user operation is the first window, the recovery module 1130 performs a recovery operation on the first application, wherein the focus window corresponding to the user operation means that the user operation occurs on the focus window.

[0323] In some embodiments, the focus window corresponding to the current user operation can be detected by inserting a stub in the input management service (InputManagerService).

[0324] In some embodiments, when it is detected that at least two user operations (eg, click operations, sliding operations, etc.) occurring within a certain time period are both on the first window, the focus window of the at least two user operations is determined to be the first window.

[0325] In an embodiment of the present application, when the user configures in the settings to allow pop-up boxes, in response to the user's first operation on the first window, a first pop-up box can be displayed on the screen of the electronic device. The first pop-up box is used to remind the user that a frozen screen has occurred due to a transparent window (abnormal window) failure. The first pop-up box may, for example, include text: a transparent theme failure has occurred in the application; the first pop-up box may include a first option and a second option, wherein when the user selects the first option, it indicates that the user chooses to clean up the corresponding application to restore the first application and eliminate the frozen screen; when the user selects the second option, it indicates that the user chooses to swipe up on the corresponding application to restore the first application and eliminate the frozen screen. The interface schematic diagram corresponding to this interface can be referenced. Figure 4 The embodiment shown.

[0326] Among them, optionally, if the user selects the first option, the recovery module 1130 can call the killProcess interface of AMS to clean up the current first window process; if the user selects the second option, the recovery module 1130 calls the swipe-up exit interface of the desktop (launcher) to exit the current application.

[0327] In some embodiments,

[0328] When the user does not set the permission pop-up box, in response to the user's first operation on the first window, the recovery module 1130 calls the killProcess interface of the AMS by default to clean up the current first window process. The user is not aware of the application recovery process. The interface diagram corresponding to this interface can be referred to Figure 5 The embodiment shown.

[0329] In some embodiments, if the current system resynthesizes the correct first window, the recovery module 1130 automatically clears the current abnormal first window to complete application recovery; if the current system does not resynthesize the correct first window, the recovery module 1130 automatically exits the current first application.

[0330] In the embodiment of the present application, when the application interface switches or the application is loaded, the relevant information of the application can be accurately obtained, and the transparency detection of the application-related window can be performed based on the relevant information of the application. When the application-related window is detected as an abnormal window, it means that the application-related window has a frozen screen failure, and the detection result and abnormal data are further reported, so that the system can further perform application recovery based on the detection result and abnormal data after identifying the triggering operation of application recovery. Through this device, the frozen screen detection of the application loading scenario is taken into account, and the false alarm of fault information can be avoided; through this device, the frozen screen phenomenon caused by abnormal window failure can be accurately detected, and the application can be restored in time, thereby avoiding the situation where the interface is stuck and cannot be operated for a long time, and the user does not need to use forced restart and other operations to solve the frozen screen problem, which can avoid the user's frozen screen anxiety, thereby significantly improving the user experience.

[0331] The embodiment of the present application also provides a computer-readable medium, which stores a program code. When the computer program code is executed on a computer, the computer executes the above Figures 6 to 9 Any of the methods in .

[0332] The embodiment of the present application also provides a chip, comprising: at least one processor and a memory, wherein the at least one processor is coupled to the memory and is used to read and execute instructions in the memory to execute the above Figures 6 to 9 Any of the methods in .

[0333] The embodiment of the present application also provides an electronic device, comprising: at least one processor and a memory, wherein the at least one processor is coupled to the memory and is used to read and execute instructions in the memory to perform the above Figures 6 to 9 Any of the methods in .

[0334] The above embodiments may be used alone or in combination with each other to achieve different technical effects.

[0335] One or more of the modules or units described herein can be implemented by software, hardware or a combination of the two. When any of the above modules or units are implemented in software, the software exists in the form of computer program instructions and is stored in a memory, and a processor can be used to execute the program instructions and implement the above method flow. The processor may include but is not limited to at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller (MCU), or an artificial intelligence processor and other types of computing devices that run software, each computing device may include one or more cores for executing software instructions to perform operations or processing. The processor may be built into an SoC (system on chip) or an application specific integrated circuit (ASIC), or it may be an independent semiconductor chip. In addition to the core used to execute software instructions for operations or processing in the processor, necessary hardware accelerators may be further included, such as a field programmable gate array (FPGA), a PLD (programmable logic device), or a logic circuit that implements a dedicated logic operation.

[0336] When the modules or units described in this document are implemented in hardware, the hardware can be any one or any combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator, or a non-integrated discrete device, which can run the necessary software or be independent of the software to execute the above method flow.

[0337] When the modules or units described herein are implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium with a configuration capability similar to a cache that a computer can access, or a server, a data center, or other data storage device that includes one or more available media integrated with a configuration capability similar to a cache.

[0338] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0339] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0340] In the several embodiments provided in the present application, it should be understood that the disclosed systems, 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 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 system, 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.

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

[0342] 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.

[0343] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.

[0344] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for application recovery, characterized in that: The method comprises: When it is detected that an interface switch of the first application occurs, or the first application is loaded, obtaining first information corresponding to the first application; When it is determined according to the first information that the first window is an abnormal window, in response to a first operation of the user on the first window, the first application is restored, wherein the first window is a window related to the first application.

2. The method according to claim 1, characterized in that When the first window is determined to be an abnormal window according to the first information, in response to a first operation of the user on the first window, before restoring the first application, the method further includes: detecting the transparency of the first window based on the first information; The determining, according to the first information, that the first window is an abnormal window includes: When the result of detecting the transparency of the first window is transparent or semi-transparent, it is determined that the first window is an abnormal window.

3. The method according to claim 2, characterized in that The detecting the transparency of the first window based on the first information includes: The transparency of the first window is detected based on the layout attribute parameters of the first window and / or the view of the first window, wherein the first information includes the layout attribute parameters of the first window and / or the view of the first window.

4. The method according to any one of claims 1 to 3, characterized in that When it is determined according to the first information that the first window is an abnormal window, in response to a first operation of the user on the first window, restoring the first application includes: If the interface of the first application remains unchanged during a first time period, determining whether the first window is an abnormal window based on the first information, and when it is determined that the first window is an abnormal window, restoring the first application in response to a first operation of the user on the first window, wherein the first time period starts from when an interface switch of the first application is detected; or If the loading status of the first application remains unchanged within a first time period, determine whether the first window is an abnormal window based on the first information. When it is determined that the first window is an abnormal window, restore the first application in response to a first operation of the user on the first window, wherein the first time period starts from the time when the loading of the first application is detected.

5. The method according to claim 4, characterized in that The first period is 6 seconds.

6. The method according to any one of claims 1 to 5, characterized in that The step of restoring the first application in response to a first operation of the user on the first window includes: In response to a first operation of the user on the first window, issuing a first reminder to the user, wherein the first reminder is used to remind the user that a freezing screen failure occurs in the first application; In response to a user determining an operation to restore the first application, the first application is restored.

7. The method according to any one of claims 1 to 6, characterized in that The step of restoring the first application in response to a first operation of the user on the first window includes: In response to at least two first operations on the first window by the user within a second time period, the first application is restored.

8. The method according to claim 7, characterized in that The second period is 3 seconds.

9. The method according to any one of claims 1 to 8, characterized in that The first operation includes a click operation or a slide operation.

10. The method according to any one of claims 1 to 9, characterized in that The restoring the first application includes: removing the first window; or Exit the first application.

11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: When it is detected that the first application stops running, or when it is detected that the page loaded by the first application stops displaying, the detection and recovery process of the first application is terminated.

12. The method according to any one of claims 1 to 11, characterized in that The first information includes one or more of an application package name of the first application, a window name of the first window, a view of the first window, and a layout attribute parameter of the first window.

13. An application recovery device, characterized in that: The device comprises: An acquisition module, configured to acquire first information corresponding to the first application when detecting that an interface switch of the first application occurs or the first application is loaded; A recovery module is used to recover the first application in response to a first operation of the user on the first window when the first window is determined to be an abnormal window according to the first information, wherein the first window is a window related to the first application.

14. The device according to claim 13, characterized in that The device also includes: a detection module, configured to detect the transparency of the first window based on the first information; The determination module is configured to determine that the first window is an abnormal window when the result of the detection module detecting the transparency of the first window is transparent or semi-transparent.

15. The device according to claim 14, characterized in that The detection module is specifically used for: The transparency of the first window is detected based on the layout attribute parameters of the first window and / or the view of the first window, wherein the first information includes the layout attribute parameters of the first window and / or the view of the first window.

16. The device according to any one of claims 13 to 15, characterized in that The recovery module is specifically used for: If the interface of the first application remains unchanged during a first time period, determining whether the first window is an abnormal window based on the first information, and when it is determined that the first window is an abnormal window, restoring the first application in response to a first operation of the user on the first window, wherein the first time period starts from when an interface switch of the first application is detected; or, If the loading status of the first application remains unchanged within a first time period, determine whether the first window is an abnormal window based on the first information. When it is determined that the first window is an abnormal window, restore the first application in response to a first operation of the user on the first window, wherein the first time period starts from the time when the loading of the first application is detected.

17. The device according to claim 16, characterized in that The first period is 6 seconds.

18. The device according to any one of claims 13 to 17, characterized in that The recovery module is specifically used for: In response to a first operation of the user on the first window, issuing a first reminder to the user, wherein the first reminder is used to remind the user that a freezing screen failure occurs in the first application; In response to a user determining an operation to restore the first application, the first application is restored.

19. The device according to any one of claims 13 to 18, characterized in that The recovery module is specifically used for: In response to at least two first operations on the first window by the user within a second time period, the first application is restored.

20. The device according to claim 19, characterized in that The second period is 3 seconds.

21. The device according to any one of claims 13 to 20, characterized in that The first operation includes a click operation or a slide operation.

22. The device according to any one of claims 13 to 21, characterized in that The recovery module is specifically used for: removing the first window; or Exit the first application.

23. The device according to any one of claims 13 to 22, characterized in that The device also includes: The termination module is used to terminate the detection and recovery process of the first application when it is detected that the first application stops running or when it is detected that the page loaded by the first application stops displaying.

24. The device according to any one of claims 13 to 23, characterized in that The first information includes one or more of an application package name of the first application, a window name of the first window, a view of the first window, and a layout attribute parameter of the first window.

25. An electronic device, characterized in that: include: processor; Memory; and a computer program, wherein the computer program is stored in the memory, the computer program comprising instructions, which, when executed by the processor, enable the electronic device to perform the method as claimed in any one of claims 1 to 12.

26. A computer-readable storage medium, characterized in that: The storage medium stores a program or an instruction, and when the program or the instruction is executed, the method according to any one of claims 1 to 12 is implemented.

27. A chip, characterized in that: include: processor; A memory, wherein the processor is coupled to the memory and configured to read and execute instructions in the memory to perform the method according to any one of claims 1 to 12.

28. A computer program product, characterized in that The computer program product includes computer program codes, and when the computer program codes are executed on a computer, the method according to any one of claims 1 to 12 is implemented.