Method for processing screen-on / off event, and related apparatus

By setting restrictions and rules for screen-on events in electronic devices, notifications are sent only to specific business modules, thus solving the power consumption problem caused by screen-on events and achieving reduced power consumption and improved user experience.

WO2026051947A1PCT designated stage Publication Date: 2026-03-12HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2026-03-12

AI Technical Summary

Technical Problem

Electronic devices send notifications to all registered business modules every time the screen lights up, resulting in unnecessary power consumption increases.

Method used

Electronic devices can set limits and rules for screen-on events to send notifications only to specific business modules, avoiding sending them to all modules.

Benefits of technology

It reduces the power consumption of electronic devices while ensuring that all business modules can operate normally when needed by users, providing a good user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025118655_12032026_PF_FP_ABST
    Figure CN2025118655_12032026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a method for processing a screen-on / off event, and a related apparatus. In the method, an electronic device may set a restriction range of screen-on events, and corresponding restriction rules. The electronic device receives a screen-on event, and if the screen-on event falls within the restriction range, the electronic device then sends a notification regarding the screen-on event to a corresponding screen-on service module on the basis of a restriction rule corresponding to the screen-on event. Moreover, the electronic device generates a screen-off event, and then, when sending a notification regarding the screen-off event, the electronic device may also reuse the procedure of sending the notification regarding the screen-on event. In this way, each time a screen-on event is generated, the electronic device does not need to send the screen-on event to all the screen-on service modules, thereby reducing the power consumption to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Method for processing screen-on and screen-off events and related device

[0001] The present application claims priority to the Chinese Patent Application No. 202411247260.9, filed on September 5, 2024, entitled "Method for processing screen-on and screen-off events and related device", and the Chinese Patent Application No. 202411392212.9, filed on September 30, 2024, entitled "Method for processing screen-on and screen-off events and related device", the contents of which are incorporated herein by reference in their entirety. TECHNICAL FIELD

[0002] The present application relates to terminal technology, and in particular, to a method for processing screen-on and screen-off events and related device. BACKGROUND

[0003] Users often use electronic devices in daily life. Electronic devices also often switch from screen-off to screen-on. Currently, electronic devices send screen-on events to all service modules that have registered screen-on events, so that these service modules perform corresponding services. SUMMARY

[0004] The present application provides a method for processing screen-on and screen-off events and related device, which can reduce power consumption without sending screen-on events to all screen-on service modules every time a screen-on event is generated.

[0005] In a first aspect, the present application provides a method for processing screen-on and screen-off events, which is applied to an electronic device and includes: the electronic device generates a first screen-on event; the electronic device switches from screen-off to screen-on based on the first screen-on event; and the electronic device starts a first service module and does not start a second service module based on the first screen-on event.

[0006] The first service module and the second service module belong to service modules that have registered screen-on events in the electronic device. The first screen-on event belongs to a restricted screen-on event. Here, the first screen-on event can adopt a single rule, such as rule 2 or rule 3. The first screen-on event can also adopt multiple superimposed rules. In the embodiments of the present application, the rules adopted by the first screen-on event are not limited, as long as the notification of the first screen-on event is not sent to all screen-on service modules.

[0007] In some implementations, the electronic device can set which screen-on events belong to the restricted screen-on events. For example, the electronic device can determine whether a screen-on event belongs to the restricted screen-on events based on one or more of the following dimensions: whether a screen-on event of a certain type is generated by a user's active triggering, whether the number of screen-on events of a certain type generated within a certain time period exceeds a preset threshold, whether the interval between the generation times of two adjacent screen-on events exceeds a preset threshold, whether the user operates the electronic device after a screen-on event of a certain type is generated, whether the screen-on triggered after a screen-on event of a certain type is generated only has a prompt function, whether a screen-on event is generated within a preset time period and sent to all screen-on service modules, and the like.

[0008] By implementing the above method, the electronic device does not need to send a screen-on event to all screen-on service modules every time a screen-on event is generated, which can reduce certain power consumption.

[0009] In combination with the first aspect, in some implementations, the electronic device starts the first service module based on the first screen-on event and does not start the second service module, specifically including: the electronic device generates a first screen-on notification based on the first screen-on event; and the electronic device sends the first screen-on notification to the first service module and does not send the first screen-on notification to the second service module.

[0010] In this way, the screen-on service modules in the electronic device can determine whether to perform a service related to a screen-on event by whether a screen-on event notification is received.

[0011] In combination with the first aspect, in some implementations, the electronic device further includes an input management module, a power management module, and a display management module, and the electronic device generates a first screen-on event, specifically including: the electronic device generates the first screen-on event through the input management module or a first application; and the electronic device sends the first screen-on notification to the first service module and does not send the first screen-on notification to the second service module, specifically including: the electronic device generates the first screen-on notification through the power management module or the display management module, and sends the first screen-on notification to the first service module and does not send the first screen-on notification to the second service module.

[0012] In some implementations, the first screen-on event can be generated by the input management module or by the first application. The first screen-on notification can be generated by the power management module or by the display management module. Further, the first screen-on notification can be sent by the power management module or by the display management module.

[0013] In some implementations, before the electronic device generates the first screen-on event, the method further includes: the electronic device receiving a first operation; or, the electronic device receiving a voice instruction; or, the electronic device generating a message of the first application; or, the electronic device receiving an incoming call; or, the electronic device connecting a power source; or, the electronic device establishing a Bluetooth connection; or, the electronic device detecting a case opening; or, the electronic device detecting a proximity light moving away; or, the electronic device detecting a user action as a first action.

[0014] In some implementations, the electronic device triggers the generation of the first screen-on event in different ways, and the type of the first screen-on event is also different. Based on the above-mentioned ways of generating a screen-on event, the type of the screen-on event can include: wrist lifting screen-on, key pressing screen-on, message notification screen-on, double-click screen-on, incoming call screen-on, charging screen-on, fingerprint recognition screen-on, voice wake-up screen-on, case opening screen-on, and proximity light moving away screen-on. In the embodiments of the present application, this is not limited.

[0015] In some implementations, the electronic device can set corresponding restriction rules for the restriction screen-on event. The restriction rules corresponding to different types of restriction screen-on events can be the same or different, and this is not limited. The restriction rules can be used to send a notification of the restriction screen-on event to the screen-on service module when certain conditions are met.

[0016] In this way, the electronic device does not need to send a notification of the restriction screen-on event to all screen-on service modules every time the restriction screen-on event is generated, and the power consumption of the electronic device can be reduced to some extent.

[0017] In some implementations, the first service module belongs to a service module of a white-list application or a service module of a foreground application, and the second service module does not belong to a service module of a white-list application and a service module of a foreground application. The rules set by the electronic device for the first screen-on event can be rule 2 or rule 3.

[0018] That is, the electronic device can only send a notification of the first screen-on event to a service module of a white-list application or a service module of a foreground application. In this way, the power consumption can be reduced to some extent.

[0019] In some implementations of the first aspect, the time duration between the generation time of the first screen-on event and the generation time of the most recent previous screen-on event is greater than a first threshold. The rule set by the electronic device for the first screen-on event can be the intersection of rule 2 or rule 3 and rule 4. That is, the electronic device can send the first screen-on event to the business module belonging to the whitelist application or the foreground application in the case that the time duration between the generation of the first screen-on event and the generation of the previous screen-on event exceeds the time duration threshold, so as to further reduce power consumption.

[0020] In some implementations of the first aspect, the number of screen-on events generated by the electronic device within a first time duration before the generation of the first screen-on event is greater than a second threshold. That is, the electronic device can send the first screen-on event to the business module belonging to the whitelist application or the foreground application in the case that the number of screen-on events generated by the electronic device within the preset time duration before the generation of the first screen-on event is greater than the number threshold, so as to further reduce power consumption.

[0021] In some implementations of the first aspect, after the electronic device starts the first business module and does not start the second business module based on the first screen-on event, the method further includes: the electronic device receiving a second operation; and the electronic device starting the second business module, the second business module belonging to a business module that monitors an event corresponding to the second operation.

[0022] In some implementations, the electronic device receives a user operation after the screen is turned on. This indicates that the user will subsequently use the electronic device with a high probability. Therefore, after the electronic device receives the second operation when the screen is turned on, the electronic device can send the notification of the first screen-on event to other screen-on business modules (including the second business module) that have not been sent before, to ensure that all screen-on business modules receive the notification of the first screen-on event.

[0023] In this way, power consumption can be reduced while ensuring that the electronic device can normally provide services when the user subsequently wants to use the electronic device.

[0024] In some implementations of the first aspect, after the electronic device starts the first business module and does not start the second business module based on the first screen-on event, the method further includes: the electronic device receiving a second operation; and after the electronic device receives the second operation for a second time duration, the electronic device starting the second business module, the second business module belonging to a business module that monitors an event corresponding to the second operation.

[0025] In some implementations, the waiting for the second time duration before restarting the second service module is to enable the electronic device to perform the function related to the second operation first, so as to avoid the electronic device sending the notification of the first screen-on event from occupying the memory, CPU and other computing resources for performing the function related to the second operation, thereby affecting the corresponding function characteristics.

[0026] In this way, the electronic device can immediately perform the function related to the second operation after receiving the second operation, and the user experience is good.

[0027] In combination with the first aspect, in some implementations, after the electronic device starts the first service module based on the first screen-on event and does not start the second service module, the method further includes: the electronic device generates a first screen-off event; the electronic device switches from screen-on to screen-off based on the first screen-off event; and the electronic device closes the first service module based on the first screen-off event.

[0028] In combination with the first aspect, in some implementations, after the electronic device starts the second service module, the method further includes: the electronic device generates a first screen-off event; the electronic device switches from screen-on to screen-off based on the first screen-off event; and the electronic device closes the first service module and / or the second service module based on the first screen-off event.

[0029] In some implementations, the electronic device can send the notification of the first screen-off event to all service modules that have received the notification of the first screen-on event. That is, the electronic device sends the notification of the first screen-on event to the first service module and the second service module, and the electronic device can also send the notification of the first screen-off event to the first service module and the second service module. Then the electronic device can close the first service module and the second service module based on the first screen-off event. This is because if a service module that has received the notification of the first screen-on event has not received the notification of the first screen-off event, then next time the electronic device generates a screen-on event, these service modules can continuously receive two notifications of the screen-on event, which can cause the electronic device to malfunction during operation. Therefore, the electronic device should. In this way, on the basis of reducing power consumption, the electronic device can also avoid malfunctioning and improve the stability of the electronic device.

[0030] In a possible implementation, the electronic device can send a notification of the first screen-out event based on the restriction rule of the first screen-out event. That is, the electronic device does not care which service module the first screen-on event is sent to at this time, and the electronic device can send the restriction rule of the first screen-out event to the first service module and / or the second service module based on the restriction rule of the first screen-out event, and then the electronic device can close the first service module and / or the second service module based on the first screen-out event. In this case, the sending condition of the notification of the first screen-out event can be different from the sending condition of the notification of the first screen-on event. The electronic device can first determine whether the first screen-out event belongs to the restricted screen-out event, and if it belongs, the electronic device can send the notification of the first screen-out event based on the restriction rule of the first screen-out event. If it does not belong, the electronic device can send the notification of the first screen-out event to all screen-out service modules. Specifically, the electronic device can determine whether the first screen-out event belongs to the restricted screen-out event based on the type of the first screen-out event. In the case that the electronic device does not receive a user operation between generating the first screen-on event and generating the first screen-out event, the electronic device can determine that the first screen-out event is a restricted screen-out event based on the first screen-on event being a restricted screen-on event, and can determine that the first screen-out event is an unrestricted screen-out event based on the first screen-on event not being a restricted screen-on event. In the case that the electronic device receives a user operation between generating the first screen-on event and generating the first screen-out event, the electronic device can determine that the first screen-out event is an unrestricted screen-out event.

[0031] In combination with the first aspect, in some implementations, before the electronic device generates the first screen-out event, the method further includes that the electronic device receives a third operation, or the electronic device receives a voice instruction, or the electronic device does not receive a fourth operation within a third time length, or the electronic device detects that the housing is closed, or the electronic device detects that the proximity light is close.

[0032] In some implementations, the electronic device triggers the generation of the first screen-out event in different ways, and the type of the first screen-out event is different. Based on the above-mentioned way of generating the screen-out event, the type of the screen-out event can include: wrist drop screen-out, key screen-out, timeout screen-out, housing closing screen-out, and proximity light close screen-out. In the embodiments of the present application, this is not limited.

[0033] In some implementations, the electronic device can set a corresponding restriction rule for the restricted screen-out event. The corresponding restriction rules of different types of restricted screen-out events can be the same or different, and this is not limited. The restriction rule can be used to send a notification of the restricted screen-out event to a screen-out service module under certain conditions.

[0034] In this way, the electronic device does not need to send a notification of the limited screen-off event to all screen-off service modules each time the limited screen-off event is generated, and power consumption of the electronic device can be reduced to some extent.

[0035] In some implementations, based on the first on-screen event, the electronic device starts the first service module and does not start the second service module, specifically including: the electronic device determines, according to a type of the first on-screen event, to start the first service module and not to start the second service module.

[0036] In some implementations, before the electronic device generates the first on-screen event, the electronic device has determined which types of on-screen events are limited on-screen events and corresponding limitation rules.

[0037] In this way, the electronic device can determine, based on the type of the first on-screen event, whether the first on-screen event is a limited on-screen event. If it is, the electronic device can further determine the corresponding limitation rule, and then determine to start the first service module and not to start the second service module.

[0038] In some implementations, after the electronic device closes the first service module based on the first on-screen event, the method further includes: the electronic device generates a second on-screen event; the electronic device switches from screen-off to on-screen based on the second on-screen event; and the electronic device starts the first service module and the second service module based on the second on-screen event, a time length between a generation time of the second on-screen event and a generation time of the first on-screen event is greater than a first threshold, and the first on-screen event is the most recently generated on-screen event before the second on-screen event.

[0039] The rule set by the electronic device for the second on-screen event can be a single rule 4.

[0040] That is, the electronic device can send a notification of the second on-screen event to all on-screen service modules when a time length between the generation of the second on-screen event and the generation of the previous on-screen event exceeds a time length threshold. In this way, normal operation of all on-screen service modules in the electronic device can be ensured.

[0041] In some implementations, after the electronic device closes the first service module based on the first on-screen event, the method further includes: the electronic device generates a second on-screen event; the electronic device switches from screen-off to on-screen based on the second on-screen event; and the electronic device starts the first service module and the second service module based on the second on-screen event, a time length between a generation time of the second on-screen event and a generation time of the first on-screen event is greater than a first threshold, and the first on-screen event is the most recently generated on-screen event before the second on-screen event.

[0042] The rule set by the electronic device for the second screen-on event can be a single rule 5.

[0043] That is, the electronic device can send the notification of the second screen-on event to all screen-on service modules in a case where the number of screen-on events generated by the electronic device within a preset time period before the generation of the second screen-on event is greater than a number threshold. In this way, the normal operation of all screen-on service modules in the electronic device can be ensured.

[0044] In some implementations, when the restriction rule corresponding to the second screen-on event is a single rule 6, the electronic device starts the first service module and the second service module based on the second screen-on event in a case where the power is turned on. That is, the electronic device can send the notification of the second screen-on event to all screen-on service modules.

[0045] In combination with the first aspect, in some implementations, after the electronic device closes the first service module based on the first screen-on event, or after the electronic device closes the first service module and the second service module based on the first screen-off event, the method further includes: the electronic device generates a third screen-on event; the electronic device switches from screen-off to screen-on based on the third screen-on event; the electronic device starts the second service module and does not start the first service module based on the third screen-on event; or the electronic device does not start the first service module and the second service module based on the third screen-on event, wherein the type of the third screen-on event is different from the type of the first screen-on event.

[0046] For example, when the restriction rule corresponding to the third screen-on event is a single rule 1, the electronic device does not start the first service module and the second service module based on the third screen-on event, that is, the electronic device does not send the notification of the third screen-on event to any screen-on service module. In this way, different types of screen-on events can be provided with different restriction rules, and thus, after the electronic device generates different types of screen-on events, the electronic device can send the notification of different types of screen-on events to different screen-on service modules based on different restriction rules, so that the electronic device can start different screen-on service modules.

[0047] In some implementations of the first aspect, the electronic device generates a fourth on-screen event; the electronic device switches from off-screen to on-screen based on the fourth on-screen event; the electronic device starts the first service module or the second service module based on the fourth on-screen event, the electronic device generates a fifth on-screen event; the electronic device switches from off-screen to on-screen based on the fifth on-screen event; the electronic device starts the first service module and the second service module based on the fifth on-screen event; wherein the fourth on-screen event is any on-screen event generated within a fourth time period, the fourth time period is a period of time before the electronic device generates the fifth on-screen event, and the end time of the fourth time period is the time when the fifth on-screen event is generated.

[0048] The notification of the fourth on-screen event is only sent to the first service module or the second service module, that is, the notification of the fourth on-screen event is not sent to all on-screen service modules, and the fifth on-screen event adopts the restriction rule 7. The fourth on-screen event can adopt a single rule, such as rule 2 or rule 3. The fourth on-screen event can also adopt multiple superimposed rules. In the embodiments of the present application, the rule adopted for the fourth on-screen event is not limited, as long as the notification of the fourth on-screen event is not sent to all on-screen service modules. When the electronic device determines that all on-screen event modules have not received the notification of the on-screen event within the fourth time period before the generation of the fifth on-screen event, the electronic device can send the notification of the fifth on-screen event to the first service module and the second service module, that is, the notification of the fifth on-screen event is sent to all on-screen service modules. In this way, the normal operation of all on-screen service modules in the electronic device can be ensured.

[0049] In some implementations, the electronic device generates a sixth on-screen event; the electronic device switches from off-screen to on-screen based on the sixth on-screen event; the electronic device starts the first service module and the second service module based on the sixth on-screen event, the electronic device generates a seventh on-screen event; the electronic device switches from off-screen to on-screen based on the seventh on-screen event; the electronic device does not start the first service module and the second service module based on the seventh on-screen event; wherein the sixth on-screen event is an on-screen event generated within a fifth time period, the fifth time period is a period of time before the electronic device generates the seventh on-screen event, and the end time of the fifth time period is the time when the seventh on-screen event is generated.

[0050] The notification of the sixth screen-on event is sent to the first service module and the second service module, that is, the notification of the sixth screen-on event is sent to all screen-on service modules. The restriction rule adopted by the seventh screen-on event is rule 7. The sixth screen-on event can adopt a single rule, such as rule 4, rule 5, and the like. The sixth screen-on event can also adopt multiple rules in superposition. In the embodiments of the present application, the rule adopted for the sixth screen-on event is not limited, as long as the notification of the sixth screen-on event is sent to all screen-on service modules. The electronic device does not send the notification of the seventh screen-on event to the first service module and the second service module, when it is determined that all screen-on event modules have received the notification of the screen-on event within the fifth time length before the seventh screen-on event is generated.

[0051] In a second aspect, the present application provides an electronic device, comprising a memory, a processor, and computer instructions stored in the memory, wherein the processor executes the computer program to implement the method of the first aspect or any of the implementation manners of the first aspect.

[0052] In a third aspect, the embodiments of the present application provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method of the first aspect or any of the implementation manners of the first aspect.

[0053] In a fourth aspect, the embodiments of the present application provide a computer program product, which contains computer instructions, and the computer instructions are executed by a processor to implement the method of the first aspect or any of the implementation manners of the first aspect.

[0054] The beneficial effects of the second aspect to the fourth aspect can refer to the beneficial effects of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0055] FIG. 1 is a flow diagram of a method for processing screen-on and screen-off events according to an embodiment of the present application;

[0056] FIG. 2 is an OS interaction diagram of an electronic device when processing a screen-on event according to an embodiment of the present application;

[0057] FIG. 3 is an OS interaction diagram of an electronic device when processing a screen-off event according to an embodiment of the present application;

[0058] FIG. 4 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application;

[0059] FIG. 5 is a schematic diagram of the software structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " represents the meaning of or, for example, A / B can represent A or B; the "and / or" in the text only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0061] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" is two or more than two.

[0062] Some terms provided by the embodiments of the present application are introduced below.

[0063] The screen-on event refers to an event that triggers the screen of the electronic device to switch from the off or sleep state to the on or active state, that is, the electronic device switches from the screen-off to the screen-on. The screen-on event can be generated after the electronic device receives a user operation, and can also be generated by the electronic device based on an installed application or a mounted sensor.

[0064] For example, the electronic device can generate a screen-on event in response to a user operation, which can include but is not limited to: a double-click screen operation, a touch screen specified area operation, a press power key operation, a press volume key operation. The electronic device can also generate a screen-on event in response to a hovering gesture or a voice instruction. The electronic device can also generate a screen-on event in response to a message. The message can include: an alarm clock set by an alarm clock application, an incoming call received by a call application, a notification message of a chat application, a message of a system application, etc. The electronic device can also generate a screen-on event in response to connecting to a power source. The electronic device can also generate a screen-on event in response to establishing a Bluetooth connection. The electronic device can also generate a screen-on event when detecting that the case is opened, for example, the case opening can mean that the leather sheath wrapping the electronic device is removed, the watchband of the wearable electronic device is removed. The electronic device can also generate a screen-on event after detecting that the proximity light is away. The proximity light away means that when an object moves away from the proximity light sensor, the proximity light sensor detects that the distance of the object increases. For example, the proximity light away can mean that during a call, the user's ear moves away from the electronic device. In the case of an electronic device as a wearable device, the wearable electronic device can also detect a user's wrist lifting action to generate a screen-on event.

[0065] In the embodiments of the present application, the above-mentioned how to generate the screen-on event is only illustrative, and more or less ways can be used to generate the screen-on event.

[0066] The screen-off event refers to an event that triggers the screen of the electronic device to switch from an open or active state to a closed or dormant state, i.e., the electronic device switches from screen-on to screen-off. Similarly, the screen-off event can be generated after the electronic device receives a user operation, or can be generated by the electronic device based on its own software or hardware. The above-mentioned screen-on event and screen-off event can be collectively referred to as screen-on and screen-off events. For example, the electronic device can generate a screen-off event in response to a user operation, which can include but is not limited to: an operation of touching a screen-off control displayed on the screen, an operation of pressing a power button. The electronic device can also generate a screen-off event in response to a hovering gesture or a voice instruction. The electronic device can also generate a screen-off event based on not receiving a user operation within a preset time period. The electronic device can also generate a screen-on event when detecting that the case is opened, for example, the case opening can refer to the removal of a leather case that wraps the electronic device, or the removal of a watchband of a wearable electronic device. The electronic device can also generate a screen-off event after detecting that the proximity light is close. The proximity light close refers to the object moving away from the proximity of the proximity light sensor, and the proximity light sensor detects that the distance of the object decreases. For example, the proximity light close can refer to the user's ear close to the electronic device during a call. In the case of the electronic device being a wearable device, the wearable electronic device can also detect a user's wrist drop action to generate a screen-off event.

[0067] The business module refers to a component or unit integrated in the electronic device and capable of running, which implements one or a group of related business functions. For example, the business module includes: a function module for starting Bluetooth connection, a function module for providing communication, a user behavior monitoring module, and the like. Among them, the business module can refer to a software module in the electronic device, or can refer to a hardware module in the electronic device, or can refer to a software module and a hardware module in the electronic device, and the embodiments of the present application do not limit this.

[0068] The business module that monitors the screen-on event (referred to as the screen-on business module) can refer to the business module that registers the screen-on event in the electronic device. That is, the screen-on business module can be notified and start to execute the corresponding function after the screen of the electronic device switches to the open or active state. The screen-on business module executing the corresponding function can ensure the normal operation of the electronic device to a certain extent. The screen-on business module can be set by the developer during the development stage of the electronic device. For example, when the screen-on business module includes a user behavior monitoring module, the user behavior monitoring module can collect operation data of the user using the electronic device and analyze the user's usage habits after the electronic device switches to screen-on.

[0069] The screen-off event monitoring service module (referred to as a screen-off service module) can refer to a service module in the electronic device that registers a screen-off event. That is, the screen-off service module can be notified and execute or stop executing a corresponding function after the screen of the electronic device switches to a screen-off. The screen-off service module can also be set by the developer during the development stage of the electronic device. For example, when the screen-off service module includes a user behavior monitoring module, the user behavior monitoring module can stop collecting operation data of the user using the electronic device and analyzing the usage habits of the user after the electronic device switches to a screen-off.

[0070] In some implementations, the screen-on service module and the screen-off service module can include the same service module or different service modules, depending on the settings of the electronic device during the development stage.

[0071] In some implementations, the electronic device sends a notification of a screen-on event (referred to as a screen-on notification) to all service modules that monitor the screen-on event after the electronic device generates the screen-on event each time. After receiving the notification, the screen-on service module executes a corresponding function or service. Then, the more screen-on service modules, the greater the power consumption of the electronic device. In some scenarios, it is not required that all screen-on service modules execute their corresponding services after the screen-on event is generated. For example, the electronic device is a wearable device, and the electronic device generates a screen-on event after detecting a wrist lifting action of the user, and then switches to a screen-on. In this wrist lifting screen-on scenario, the user can only want to view the current time and does not want to use other functions of the electronic device. If the electronic device sends the notification of the screen-on event to all screen-on service modules at this time, it can cause unnecessary power consumption of the electronic device. Further, if the user performs more manual operations, the number of wrist lifting actions detected by the electronic device will also be more, almost thousands of times, so the power consumption wasted by the electronic device is more. In the embodiments of the present application, it is not limited to the above screen-on scenario, and can also include more scenarios in which all screen-on service modules do not need to execute their corresponding functions.

[0072] To reduce the above problems, the embodiments of the present application provide a method for processing screen-on and screen-off events. In this method, the electronic device can set a limited range of screen-on events and corresponding limitation rules. After receiving a notification of a screen-on event, the electronic device sends the notification of the screen-on event to the corresponding screen-on service module based on the corresponding limitation rules of the screen-on event if the screen-on event belongs to the limited range. In this way, the electronic device does not need to send the notification of the screen-on event to all screen-on service modules each time a screen-on event is generated, and can reduce a certain power consumption.

[0073] Further, when the screen is on, if the electronic device receives a user operation, the electronic device can send a notification of the screen-on event to all or part of the screen-on service modules that have not received the notification of the screen-on event. In this way, the normal operation of the electronic device can be ensured.

[0074] Still further, after the screen of the electronic device is turned on, a screen-off event is generated, and the notification of the screen-off event can be sent to the corresponding service module based on the sending of the notification of the previous screen-on event of the screen-off event. In this way, the stable operation of the service module in the electronic device can be ensured.

[0075] The method for processing the screen-on and screen-off events provided in the embodiments of the present application will be described below.

[0076] FIG. 1 exemplarily shows a flowchart of a method for processing screen-on and screen-off events provided in the embodiments of the present application. The method comprises the following steps.

[0077] S101, the electronic device sets a screen-on event that belongs to a limited range of screen-on events, and a corresponding limitation rule.

[0078] In the embodiments of the present application, the screen-on event that belongs to the limited range of screen-on events can be referred to as a limited screen-on event.

[0079] Before performing S101, the electronic device can obtain various types of screen-on events. That is, the electronic device can determine which ways can generate a screen-on event. The type of the screen-on event refers to the way in which the electronic device generates the screen-on event. For example, the screen-on event generated by the electronic device in response to detecting a user's wrist lifting action is a wrist lifting screen-on event. The screen-on event generated by the electronic device in response to the user's pressing a key is a key pressing screen-on event. The screen-on event generated by the electronic device in response to generating a message can be a message notification screen-on event. The screen-on event generated by the electronic device in response to the user's double-clicking the screen is a double-click screen-on event. The screen-on event generated by the electronic device in response to receiving an incoming call is an incoming call screen-on event. The screen-on event generated by the electronic device in response to turning on the power is a charging screen-on event. The screen-on event generated by the electronic device in response to touching a specified area on the screen is a fingerprint recognition screen-on event. The screen-on event generated by the electronic device in response to the user's voice is a voice wake-up screen-on event. The screen-on event generated by the electronic device in response to opening the shell wrapped on the electronic device is a shell opening screen-on event. The screen-on event generated by the electronic device in response to the proximity light moving away is a proximity light moving away screen-on event. In the embodiments of the present application, the above-mentioned ways in which the electronic device generates the screen-on event are only exemplary, and more or less ways of generating the screen-on event can be included, which are not limited in this regard.

[0080] Exemplarily, based on the above-mentioned manner of generating the screen-on event, the type of the screen-on event can include: wrist-lifting screen-on, key-press screen-on, message notification screen-on, double-click screen-on, incoming call screen-on, charging screen-on, fingerprint recognition screen-on, voice wake-up screen-on, shell opening screen-on, and proximity light moving away screen-on. In the embodiments of the present application, this is not limited.

[0081] In some implementations, the electronic device can determine whether the screen-on event belongs to the limited range of screen-on events through one or more of the following dimensions: whether a screen-on event of a certain type is generated by user active triggering, whether the number of generation of a screen-on event of a certain type within a certain time length exceeds a preset threshold, whether the interval between the generation time of two adjacent screen-on events exceeds a preset threshold, whether the user will operate the electronic device after the generation of a screen-on event of a certain type, whether the screen-on triggered after the generation of a screen-on event of a certain type only has a prompt function, whether a screen-on event is generated within a preset time length and sent to all screen-on service modules, and the like.

[0082] Exemplarily, the electronic device can determine that the screen-on event generated by user active triggering does not belong to the limited range of screen-on events, and can also determine that the screen-on event whose generation number within a certain time length exceeds a preset threshold belongs to the limited range of screen-on events, and can also determine that the screen-on event generated in the case that the user will not operate the electronic device with a high probability after the screen-on is triggered belongs to the limited range, and can also determine that the screen-on event generated in the case that the triggered screen-on only has a prompt function belongs to the limited range.

[0083] In the embodiments of the present application, the above-mentioned several ways of determining whether it belongs to the limited range of screen-on events are only exemplary, and more or less ways can also be included, which are not limited.

[0084] Exemplarily, the following will introduce the limited range of screen-on events set by the electronic device in combination with Table 1.

[0085] Table 1

[0086] As can be seen from Table 1, the wrist-lifting screen-on, message notification screen-on, incoming call screen-on, shell opening screen-on, Bluetooth connection screen-on, and proximity light moving away screen-on belong to the limited range of screen-on events. The key-press screen-on, double-click screen-on, charging screen-on, fingerprint recognition screen-on, and voice wake-up screen-on do not belong to the limited range of screen-on events.

[0087] Among them, the electronic device divides the wrist-lifting screen-on event into a dimension in which the user is less likely to operate and the generation frequency is high. This is because, in the case of wearing an electronic device (for example, a wearable device), many times the user is not lifting the wrist to make the electronic device screen on, but the user is unconsciously lifting the wrist in the process of activity, which will make the electronic device generate many times of wrist-lifting screen-on event in a day. Therefore, in order to reduce power consumption, the electronic device can set the wrist-lifting screen-on event to belong to the limited range of screen-on events.

[0088] The electronic device can divide the key screen-on event, double-click screen-on event, fingerprint recognition screen-on event, and voice wake-up screen-on event into a dimension that is actively triggered by the user and the user is more likely to operate the electronic device after triggering the screen-on. This is because, in general, after the user actively operates to make the electronic device screen on, the user is more likely to continue using the electronic device after the screen is on, and the execution of the corresponding business by the screen-on business module can ensure the normal operation of the electronic device. Therefore, in order to ensure that the user has a good experience in using the electronic device, the electronic device can set the key screen-on event, double-click screen-on event, fingerprint recognition screen-on event, and voice wake-up screen-on event to not belong to the limited range of screen-on events.

[0089] The electronic device can divide the message notification screen-on event and the incoming call screen-on event into a dimension that is not actively triggered by the user. This is because messages or incoming calls are messages received by the electronic device, and the electronic device is in a passive position. That is, the user may not necessarily use the functions of the electronic device or the user may only use the function of sending messages or answering calls of the electronic device, and not all screen-on business modules need to execute corresponding businesses. Therefore, in order to reduce power consumption, the electronic device can set the message notification screen-on event and the incoming call screen-on event to belong to the limited range of screen-on events.

[0090] The electronic device can divide the shell opening screen-on event, Bluetooth connection screen-on event, and proximity light away screen-on event into a dimension that the triggered screen-on only has a prompt function. This is because after triggering the screen-on with only a prompt function, the user may only be inclined to understand the specific content of the prompt, such as shell opening, Bluetooth connection, and proximity light away. After understanding the prompt content, the user is less likely to use the electronic device, and not all screen-on business modules need to execute corresponding businesses. Therefore, in order to reduce power consumption, the electronic device can set the shell opening screen-on event, Bluetooth connection screen-on event, and proximity light away screen-on event to belong to the limited range of screen-on events.

[0091] The electronic device can divide the charging screen-on event into a dimension in which the user is less likely to operate and the number of generation is large. This is because there is a case where the electronic device is not stably connected to the power supply, that is, the electronic device is not in good contact with the power supply, and in this case, the electronic device can generate a plurality of charging screen-on events. However, the user is also less likely to use the electronic device in this case, and all screen-on service modules do not need to perform the corresponding service. Therefore, in order to reduce power consumption, the electronic device can set the charging screen-on event to belong to the limited range of the screen-on event. Alternatively, in the case where the connection to the power supply is stable, the electronic device can also set the charging screen-on event to not belong to the limited range of the screen-on event.

[0092] In the embodiments of the present application, the limited range of the screen-on event set by the electronic device shown in Table 1 above is only illustrative, and the limited range of the screen-on event can also be set according to the actual use experience of the user and other factors, which is not limited.

[0093] In some implementations, the electronic device sets a corresponding limit rule for each type of limited screen-on event. The limit rules corresponding to different types of limited screen-on events can be the same or different, which is not limited. Among them, the limit rule can be used to send the notification of the limited screen-on event to the screen-on service module when a certain condition is met. In this way, the electronic device does not need to send the notification of the limited screen-on event to all screen-on service modules every time the limited screen-on event is generated, which can reduce the power consumption of the electronic device to a certain extent.

[0094] In some implementations, the limit rule can be set based on the dimensions of the limited screen-on event described above, or from the dimensions of the screen-on service module.

[0095] For example, the limit rule can include one or more of the following rules:

[0096] Rule 1: Do not send the notification of the limited screen-on event to any screen-on service module. That is, if a certain limited screen-on event applies rule 1, the electronic device will not send the notification of the limited screen-on event to any screen-on service module, and the limited screen-on event is only used to trigger the electronic device to turn on the screen.

[0097] Rule 2: Send the notification of the limited screen-on event to the screen-on service module of the white list application. That is, if a certain limited screen-on event applies rule 2, the electronic device will not send the notification of the limited screen-on event to any screen-on service module of a non-white list application. The white list application can be set by the electronic device. Alternatively, for different types of limited screen-on events, the white list application can be different or the same.

[0098] Rule 3: the notification of the screen-on event is sent to the screen-on service module of the foreground application. That is, if a screen-on event applies rule 3, the electronic device will not send the notification of the screen-on event to the screen-on service module of any non-foreground application. The foreground application can refer to the application to which the user interface displayed after the screen of the electronic device is turned on belongs, for example, the application to which the user interface displayed by the floating window in the screen, the non-floating window, the upper and lower split screen, and the like belongs.

[0099] Rule 4: if the time interval between the generation of the current screen-on event and the generation of the previous screen-on event exceeds the time threshold, the notification of the current screen-on event is sent to all screen-on service modules. If the current screen-on event applies rule 4, the notification of the current screen-on event will not be sent to all screen-on service modules if the time interval between the generation of the current screen-on event and the generation of the previous screen-on event is less than or equal to the time threshold. For example, the time threshold in rule 4 is set to 2 hours, the electronic device generates a screen-on event x with rule 4 on September 28, 10:00, at this time, if the electronic device detects that the last screen-on event was generated on September 29, 7:00, the time interval between the screen-on event x and the last screen-on event exceeds 2 hours, and the electronic device can send the notification of the screen-on event x to all screen-on service modules. In this way, if the screen-on service module does not receive the notification of the screen-on event within a period of time, the electronic device will send the notification of the newly generated screen-on event to all screen-on service modules to ensure the normal operation of the electronic device.

[0100] Further, if the previous screen-on event is a screen-on event, the electronic device sets a shorter time threshold; if the previous screen-on event is not a screen-on event, the electronic device sets a longer time threshold. This is because the notification of the screen-on event may not be sent to all screen-on service modules, therefore, in order to ensure that all screen-on service modules can obtain the notification of the screen-on event based on a shorter time interval, the electronic device sets a shorter time threshold in the case that the previous screen-on event is a screen-on event.

[0101] Rule 5: If the number of the screen-on events generated by the electronic device is greater than the number threshold within the preset time period before the generation of the current limit screen-on event, the electronic device sends the notification of the current limit screen-on event to all the screen-on service modules. If the current limit screen-on event applies Rule 5, the number of the screen-on events generated by the electronic device is less than or equal to the number threshold within the preset time period before the generation of the current limit screen-on event, the electronic device does not send the notification of the current limit screen-on event to all the screen-on service modules. Since the electronic device generates the screen-on events exceeding the number threshold within the preset time period, the screen-on events include the limit screen-on events and the non-limit screen-on events. The electronic device can not guarantee that all the screen-on service modules receiving the notification of the screen-on events do not have errors in performing the corresponding functions. Therefore, in order to improve the fault tolerance and avoid errors in the screen-on service modules performing the corresponding functions, the electronic device sets Rule 5. That is, after the electronic device generates the screen-on events exceeding the number threshold within the preset time period, if the electronic device generates a screen-on event again, the electronic device sends the notification of the screen-on event to all the screen-on service modules, so that the screen-on service modules having errors can normally operate.

[0102] Optionally, Rule 5 can also be that the electronic device can send the notification of the current limit screen-on event to the screen-on service modules if the number of the limit screen-on events generated by the electronic device is greater than the number threshold within the preset time period before the generation of the current limit screen-on event. Since the electronic device generates the limit screen-on events exceeding the number threshold within the preset time period, it is possible that not all the screen-on service modules receive the notification of the screen-on events. Therefore, in order to ensure the normal operation of the electronic device, the electronic device sets the optional Rule 5. That is, after the electronic device generates the limit screen-on events exceeding the number threshold within the preset time period, if the electronic device generates a screen-on event again, the electronic device sends the notification of the screen-on event to all the screen-on service modules, so that all the screen-on service modules can receive the notification of the screen-on event at intervals, ensuring the normal operation of the electronic device.

[0103] Rule 6: The electronic device sends the notification of the limit screen-on event to all the screen-on service modules when the electronic device is connected to the power supply. If the current limit screen-on event applies Rule 6, the electronic device does not send the notification of the limit screen-on event to all the screen-on service modules when the electronic device is not connected to the power supply. This is because, when the electronic device is connected to the power supply, the electronic device does not need to consider the battery endurance, and the screen-on service modules of the electronic device can perform the corresponding tasks when the electronic device is connected to the power supply. When the electronic device is not connected to the power supply, the screen-on service modules do not need to perform the corresponding tasks, which can save power consumption.

[0104] In a possible implementation, the rule 4 and the rule 6 can be used in superposition. In this case, the electronic device can avoid the case that the electronic device continuously sends the notification of the limited screen-on event to all the screen-on service modules for multiple times when the power connection is poor, thereby saving power consumption. For example, if the electronic device applies the rule 4 and the rule 6 at the same time, the time threshold set by the rule 4 is 1 hour, the electronic device generates a screen-on event at 8 o'clock, and then the electronic device is in the state of power connection from 10 o'clock to 11 o'clock, and 10 screen-on events are generated between 10 o'clock and 11 o'clock due to poor power connection. Then, the electronic device will only send the first generated screen-on event generated between 10 o'clock and 11 o'clock to all the screen-on service modules, and the last 9 generated screen-on events will not be sent to all the screen-on service modules.

[0105] Rule 7: If the notification of the screen-on event generated by the electronic device is not sent to all the screen-on service modules within a preset time period before the generation of the current limited screen-on event, the electronic device sends the notification of the current limited screen-on event to all the screen-on service modules. If the current limited screen-on event applies the rule 7, and there is a screen-on event whose notification is sent to all the screen-on service modules in the screen-on events generated by the electronic device within the preset time period before the generation of the current limited screen-on event, the electronic device will not send the notification of the current limited screen-on event to the screen-on service modules.

[0106] In some implementations, the electronic device can record the generation time of the screen-on event to which the notification sent to all the screen-on service modules last time belongs. Then the electronic device can determine whether the time difference between the generation time of the current limited screen-on event and the generation time of the screen-on event to which the notification sent to all the screen-on service modules last time belongs is greater than a preset time period. If the time difference is greater than the preset time period, the rule 7 is met.

[0107] In a possible implementation, the electronic device generally uses one or more of the rules 1 to 6 in superposition when the rule 7 is used. If the electronic device does not use any of the rules 1 to 6, the notification of the screen-on event generated by the electronic device will be sent to all the screen-on service modules. That is, in the screen-on events generated by the electronic device within the preset time period before the generation of the current limited screen-on event, there can be limited screen-on events that use one or more of the rules 1 to 6.

[0108] For example, the preset time length set in rule 7 is 1 hour, the electronic device generates a limited screen-on event x with rule 7 at 10:00 on September 29, at this time, if the electronic device detects that 3 screen-on events are generated between 9:00 and 10:00 on September 29, and the notifications of the 3 screen-on events are not sent to all screen-on service modules but only to part of the screen-on service modules, the electronic device can send the above limited screen-on event x to all screen-on service modules. In this way, the electronic device can avoid the situation that although multiple screen-on events are generated within a certain time length, the notifications of the screen-on events are not received by all screen-on service modules within the time length. Sending the notification of the limited screen-on event to all service modules in rule 7 can ensure the normal operation of the electronic device without the need to send the notification of the generated screen-on event to all screen-on service modules each time.

[0109] It should be noted that rule 1 is applicable to the limited screen-on event generated by the electronic device in the case that the user is less likely to use the electronic device after screen-on. Rule 2 is applicable to the limited screen-on event related to the white-listed application. Rule 3 is applicable to the limited screen-on event related to the foreground application. Rule 4, rule 5 and rule 7 are applicable to the limited screen-on event generated by the electronic device in the case that only a prompt function is required after screen-on. In the embodiments of the present application, neither sending the notification of the limited screen-on event to the screen-on service module each time nor sending the limited screen-on event to the screen-on service module each time can affect the normal operation of the electronic device and waste the power consumption of the electronic device. In order to balance the above two notification sending situations, the electronic device sets rule 4, rule 5 and rule 7. Rule 6 is applicable to the limited screen-on event set by the electronic device to be sent when charging.

[0110] That is, rule 1 is set based on the user's habit of using the electronic device, rule 2 and rule 3 are set based on the application to which the screen-on service module belongs, and rule 4, rule 5 and rule 7 are set based on the number of times of generating the screen-on event and the generation time. In the embodiments of the present application, the basis and consideration for setting the rules are only exemplarily described, and other basis and consideration can also be included, which are not limited.

[0111] In the embodiments of the present application, the above several limitation rules are only exemplarily described, and more or less limitation rules can also be included, which are not limited.

[0112] Exemplarily, the following introduces the restriction rules corresponding to the restriction screen-on events of the electronic device setting in combination with Table 2.

[0113] Table 2

[0114] As can be seen from Table 2, the restriction rule corresponding to the wrist-raising screen-on event is rule 1, the restriction rule corresponding to the message notification screen-on event is rule 2, the restriction rule corresponding to the incoming call screen-on event is rule 3, the restriction rule corresponding to the charging screen-on event is rule 4, the restriction rule corresponding to the shell opening screen-on event is rule 5, and the restriction rule corresponding to the Bluetooth connection screen-on event is rule 6.

[0115] The electronic device sets the restriction rule of the wrist-raising screen-on event as rule 1 for the following reasons: the electronic device generates the wrist-raising screen-on event based on the unintentional wrist-raising action of the user, and then the user will not use the electronic device subsequently. The electronic device generates the wrist-raising screen-on event based on the intentional wrist-raising action of the user, and then the user will probably check the time, and will not use the electronic device subsequently. Therefore, the restriction rule of the wrist-raising screen-on event includes: not sending the notification of the wrist-raising screen-on event to any screen-on service module. In another possible implementation manner, the electronic device sets the restriction rule of the wrist-raising screen-on event as rule 3, and at this time, the foreground application can include: a clock application.

[0116] The electronic device sets the restriction rule of the message notification screen-on event as rule 2 for the following reasons: the electronic device generates the screen-on event after obtaining the message. The electronic device can display the related information of the message in the user interface after screen-on, so that the user can directly view the message. Therefore, the restriction rule of the message notification screen-on event includes: sending the notification of the message notification screen-on event to the screen-on service module of the white list application. Exemplarily, the white list application set by the electronic device for the message notification screen-on event can include: a system application for displaying message information. The screen-on service module included in the white list application can execute, for example, the service of displaying the related information of the message in the user interface after screen-on.

[0117] The electronic device sets the restriction rule of the incoming call screen-on event as rule 3 for the following reasons: the electronic device directly switches from screen-off to the incoming call user interface after obtaining the incoming call. At this time, the application providing the incoming call function is the foreground application. The above-mentioned incoming call user interface is provided by the foreground application of the electronic device. Therefore, the restriction rule of the incoming call screen-on event includes: sending the notification of the incoming call screen-on event to the screen-on service module of the foreground application. The screen-on service module of the foreground application can execute, for example, the service of displaying the information such as the incoming call number, the answer control, the reject control, etc. in the incoming call user interface after screen-on.

[0118] The electronic device sets the limit rule of the charging bright screen event as rule 4 for the following reasons: after the electronic device is powered on, if the electronic device is in good contact with the power supply, it means that the electronic device is currently normally charged, and one charging process generally generates one charging bright screen event; if the electronic device is in poor contact with the power supply, it means that the electronic device is currently abnormally charged, and one charging process can generate multiple charging bright screen events. Therefore, the limit rule of the charging bright screen event includes: in the case that the time length between the generation of the current charging bright screen event and the generation of the previous bright screen event exceeds the time length threshold, sending the notification of the current charging bright screen event to the bright screen service module. In this way, the notification of the charging bright screen event can be sent to the bright screen service module multiple times in succession in the case of abnormal charging, and power consumption can be reduced.

[0119] The electronic device sets the limit rule of the shell opening bright screen event as rule 5 and the limit rule of the Bluetooth connection bright screen event as rule 6 only for exemplary description, and details are not described herein.

[0120] In the embodiments of the present application, the limit rules corresponding to the limit bright screen events shown in Table 2 are only exemplary, and the limit range of the bright screen events set by the electronic device can also be set according to the actual use experience of the user, the effect of saving power consumption, and other factors, which are not limited.

[0121] In some implementations, the limit rules corresponding to the limit bright screen events are not limited to being set as a single rule shown in Table 2, but can also be set as the superposition of two or more rules, such as the intersection or union of two or more rules. It should be noted that whether it is the intersection of multiple rules or the union of multiple rules, the electronic device should avoid the conflict of the limit rules when setting the limit rules, for example, the electronic device should not set the limit rules as the intersection or union of rule 1 and any other rule.

[0122] For example, another limit rule corresponding to the limit bright screen event set by the electronic device is introduced below in combination with Table 3.

[0123] Table 3

[0124] As can be seen from Table 3, the limit rule corresponding to the wrist lifting bright screen event is the union of rule 2 and rule 3. That is, the limit rule corresponding to the wrist lifting bright screen event is: sending the notification of the wrist lifting bright screen event to the bright screen service module of the whitelist application or the foreground application. The limit rule corresponding to the message notification bright screen event is the intersection of rule 2 and rule 4. That is, the limit rule corresponding to the message notification bright screen event is: in the case that the time length between the generation of the current message notification bright screen event and the generation of the previous bright screen event exceeds the time length threshold, sending the notification of the current message notification bright screen event to the bright screen service module of the whitelist application.

[0125] The reasons for setting the restriction rules corresponding to the restriction screen-on events can be referred to the related description of FIG. 2, and will not be repeated here.

[0126] In the embodiments of the present application, the restriction rules corresponding to the restriction screen-on events shown in Table 3 are only exemplary, and the corresponding restriction rules can also be set according to the actual use experience of the user, the effect of saving power consumption and other factors, which are not limited.

[0127] For example, the electronic device can set the restriction rules as the intersection of rule 2 and rule 3, that is, sending the notification of the restriction screen-on event to the screen-on service module which belongs to both the whitelist application and the foreground application. The electronic device can also set the restriction rules as the intersection of rule 4 and rule 5, that is, in the case that the time length between the generation of the current restriction screen-on event and the generation of the previous screen-on event exceeds the time length threshold, and in the case that the number of screen-on events generated by the electronic device within the preset time length before the generation of the current restriction screen-on event is greater than the number threshold, sending the notification of the current restriction screen-on event to the screen-on service module.

[0128] In the embodiments of the present application, the restriction rules are not limited to the superposition of the above-mentioned several rules, but can also be set to more superposition of more rules, which are not limited.

[0129] In some implementations, after setting the screen-on events belonging to the restriction range of the screen-on events and the corresponding restriction rules, the electronic device can store the types of the restriction screen-on events and the corresponding restriction rules in the electronic device, so as to subsequently judge whether the real-time generated screen-on event is a restriction screen-on event.

[0130] S102, the electronic device generates a screen-on event a, and switches from screen-off to screen-on.

[0131] In some implementations, the electronic device can generate screen-on events based on user operations, or can generate screen-on events based on installed applications or sensors. After generating the screen-on event, the electronic device can switch from screen-off to screen-on based on the screen-on event.

[0132] After performing S102, the electronic device can perform S103.

[0133] S103, the electronic device judges whether the screen-on event a belongs to the restriction range of the above-mentioned screen-on events.

[0134] In some implementations, after the electronic device generates the screen-on event a, the electronic device can determine whether the screen-on event a belongs to the limit range of the screen-on events set in S101 according to the type of the generated screen-on event a. If the screen-on event a belongs to the limit range of the screen-on events, S104 is performed. If the screen-on event a does not belong to the limit range of the screen-on events, S105 is performed.

[0135] In S104, the electronic device sends a notification of the screen-on event a based on the limit rule corresponding to the screen-on event a. The screen-on service module that receives the notification of the screen-on event a performs corresponding service, and the screen-on service module that does not receive the notification of the screen-on event a does not perform corresponding service.

[0136] In some implementations, after the electronic device determines that the screen-on event a is a limited screen-on event, the electronic device can obtain the limit rule corresponding to the screen-on event a. Then, the electronic device can send a notification of the screen-on event a according to the limit rule corresponding to the screen-on event a.

[0137] The limit rule corresponding to the screen-on event a can be referred to the related description in S101, which is not repeated here.

[0138] After the electronic device sends the notification of the screen-on event a, based on different limit rules, the electronic device can only include the screen-on service module that receives the notification of the screen-on event a, can only include the screen-on service module that does not receive the notification of the screen-on event a, or can include both the screen-on service module that receives the notification of the screen-on event a and the screen-on service module that does not receive the notification of the screen-on event a. Regardless of the above cases, the screen-on service module that receives the notification of the screen-on event a performs corresponding service, that is, the electronic device starts the screen-on service module that receives the notification of the screen-on event a. The screen-on service module that does not receive the notification of the screen-on event a does not perform corresponding service. That is, at this time, the electronic device does not start the screen-on service module that does not receive the notification of the screen-on event a, or the electronic device starts the screen-on service module that does not receive the notification of the screen-on event a, but the screen-on service module does not perform corresponding service.

[0139] In S105, the electronic device sends a notification of the screen-on event a to all screen-on service modules, and all screen-on service modules perform corresponding service.

[0140] In some implementations, after the electronic device determines that the screen-on event a is not a limited screen-on event, the electronic device sends a notification of the screen-on event a to all screen-on service modules, and starts all screen-on service modules.

[0141] In S106, the electronic device receives a user operation, and sends a notification of the screen-on event a to all or part of the screen-on service modules that do not receive the notification of the screen-on event a in S104.

[0142] In some implementations, the electronic device receives the user operation after the screen is turned on. This indicates that the electronic device will most likely be used by the user subsequently. The execution of the corresponding business by the above-mentioned screen-on business module can ensure the normal operation of the electronic device. Therefore, in order to ensure that the electronic device can normally provide services, the electronic device can send the notification of the screen-on event a to other screen-on business modules that have not been sent before after receiving the user operation when the screen is turned on, so as to ensure that all screen-on business modules receive the notification of the screen-on event a, and then execute the business. If the electronic device has sent the notification of the screen-on event a to all screen-on business modules in S104, it is not necessary to send again in S106, so as to save resources.

[0143] In a possible implementation, the electronic device receives the user operation after the screen is turned on. This indicates that the electronic device will most likely start the business module related to the user operation subsequently, and the user will not necessarily use the electronic device subsequently. Therefore, in order to ensure that the business module related to the user operation can be normally started, the electronic device can send the notification of the screen-on event a to the screen-on business module related to the user operation after receiving the user operation when the screen is turned on, so as to ensure that the screen-on business module related to the user operation can normally operate, and then execute the business. If the electronic device has sent the notification of the screen-on event a to the screen-on business module related to the user operation in S104, it is not necessary to send again in S106, so as to save resources.

[0144] In a possible implementation, the electronic device can send the notification of the screen-on event a to all or part of the screen-on business modules that have not received the notification of the screen-on event a in S104 immediately after receiving the user operation. The electronic device can also wait for a period of time after receiving the user operation, and then send the notification of the screen-on event a to all or part of the screen-on business modules that have not received the notification of the screen-on event a in S104. The above-mentioned waiting for a period of time is to enable the electronic device to execute the function related to the user operation first, so as to avoid the sending of the notification by the electronic device from occupying the memory, CPU and other computing resources for executing the function related to the user operation, thereby affecting the corresponding function characteristics. In this way, the electronic device can implement the function related to the user operation immediately after receiving the user operation, and the user experience is good.

[0145] In some implementations, the electronic device can execute S106 after executing S104.

[0146] S107, the electronic device generates an off-screen event a, and switches from the screen-on to the off-screen.

[0147] In some implementations, the electronic device can automatically generate the screen-off event based on a user operation, can generate the screen-off event based on an installed application or a mounted sensor, and can generate the screen-off event when no user operation is received within a preset time period. After generating the screen-off event, the electronic device can switch from the screen-on state to the screen-off state based on the screen-off event.

[0148] In some implementations, the electronic device can execute S107 after executing S104, can execute S107 after executing S105, and can execute S107 after executing S106. After executing S107, the electronic device can execute S108 or S109.

[0149] S108, the electronic device sends a notification of the screen-off event a to the screen-off service module A. The screen-off service module A includes all screen-on service modules that receive the notification of the screen-on event a. The screen-off event a is the first screen-off event generated after the electronic device generates the screen-on event a.

[0150] In some implementations, the screen-off event generated by the electronic device is generated after a screen-on event. The screen-off event a is the first screen-off event generated after the electronic device generates the screen-on event a. That is, the screen-off event a corresponds to the screen-on event a. If the service modules that receive the notification of the screen-on event a do not receive the notification of the screen-off event a, these service modules can continuously receive the notification of the screen-on event twice after the electronic device generates the screen-on event b next time, which can cause errors in the operation of the electronic device. Therefore, in order to ensure the stability of the operation of the electronic device, the electronic device can send the notification of the screen-off event a to all screen-on service modules that receive the notification of the screen-on event a after generating the screen-off event a. That is, the screen-off service modules that receive the notification of the screen-off event a are the same as the screen-on service modules that receive the notification of the screen-on event a.

[0151] Specifically, when the electronic device executes S108 after executing S104, the screen-off service module A includes the screen-on service modules that receive the notification of the screen-on event a in S104. When the electronic device executes S108 after executing S106, the screen-off service module A includes the screen-on service modules that receive the notification of the screen-on event a in S104 and the screen-on service modules that receive the notification of the screen-on event a in S106. It should be noted that the screen-off service module A described above registers both the screen-on event and the screen-off event.

[0152] S109, the electronic device sends a notification of the screen-off event a based on the corresponding restriction rule of the screen-off event a. The restriction rule can refer to the restriction rule of the screen-on event described above.

[0153] In some implementations, after generating the screen-off event a, the electronic device can send a notification of the screen-off event a to all or part of the screen-off service modules based on the corresponding restriction rule of the screen-off event a. The screen-off service modules that receive the notification of the screen-off event a perform corresponding services, and the screen-off service modules that do not receive the notification of the screen-off event a do not perform corresponding services.

[0154] The following describes how to determine whether a screen-off event belongs to a restricted screen-off event.

[0155] In some implementations, the electronic device can set screen-off events that belong to restricted screen-off events according to the type of the screen-off event, which is independent of the type of the on-screen event. For example, whether the previous on-screen event of the screen-off event a belongs to a restricted on-screen event, the screen-off event a can or can not belong to a restricted screen-off event. The electronic device can also set the corresponding restriction rule of the restricted screen-off event to send a notification of the restricted screen-off event according to the corresponding restriction rule. The type of the screen-off event refers to the way in which the electronic device generates the screen-off event. The above description of the type of the screen-off event can refer to the above description of the type of the on-screen event, which is not repeated here. For example, based on the above way of generating the screen-off event, the type of the screen-off event can include wrist drop screen-off, key screen-off, timeout screen-off, case closing screen-off, and proximity light approaching screen-off. In the embodiments of the present application, the type of the screen-off event is not limited, and more types of screen-off events can also be included.

[0156] In one possible implementation, after the electronic device performs S104, S106 is not performed, and S107 is directly performed, that is, in this case, the electronic device does not receive a user operation when the screen is on. In this case, the electronic device can determine whether the screen-off event is a restricted screen-off event according to whether the previous on-screen event of the screen-off event is a restricted on-screen event. If the previous on-screen event of the screen-off event belongs to a restricted on-screen event, the screen-off event belongs to a restricted screen-off event. If the previous on-screen event of the screen-off event does not belong to a restricted on-screen event, the screen-off event also does not belong to a restricted screen-off event. In the case where the screen-off event belongs to a restricted screen-off event, the electronic device can send a notification of the screen-off event based on the corresponding restriction rule. In the case where the screen-off event does not belong to a restricted screen-off event, the electronic device can send a notification of the screen-off event to all screen-off service modules.

[0157] In another possible implementation, after the electronic device performs S104, S106 is performed, that is, in this case, the electronic device receives a user operation when the screen is on. Regardless of whether the previous on-screen event of the screen-off event belongs to a restricted on-screen event, the screen-off event does not belong to a restricted screen-off event. The electronic device can send a notification of the screen-off event to all screen-off service modules.

[0158] In the embodiments of the present application, more ways can be further included to determine whether the screen-off event belongs to the restricted screen-off event, which are not limited.

[0159] In some implementations, the restriction rules of the screen-off event can refer to the restriction rules of the screen-on event described above. The restriction rules of the screen-off event can include:

[0160] Rule a: no notification of the restricted screen-off event is sent to any screen-off service module. That is, if a certain restricted screen-off event applies rule a, the electronic device will not send the notification of the restricted screen-off event to any screen-off service module, and the restricted screen-off event is only used to trigger the electronic device to turn off the screen.

[0161] Rule b: the notification of the restricted screen-off event is sent to the screen-off service module of the white list application. That is, if a certain restricted screen-off event applies rule b, the electronic device will not send the notification of the restricted screen-off event to any screen-off service module of a non-white list application. The white list application can be set by the electronic device. Optionally, for different types of restricted screen-off events, the white list application can be different or the same.

[0162] It is worth noting that the white list mentioned in the screen-on rules can be inconsistent with the white list mentioned in the screen-off rules. For example, the delete user cache data service module belongs to the white list application in rule b, but does not belong to the white list application in rule 2. The delete user cache data service module can receive the notification of the restricted screen-off event, but will not receive the notification of the restricted screen-on event. Moreover, the delete user cache data service module can execute the service of deleting user cache data after receiving the notification of the restricted screen-off event, so as to protect the data security of the user.

[0163] The white list mentioned in the screen-on rules can be consistent with the white list mentioned in the screen-off rules. For example, the CPU frequency adjustment module, the sensor collection frequency adjustment module, and the wifi scanning strategy module can simultaneously belong to the white list application in rule b and the white list application in rule 2.

[0164] In some implementations, the notification of the restricted screen-off event triggers the execution strategy of the above-mentioned service module, which can be consistent with or inconsistent with the execution strategy of the above-mentioned service module triggered by the notification of the restricted screen-on event. When the notification of the restricted screen-off event triggers the execution strategy of the above-mentioned service module, which is inconsistent with the execution strategy of the above-mentioned service module triggered by the notification of the restricted screen-on event, for example, the notification of the restricted screen-off event can trigger the CPU frequency adjustment module to execute the related strategy of reducing the CPU frequency, and the notification of the restricted screen-on event can trigger the CPU frequency adjustment module to execute the related strategy of increasing the CPU frequency.

[0165] In the embodiments of the present application, the service modules are only illustrative, and rule b and / or rule 2 can further include more service modules, which are not limited.

[0166] Rule c: the notification of the limit-off event is sent to the off-screen service module of the foreground application. That is, if a limit-off event applies rule c, the electronic device will not send the notification of the limit-off event to any off-screen service module of a non-foreground application. The foreground application can refer to the application to which the last user interface displayed before the electronic device turns off the screen belongs, for example, the application to which the user interface displayed by the floating window in the screen, the non-floating window, or the user interface displayed by the split screen belongs.

[0167] Rule d: in the case where the time length between the generation of the current limit-off event and the generation of the previous off-screen event exceeds the time length threshold, the notification of the current limit-off event is sent to all off-screen service modules. That is, if a limit-off event applies rule d, the electronic device will not send the notification of the current limit-off event to all off-screen service modules in the case where the time length between the generation of the current limit-off event and the generation of the previous off-screen event is less than or equal to the time length threshold. In this way, if the off-screen service module does not receive the notification of the off-screen event within a period of time, the electronic device will send the notification of the newly generated off-screen event to all off-screen service modules when the electronic device newly generates the off-screen event, so as to ensure the normal operation of the electronic device.

[0168] Further, if the previous off-screen event is a limit-off event, the electronic device sets a shorter time length threshold; if the previous off-screen event is not a limit-off event, the electronic device sets a longer time length threshold. This is because the notification of the limit-off event can not be sent to all off-screen service modules, and therefore, in order to ensure that all off-screen service modules can obtain the notification of the off-screen event based on a shorter time length interval, the electronic device sets a shorter time length threshold in the case where the previous off-screen event is a limit-off event.

[0169] Rule e: if the number of the screen-off events generated by the electronic device is greater than the number threshold in the preset time period before the generation of the current restriction screen-off event, the electronic device sends the notification of the current restriction screen-off event to all the screen-off service modules. That is, if the current restriction screen-off event applies rule e, and the number of the screen-off events generated by the electronic device is less than or equal to the number threshold in the preset time period before the generation of the current restriction screen-off event, the electronic device does not send the notification of the current restriction screen-off event to all the screen-off service modules. Since the electronic device generates the screen-off events exceeding the number threshold in the preset time period, the screen-off events include the restriction screen-off events and the non-restriction screen-off events. The electronic device cannot guarantee that all the screen-off service modules receiving the notification of the screen-off events do not have errors in the execution of the corresponding functions. Therefore, in order to improve the fault tolerance and avoid errors in the execution of the corresponding functions by the screen-off service modules, the electronic device sets rule e. That is, after the electronic device generates the screen-off events exceeding the number threshold in the preset time period, if the electronic device generates a screen-off event again, the electronic device sends the notification of the screen-off event to all the screen-off service modules, so that the screen-off service modules having errors can normally operate again.

[0170] Optionally, rule e can also be that the electronic device can send the notification of the current restriction screen-off event to the screen-off service modules if the number of the restriction screen-off events generated by the electronic device is greater than the number threshold in the preset time period before the generation of the current restriction screen-off event. Since the electronic device generates the restriction screen-off events exceeding the number threshold in the preset time period, the notification of the screen-off events can not be received by all the screen-off service modules. Therefore, in order to ensure the normal operation of the electronic device, the electronic device sets optional rule 5. That is, after the electronic device generates the restriction screen-off events exceeding the number threshold in the preset time period, if the electronic device generates a screen-off event again, the electronic device sends the notification of the screen-off event to all the screen-off service modules, so that all the screen-off service modules can receive the notification of the screen-off event at intervals, and the normal operation of the electronic device is ensured.

[0171] Rule f: if the notification of the screen-off event generated by the electronic device is not sent to all the screen-off service modules in the preset time period before the generation of the current restriction screen-off event, the electronic device sends the notification of the current restriction screen-off event to all the screen-off service modules. If the current restriction screen-off event applies rule f, and the notification of the screen-off event of the screen-off event generated by the electronic device is sent to all the screen-off service modules in the preset time period before the generation of the current restriction screen-off event, the electronic device does not send the notification of the current restriction screen-off event to the screen-off service modules.

[0172] In some implementations, the electronic device can record the generation time of the screen-off event to which the latest notification sent to all screen-off service modules belongs. Then the electronic device can determine whether the time difference between the generation time of the current screen-off event and the generation time of the screen-off event to which the latest notification sent to all screen-off service modules belongs is greater than a preset time length. If yes, the rule f is met.

[0173] In the embodiments of the present application, the above-mentioned several limiting rules for limiting screen-off events are only exemplary, and more or less limiting rules can also be included, which are not limited.

[0174] In some implementations, the above-mentioned S106, S107, S108 and S109 are optional steps.

[0175] By implementing the above-mentioned method, the electronic device does not need to send the notification of the screen-on event to all screen-on service modules after generating the screen-on event each time, but only needs to send the notification of the screen-on event based on the limiting rule. In this way, the power consumption of the electronic device can be reduced to a certain extent. Moreover, the electronic device can set the corresponding limiting rule according to the characteristics of different screen-on events. In this way, the normal operation of the electronic device can also be ensured.

[0176] Based on the above description of FIG. 1, the following describes two specific method processes for processing screen-on events provided by the embodiments of the present application.

[0177] Next, the operating system (OS) interaction diagram of the electronic device corresponding to the method process of FIG. 1 is described in combination with FIG. 2 and FIG. 3.

[0178] The input management module (InputManager), the first application, the second application, the power management module (PowerManager), the display management module (DisplayManager) and the service module shown in FIG. 2 and FIG. 3 are modules included in the electronic device for screen-on and screen-off events. The definition of these modules can also be referred to the detailed description of the software architecture of the electronic device later, and the specific functions of these modules have been described in detail in the following processes, which will not be repeated here.

[0179] FIG. 2 exemplarily shows an OS interaction diagram of an electronic device provided by the embodiments of the present application when processing a screen-on event.

[0180] S201, the input management module or the first application of the electronic device generates a screen-on event a.

[0181] In some embodiments, the input management module receives a user operation before generating the screen-on event a, the user operation being used to trigger the input management module to generate the screen-on event a. Exemplarily, the user operation can include, but is not limited to, an operation of double-clicking the screen, an operation of touching a specified area of the screen, an operation of pressing a power key, and an operation of pressing a volume key.

[0182] The first application receives a message of the first application before generating the screen-on event a, the message being used to trigger the first application to generate the screen-on event a. The message can include a message sent by another electronic device to the first application or a message set by the first application itself. Exemplarily, when the first application is a clock application, the message of the first application is a set alarm message. When the first application is a call application, the message of the first application can be a received incoming call message. When the first application is a chat application, the message of the first application can be a received notification message. When the first application is a system application, the message of the first application can be a notification message sent by a server of the system application.

[0183] In the embodiments of the present application, the above-mentioned first application is only exemplarily described, and there can be more first applications and messages of the first applications.

[0184] Optionally, the sensor of the electronic device can also send sensor data to the input management module, so as to trigger the generation of the screen-on event a.

[0185] S202, the input management module or the first application of the electronic device sends the screen-on event a to a power management module of the electronic device.

[0186] Specifically, the input management module or the first application can send the screen-on event a to the power management module after generating the screen-on event a.

[0187] S203, the power management module of the electronic device sends a screen-on request to a display management module of the electronic device.

[0188] Specifically, the power management module can generate the screen-on request and send the screen-on request to the display management module after receiving the screen-on event a, the screen-on request can include, but is not limited to, a generation time of the screen-on event a and a type of the screen-on event a. The display management module can call a display driver to make the electronic device switch from a screen-off state to a screen-on state after receiving the screen-on request.

[0189] S204, the power management module of the electronic device generates a notification of the screen-on event a.

[0190] Specifically, the power management module can generate the notification of the screen-on event a based on the screen-on event a after sending the screen-on request.

[0191] S205, the power management module of the electronic device determines whether the screen-on event a belongs to the limited range of screen-on events.

[0192] Specifically, the power management module can determine whether the screen-on event a belongs to the limited range of screen-on events at the same time of generating the notification of the screen-on event a or after generating the notification of the screen-on event a. If the screen-on event a belongs to the limited range of screen-on events, S206 is performed; if the screen-on event a does not belong to the limited range of screen-on events, S210 is performed. For S205, refer to the related content of S103 above.

[0193] In a possible implementation, in the OS interaction diagram shown in FIG. 2, the order of S203, S204 and S205 performed by the electronic device is not limited. For example, the electronic device can perform S204 first and then perform S203. For example, the power management module can generate the notification of the screen-on event a first, and then send the screen-on request to the display management module. For another example, the electronic device can perform S205 first and then perform S204. For example, the power management module can first determine whether the screen-on event a belongs to the limited range of screen-on events, and then the power management module generates the notification of the screen-on event a. Next, S206 is performed if the screen-on event a belongs to the limited range of screen-on events, and S210 is performed if the screen-on event a does not belong to the limited range of screen-on events. For another example, the electronic device can perform S203 and S204 at the same time.

[0194] S206, the power management module of the electronic device sends the notification of the screen-on event a to the corresponding screen-on service module based on the limited rule of the screen-on event a.

[0195] Specifically, after determining that the screen-on event a belongs to the limited range of screen-on events, the power management module can obtain the limited rule corresponding to the screen-on event a. Then the power management module can send the notification of the screen-on event a based on the limited rule of the screen-on event a. The screen-on service module receiving the notification of the screen-on event a can perform the corresponding service, that is, the screen-on service module receiving the notification of the screen-on event a is started. For S206, refer to the related content of S104 above.

[0196] S207, the input management module of the electronic device receives a user operation.

[0197] Optionally, S207 can be performed after S206 is performed.

[0198] Specifically, after the power management module sends the notification of the screen-on event a based on the limited rule of the screen-on event a, the input management module receives a user operation.

[0199] In some implementations, after the input management module receives the user operation, the operation event can be generated and sent to the corresponding management module, and the corresponding management module can notify the business module related to the operation event to execute the corresponding business.

[0200] S208, the input management module of the electronic device sends the message of receiving the user operation to the power management module of the electronic device.

[0201] S209, the power management module of the electronic device sends the notification of the screen-on event a to all or part of the screen-on business modules that do not receive the notification of the screen-on event a in S206.

[0202] Specifically, the power management module sends the notification of the screen-on event a to all or part of the screen-on business modules that do not receive the notification of the screen-on event a after receiving the message of the user operation.

[0203] Optionally, the power management module can send the notification of the screen-on event a after a certain time interval after receiving the message of the user operation. Specifically, the interval of a certain time interval can be that the power management module receives the message of completing the execution of the business sent by the business module related to the user operation. In this way, the execution of the business by the screen-on business module can avoid occupying the memory for the execution of the business by the business module related to the user operation, so as to affect the effect of the execution of the business by the business module related to the user operation. For S207-S209, please refer to the related content of S106 above.

[0204] S210, the power management module of the electronic device sends the notification of the screen-on event a to all screen-on business modules.

[0205] For S210, please refer to the related content of S105 above, which will not be repeated here.

[0206] In a possible implementation, the execution subject of S204, S205, S206, S209 and S210 above can also be the display management module of the electronic device, and S208 can also be the input management module of the electronic device sending the message of receiving the user operation to the display management module of the electronic device.

[0207] In a possible implementation, the execution subject of S204, S205, S206, S209 and S210 above can also be the power management module and the display management module of the electronic device.

[0208] In a possible implementation, S207-S209 above are optional execution steps.

[0209] In this way, the electronic device does not need to send the notification of the screen-on event to all the screen-on service modules after generating the screen-on event each time, but only needs to send the notification of the screen-on event based on the restriction rule. In this way, the power consumption of the electronic device can be reduced to a certain extent.

[0210] FIG. 3 exemplarily shows an OS interaction diagram of an electronic device provided by an embodiment of the present application when processing a screen-off event.

[0211] S301, the input management module of the electronic device generates a screen-off event a.

[0212] In some implementations, the input management module receives a user operation before generating the screen-off event a, and the user operation is used to trigger the input management module to generate the screen-off event a. Exemplarily, the user operation can include but is not limited to: an operation of clicking a control for screen-off in the screen, an operation of pressing a power key. The input management module can also not receive the user operation within a preset time length (for example, 5 minutes) before generating the screen-off event a. The input management module can also be triggered to generate the screen-off event a when the user operation is not received within the preset time length.

[0213] Optionally, the sensor of the electronic device can also send sensor data to the input management module to trigger the generation of the screen-off event a. Some applications in the electronic device can also generate the screen-off event a. For S301, refer to the related content of S107 described above, which will not be repeated here.

[0214] S302, the input management module of the electronic device sends the screen-off event a to the power management module of the electronic device.

[0215] Specifically, the input management module can send the screen-off event a to the power management module after generating the screen-off event a.

[0216] S303, the power management module of the electronic device sends a screen-off request to the display management module of the electronic device.

[0217] Specifically, the power management module can send the screen-off request to the display management module after receiving the screen-off event a, and the screen-off request includes the generation time of the screen-off event a. The display management module can call the display driver to switch the electronic device from screen-on to screen-off after receiving the screen-off request sent by the power management module.

[0218] S304, the power management module of the electronic device can generate a notification of the screen-off event a.

[0219] Specifically, the power management module generates the notification of the screen-off event a based on the screen-off event a after sending the screen-off request.

[0220] S305, the power management module of the electronic device determines whether the previous bright screen event a of the screen-out event a belongs to the limit range of the bright screen event.

[0221] Specifically, the power management module can determine that the bright screen event a is the most recently generated bright screen event before the screen-out event a according to the generation time of the screen-out event a and the generation time of the bright screen event a. And, it is determined whether the bright screen event a belongs to the limit range of the bright screen event. If the bright screen event a belongs to the limit range of the bright screen event, S306 is executed; if the bright screen event a does not belong to the limit range of the bright screen event, S307 is executed.

[0222] In a possible implementation, in the OS interaction diagram shown in FIG. 3, the order of S303, S304 and S305 executed by the electronic device is not limited. For example, the electronic device can execute S304 first and then execute S303. For example, the power management module can first generate the notification of the screen-out event a, and then send the screen-out request to the display management module. For another example, the electronic device can execute S305 first and then execute S304. For example, the power management module can first determine whether the previous bright screen event a of the screen-out event a belongs to the limit range of the bright screen event, and then the power management module generates the notification of the screen-out event a. Next, S306 is executed in the case where the bright screen event a belongs to the limit range of the bright screen event, and S307 is executed in the case where the bright screen event a does not belong to the limit range of the bright screen event. For another example, the electronic device can execute S303 and S304 at the same time.

[0223] S306, the power management module of the electronic device sends the notification of the screen-out event a to all bright screen service modules that receive the notification of the bright screen event a.

[0224] Specifically, before the electronic device executes S306, in the case where the electronic device does not execute S207, the service modules that receive the notification of the screen-out event a in S306 include the bright screen service modules that receive the notification of the bright screen event a in S206. In the case where the electronic device executes S207 before executing S306, the service modules that receive the notification of the screen-out event a in S306 include both the bright screen service modules that receive the notification of the bright screen event a in S206 and the bright screen service modules that receive the notification of the bright screen event a in S209.

[0225] For the above S306, please refer to the related content of the above S108, which will not be repeated here.

[0226] Optionally, S306 can also be that the power management module of the electronic device can send the notification of the screen-out event based on the limit rule of the screen-out event a.

[0227] In some implementations, if the screen-off event a is a restricted screen-off event, the power management module of the electronic device can send the notification of the screen-off event based on the restriction rule of the screen-off event a. Specifically, how to determine whether the screen-off event a is a restricted screen-off event can refer to the related description of S109 above, which will not be repeated here.

[0228] S307, the power management module of the electronic device sends the notification of the screen-off event a to all screen-off service modules.

[0229] In a possible implementation, the execution subject of S304, S305 and S306 above can also be the display management module of the electronic device.

[0230] In a possible implementation, the execution subject of S304, S305 and S306 above can also be the power management module and the display management module of the electronic device.

[0231] In this way, the service module receiving the notification of the screen-on event can also receive the notification of the screen-off event after the electronic device generates the screen-off event, which improves the stability of the electronic device.

[0232] In some implementations, in the case that the electronic device displays the user interface of the clock after the screen is turned on, when the interval between the screen-on instant time and the next second is very short, the electronic device can display the clock of the next second, so as to reduce the power consumption caused by refreshing the clock. For example, if the electronic device is 9:34:37,700 milliseconds at the screen-on instant time, the electronic device can directly display the clock of 9:34:38 after the screen is turned on. In this way, the power consumption of the electronic device from displaying the clock of 9:34:37 to refreshing to 9:34:38 can be reduced, and the error is only 300 milliseconds, which will not be too different from the user's perception.

[0233] In some implementations, the limit screen-on event can be referred to as a first screen-on event. The notification of the limit screen-on event is referred to as a first screen-on notification. The screen-on service module can include a first service module, a second service module. The electronic device enabling the first service module to execute the corresponding service is referred to as starting the first service module. The electronic device disabling the first service module from executing the corresponding service is referred to as stopping the first service module. The electronic device disabling the second service module from executing the corresponding service is referred to as not starting the second service module. The time threshold in rule 4 can be referred to as a first threshold. The preset time in rule 5 can be referred to as a first time, and the number threshold in rule 5 can be referred to as a second threshold. The preset time in rule 7 can be referred to as a fourth time. The user operation received by the electronic device for triggering the generation of the first screen-on event can be referred to as a first operation. The user operation received by the electronic device after the screen is on can be referred to as a second operation. The service module related to the function of the second operation can be referred to as the service module monitoring the event corresponding to the second operation. The first screen-off event generated by the electronic device after the first screen-on event is generated can be referred to as a first screen-off event. The user operation received by the electronic device for triggering the generation of the first screen-off event can be referred to as a third operation. The wrist-raising action of the user can be referred to as a first action.

[0234] FIG. 4 shows a schematic diagram of a hardware structure of the electronic device 100.

[0235] The embodiments will be described below with the electronic device 100 as an example. It should be understood that the electronic device 100 shown in FIG. 1 is only an example, and the electronic device 100 can have more or fewer components than those shown in FIG. 1, can combine two or more components, or can have a different configuration of components. The various components shown in the diagram can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.

[0236] For example, the electronic device 100 can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), an Internet device, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device, and / or a smart city device, and the embodiments of the present application do not specially limit the specific type of the electronic device 100.

[0237] The electronic device 100 can 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, a headset jack 170D, a sensor module 180, a key 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 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric 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.

[0238] It can be understood that the structure illustrated in the embodiments 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 can include more or fewer components than illustrated, or combine certain components, or split certain components, or different arrangement of components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.

[0239] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (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 can be independent devices, or can be integrated in one or more processors.

[0240] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching instructions and executing instructions.

[0241] The processor 110 can also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can hold instructions or data that the processor 110 has just used or is using repeatedly. If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.

[0242] In some implementations, the processor 110 can be configured to set a limit range of the on-screen event and a corresponding limit rule. The processor 110 can be configured to determine whether the generated on-screen event belongs to the limit range of the on-screen event. The processor 110 can be configured to switch the electronic device to the on-screen based on the generated on-screen event, and can be configured to switch the electronic device to the off-screen based on the generated off-screen event. The memory can also be configured to store the limit on-screen event and the corresponding limit rule.

[0243] In some implementations, the processor 110 can be configured to set a limit range of the off-screen event and a corresponding limit rule. The processor 110 can be configured to determine whether the generated off-screen event belongs to the limit range of the off-screen event. The memory can also be configured to store the limit off-screen event and the corresponding limit rule. The processor 110 can also be configured to determine whether the previous on-screen event of the off-screen event belongs to the limit range of the on-screen event.

[0244] In some embodiments, the processor 110 can include one or more interfaces. The interface can 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.

[0245] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection modes or a combination of multiple interface connection modes in the above embodiments.

[0246] The charging management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 can charge the battery 142 and also supply power to the electronic device through the power management module 141.

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

[0248] The wireless communication function of the electronic device 100 can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.

[0249] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed 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.

[0250] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 can 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 by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transfer to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor, and radiate as electromagnetic waves through the antenna 1. In some embodiments, at least part of the function modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the function modules of the mobile communication module 150 can be disposed in the same device as at least part of the modules of the processor 110.

[0251] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a 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. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the microphone 170B, etc.), or displays an image or a video through the display screen 194. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110, and disposed in the same device as the mobile communication module 150 or other function modules.

[0252] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, frequency-modulates and filters the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, frequency-modulate it, amplify it, and radiate it as an electromagnetic wave via the antenna 2.

[0253] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can 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, etc. The GNSS can 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 systems (SBAS).

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

[0255] The display screen 194 is configured to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be manufactured using an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a miniled, a microled, a micro-oled, a quantum dot light emitting diodes (QLED), and the like. In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.

[0256] The electronic device 100 can implement a photographing function through an ISP, the camera 193, a video codec, a GPU, the display screen 194, and an application processor.

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

[0258] The camera 193 is configured to capture still images or videos. An object generates an optical image through a lens and projects the optical image onto a 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 light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert the electrical signal 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 the like format. In some embodiments, the electronic device 100 can include one or N cameras 193, where N is a positive integer greater than 1.

[0259] The digital signal processor is used to process digital signals, in addition to being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0260] The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0261] The NPU is a neural-network (NN) calculation processor, which can quickly process input information by drawing on the structure of a biological neural network, such as drawing on the transmission mode between human brain neurons, and can also constantly self-learn. Through the NPU, the electronic device 100 can realize intelligent cognition applications such as image recognition, face recognition, voice recognition, text understanding, etc.

[0262] 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 realize data storage functions. For example, music, video, etc. Files are saved in the external memory card.

[0263] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various function applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc. The data storage area can 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 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), etc.

[0264] The electronic device 100 can realize audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.

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

[0266] The speaker 170A, also referred to as a "loudspeaker", is configured 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.

[0267] The receiver 170B, also referred to as a "earpiece", is configured to convert an audio electrical signal into a sound signal. When the electronic device 100 receives a call or a voice message, the user can listen to the voice by holding the receiver 170B close to the ear.

[0268] The microphone 170C, also referred to as a "microphone", "sound collector", is configured to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can make a sound by holding the mouth close to the microphone 170C, and input the sound signal into the 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, in addition to collecting sound signals, noise reduction functions can also be realized. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, to realize the collection of sound signals, noise reduction, and also to identify the source of the sound, to realize the function of directional recording, etc.

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

[0270] The pressure sensor 180A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display 194. The pressure sensor 180A can be of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, etc. The capacitive pressure sensor can include at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations applied to 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 a first pressure threshold is applied to a short message application icon, an instruction to view a short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.

[0271] In some implementations, the pressure sensor 180A is also configured to generate sensor data after a user's pressing operation and send the sensor data to the processor 110. The processor 110 is configured to determine whether the current sensor data triggers a bright screen event.

[0272] The gyroscope sensor 180B can be configured 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 gyroscope sensor 180B. The gyroscope sensor 180B can be used for shooting anti-shake. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shaking of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and lets the lens offset the shaking of the electronic device 100 by reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and motion sensing game scenarios.

[0273] The barometric pressure sensor 180C is configured to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude, assists positioning and navigation based on the air pressure value measured by the barometric pressure sensor 180C.

[0274] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can detect the opening and closing of a flip cover by using the magnetic sensor 180D. 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 based on the magnetic sensor 180D. Further, based on the detected opening and closing state of the cover or the opening and closing state of the flip cover, the electronic device 100 can set a feature such as automatic unlocking of the flip cover.

[0275] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in each direction (typically, three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the electronic device's posture and applied to a screen rotation function, a pedometer, and the like.

[0276] The distance sensor 180F is used to measure a distance. The electronic device 100 can measure a distance by infrared or laser. In some embodiments, the electronic device 100 can measure a distance using the distance sensor 180F to implement a fast focus function when a scene is photographed.

[0277] The proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode can be an infrared light emitting diode. The electronic device 100 emits infrared light outwardly through the light emitting diode. The electronic device 100 detects infrared reflected light from a nearby object using the photodiode. 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 detect that a user holds the electronic device 100 close to the ear to talk, using the proximity light sensor 180G, in order to automatically turn off the screen to save power. The proximity light sensor 180G can also be used for automatic unlocking and locking of a case mode or a pocket mode.

[0278] In some implementations, the proximity light sensor 180G is also used to generate sensor data and transmit the sensor data to the processor 110. The processor 110 is configured to determine whether the current sensor data triggers a bright screen event.

[0279] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display 194 according to the sensed brightness of the ambient light. The ambient light sensor 180L can also be used to automatically adjust the white balance when a photograph is taken. 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 touch.

[0280] The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can use the collected fingerprint characteristics to implement a fingerprint unlock function, an application lock access function, a fingerprint photographing function, a fingerprint call answering function, and the like. In some implementations, the fingerprint sensor 180H is also used to generate sensor data after a touch operation of a user and transmit the sensor data to the processor 110. The processor 110 is configured to determine whether the current sensor data triggers a bright screen event.

[0281] The temperature sensor 180J is configured to detect temperature. In some embodiments, the electronic device 100 performs temperature handling strategies based on the temperature detected by the temperature sensor 180J. 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 another example, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by low temperature. In yet another example, when the temperature is below yet another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0282] The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch panel". The touch sensor 180K is configured to detect a touch operation acting on or near the touch sensor 180K. The touch sensor 180K can transmit 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 another example, the touch sensor 180K can also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194. In some implementations, the touch sensor 180K is also configured to generate sensor data after a touch operation of a user and transmit the sensor data to the processor 110. The processor 110 is configured to determine whether the current sensor data triggers the generation of a bright screen event.

[0283] 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 human body sound part vibration bone block. The bone conduction sensor 180M can also contact a human body pulse to receive a blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M can also be disposed in a headset to form a bone conduction headset. The audio module 170 can analyze a voice signal based on the vibration signal of the sound part vibration bone block obtained by the bone conduction sensor 180M to implement a voice function. The application processor can analyze heart rate information based on the blood pressure pulsation signal obtained by the bone conduction sensor 180M to implement a heart rate detection function.

[0284] The key 190 includes a power-on key, a volume key, and the like. The key 190 can be a mechanical key. It can also be a touch key. The electronic device 100 can receive a key input to generate a key signal input related to user settings and function control of the electronic device 100. In some implementations, the key 190 is also configured to generate related data after a user's operation of pressing the key 190 and transmit the related data to the processor 110. The processor 110 is configured to determine whether to trigger the generation of a bright screen event.

[0285] The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompt, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. The motor 191 can also correspond to different vibration feedback effects for touch operations acting on different regions of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarms, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0286] The indicator 192 can be an indicator light, which can be used to indicate the charging state, the power change, and can also be used to indicate messages, missed calls, notifications, etc.

[0287] The SIM card interface 195 is used to connect the SIM card.

[0288] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to exemplarily illustrate the software structure of the electronic device 100.

[0289] FIG. 5 is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0290] The layered architecture divides the software into several layers, and 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, which are the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0291] The application layer can include a series of application packages.

[0292] As shown in FIG. 5, the application package can include a first application. Exemplarily, the first application can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. The application layer can also include a business module. In some implementations, the business module can refer to a certain software module in the application. The business module can perform its specific function or business. Among them, the business module that registers the screen-on event is called the screen-on business module, and the business module that registers the screen-off event is called the screen-off business module.

[0293] The application framework layer provides an application programming interface (API) and a programming framework for the applications of the application layer. The application framework layer includes some pre-defined functions. The application framework layer is mainly responsible for processing operations related to direct interaction with the user, which includes receiving user input, processing interface logic, and passing data processing requests to the lower layer, etc.

[0294] As shown in FIG. 5, the application framework layer can include a power manager, a display manager, an input manager, a resource manager, a notification manager, a view system, a window manager, a phone manager, etc. Among them, the power manager is equipped with a power management module, the display manager is equipped with a display management module, and the input manager is equipped with an input management module.

[0295] The function of the power manager is to ensure the stable operation of the electronic device under different load conditions. The power manager can be used to generate a screen-on request and a screen-off request. Specifically, the power manager can generate a screen-on request after receiving a screen-on event, and send the screen-on request to the display manager. The power manager can generate a screen-off request after receiving a screen-off event, and send the screen-off request to the display manager.

[0296] The display manager is used to process and manage the display output of the device, to ensure that images, text or other information can be accurately displayed on the display screen. The display manager can be used to control the electronic device to turn on or turn off the screen. Specifically, the display manager can make the electronic device switch to the screen-on state after receiving the screen-on request. The display manager can make the electronic device switch to the screen-off state after receiving the screen-off request. The display manager can also generate a notification of the screen-on event based on the screen-on request, and send the notification of the screen-on event to the screen-on service module. The display manager can also be used to determine whether the screen-on event contained in the screen-on request belongs to the restricted screen-on event, and to send a notification of the restricted screen-on event based on the restriction rule. The display manager can also be used to receive information of user operation sent by the input manager when the screen is on, and send a notification of the screen-on event to the screen-on service module which has not occurred the notification of the screen-on event before.

[0297] The input manager is used to generate a screen-on event or a screen-off event based on the received user operation, and to generate an operation event based on the user operation. The input manager is also used to send the screen-on event or the screen-off event to the power manager.

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

[0299] The content provider stores and retrieves data and makes the data accessible to applications. The data can include videos, images, audio, dialed and received phone calls, browsing history and bookmarks, phone book, etc.

[0300] The view system includes visual controls, such as controls that display text, controls that display pictures, etc. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon can include a view that displays text and a view that displays a picture.

[0301] The telephony manager is used to provide the communication function of the electronic device 100. For example, management of call status (including call connection, call hang-up, etc.).

[0302] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc.

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

[0304] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0305] The core library includes two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.

[0306] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and the application framework layer into binary files. The virtual machine is used to perform the management of the object life cycle, the management of the stack, the management of the thread, the management of the security and the exception, and the garbage collection, etc.

[0307] The system library can include multiple functional modules. For example: surface manager, media library, three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.

[0308] The surface manager is used to manage the display subsystem and provides 2D and 3D layer fusion for multiple applications.

[0309] The media library supports playback and recording of multiple common audio, video formats, and static image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, and the like.

[0310] The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, composition, and layer processing.

[0311] The 2D graphics engine is a drawing engine for 2D drawing.

[0312] The kernel layer is a layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0313] Embodiments of the present application provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the method of displaying a notification.

[0314] Embodiments of the present application also provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.

[0315] Embodiments of the present application also provide a computer program product, which includes a computer program. When the computer program is run on a computer, the computer can implement the steps in the above method embodiments.

[0316] Embodiments of the present application also provide a chip system, which includes a processing circuit and an interface circuit. The interface circuit is used to receive code instructions and transmit the code instructions to the processing circuit. The processing circuit is used to run the code instructions to make the chip system implement the steps in any method embodiment of the present application. The chip system can be a single chip or a chip module composed of multiple chips.

[0317] The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some technical features. The modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method of handling a screen-brightness dimming event, the method comprising: The method is applied to an electronic device, and comprises: The electronic device generates a first screen-on event; The electronic device switches from screen-off to screen-on based on the first screen-on event; The electronic device starts a first service module based on the first screen-on event and does not start a second service module.

2. The method of claim 1, wherein, The electronic device starts a first service module based on the first screen-on event and does not start a second service module, specifically comprising: The electronic device generates a first screen-on notification based on the first screen-on event; The electronic device sends the first screen-on notification to the first service module and does not send the first screen-on notification to the second service module.

3. The method of claim 2, wherein, The electronic device further comprises an input management module, a power management module, and a display management module, The electronic device generates a first screen-on event, specifically comprising: The electronic device generates the first screen-on event through the input management module or a first application; The electronic device sends the first screen-on notification to the first service module and does not send the first screen-on notification to the second service module, specifically comprising: The electronic device generates the first screen-on notification through the power management module or the display management module and sends the first screen-on notification to the first service module and does not send the first screen-on notification to the second service module.

4. The method according to any one of claims 1 to 3, characterized in that, Before the electronic device generates a first screen-on event, the method further comprises: The electronic device receives a first operation; Or, the electronic device receives a voice instruction; Or, the electronic device generates a message of the first application; Or, the electronic device receives an incoming call; Or, the electronic device connects to a power source; Or, the electronic device establishes a Bluetooth connection; Or, the electronic device detects that a housing is opened; Or, the electronic device detects that a proximity light is away; Or, the electronic device detects that a user action is a first action.

5. The method of any one of claims 1-4, wherein: The first service module belongs to a service module of a white-listed application or a service module of a foreground application, and the second service module does not belong to a service module of a white-listed application or a service module of a foreground application.

6. The method according to any one of claims 1 to 5, characterized in that, The duration between the generation time of the first screen-on event and the generation time of the most recent screen-on event before the generation time is greater than a first threshold value.

7. The method according to any one of claims 1 to 6, characterized in that, Within a first duration before the generation of the first screen-on event, the number of screen-on events generated by the electronic device is greater than a second threshold value.

8. The method according to any one of claims 1 to 7, characterized in that, After the electronic device starts the first service module and does not start the second service module based on the first screen-on event, the method further comprises: The electronic device receives a second operation; The electronic device starts the second service module, which belongs to a service module that monitors an event corresponding to the second operation.

9. The method according to any one of claims 1 to 7, characterized in that, After the electronic device starts the first service module and does not start the second service module based on the first screen-on event, the method further comprises: The electronic device receives a second operation; After a second duration during which the electronic device receives the second operation, the electronic device starts the second service module, which belongs to a service module that monitors an event corresponding to the second operation.

10. The method of any one of claims 1-6, wherein, After the electronic device starts the first service module based on the first screen-on event and does not start the second service module, the method further includes: The electronic device generates a first screen-off event; The electronic device switches from screen-on to screen-off based on the first screen-off event; The electronic device closes the first service module based on the first screen-off event.

11. The method of claim 8 or 9, wherein, After the electronic device starts the second service module, the method further includes: The electronic device generates a first screen-off event; The electronic device switches from screen-on to screen-off based on the first screen-off event; The electronic device closes the first service module and / or the second service module based on the first screen-off event.

12. The method of claim 10 or 11, wherein, Before the electronic device generates a first screen-off event, the method further includes: The electronic device receives a third operation; Or, the electronic device receives a voice instruction; Or, the electronic device does not receive a fourth operation within a third time period; Or, the electronic device detects that the shell is closed; Or, the electronic device detects that the proximity light is close.

13. The method of any one of claims 1-12, wherein, The electronic device starts the first service module based on the first screen-on event and does not start the second service module, specifically includes: The electronic device determines to start the first service module and not to start the second service module according to the type of the first screen-on event.

14. The method of claim 10, wherein, After the electronic device closes the first service module based on the first screen-on event, the method further includes: The electronic device generates a second screen-on event; The electronic device switches from screen-off to screen-on based on the second screen-on event; The electronic device starts the first service module and the second service module based on the second screen-on event, the time period between the generation time of the second screen-on event and the generation time of the first screen-on event is greater than a first threshold value, and the first screen-on event is the last generated screen-on event before the second screen-on event.

15. The method of claim 10, wherein, After the electronic device closes the first service module based on the first screen-on event, the method further includes: The electronic device generates a second screen-on event; The electronic device switches from screen-off to screen-on based on the second screen-on event; The electronic device starts the first service module and the second service module based on the second screen-on event, wherein the number of screen-on events generated by the electronic device within a first time period before the generation of the first screen-on event is less than a second threshold value, and the number of screen-on events generated by the electronic device within the first time period before the generation of the second screen-on event is greater than the second threshold value.

16. The method according to any one of claims 10-15, characterized in that, After the electronic device closes the first service module based on the first screen-off event, or after the electronic device closes the first service module and the second service module based on the first screen-off event, the method further includes: The electronic device generates a third screen-on event; The electronic device switches from screen-off to screen-on based on the third screen-on event; The electronic device starts the second service module and does not start the first service module based on the third screen-on event; Or, the electronic device does not start the first service module and the second service module based on the third screen-on event, where the third screen-on event is of a type different from that of the first screen-on event.

17. The method of any one of claims 1-16, wherein, The method further includes: The electronic device generates a fourth screen-on event; The electronic device switches from screen-off to screen-on based on the fourth screen-on event; The electronic device starts the first service module or the second service module based on the fourth screen-on event, The electronic device generates a fifth screen-on event; The electronic device switches from screen-off to screen-on based on the fifth screen-on event; The electronic device starts the first service module and the second service module based on the fifth screen-on event; The fourth screen-on event is any screen-on event generated within a fourth time length, the fourth time length is a time length before the electronic device generates the fifth screen-on event, and the end time of the fourth time length is the time when the fifth screen-on event is generated.

18. An electronic device, comprising: The electronic device includes a memory, a processor, and computer instructions stored in the memory, and the processor executes the computer program to implement the method of any one of claims 1-17.

19. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method of any one of claims 1-17.

20. A computer program product, characterised in that, The computer program product contains computer instructions, and when the computer instructions are executed by the processor, the method of any one of claims 1-17 is implemented.

Citation Information

Patent Citations

  • Method and device for lightening screen

    CN104461358A

  • Control method and device based on black screen gesture, storage medium and mobile terminal

    CN107422976A

  • Application quick starting method and device and terminal equipment

    CN113656099A

  • Business management method, electronic equipment and computer readable storage medium

    CN117692540A

  • Electronic device management method, electronic device, and readable storage medium

    WO2023131070A1