Dormancy management method and device and electronic equipment

By detecting the sleep conditions of the target module and detecting the request for busy status identification when performing the sleep preprocessing service, the problem of event execution interruption or loss in the prior art is solved, improving the user experience and reducing power consumption waste.

CN120179053APending Publication Date: 2025-06-20HANGZHOU EZVIZ SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510220438.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

In the prior art, when performing dormant preprocessing services, event execution interruption or event loss may occur, affecting the user experience.

Method used

By detecting whether each target module meets multiple sleep conditions, if satisfied, preprocessing services are performed, and in the process, a request for busy status identification is detected. If a request is received, the sleep process is terminated; otherwise, a power-off notification is sent to the microcontroller to put the device into a sleep state.

Benefits of technology

Ensure that when performing hibernation preprocessing services, there are pending events, avoid interruptions or loss of event execution, improve user experience, and reduce power consumption and waste caused by repeated wake-up.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179053A_ABST
    Figure CN120179053A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a dormancy management method and device and electronic equipment, and relates to the technical field of equipment control, and the dormancy management method comprises the steps: for each target module in each target module, detecting whether the target module meets any dormancy condition in a plurality of dormancy conditions or not, if each target module meets one dormancy condition in a plurality of dormancy conditions, executing a preprocessing service corresponding to dormancy, and detecting whether a request about a busy state identifier sent by any target module is received in the process of executing the preprocessing service, if it is detected that a request about a busy state identifier sent by any target module is received in the process of executing the preprocessing service, ending the sleep process; otherwise, a notification for indicating the SOC to be powered off is sent to the microcontroller, so that the microcontroller responds to the notification, and the SOC is powered off. According to the scheme, the use experience of the user can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of device control, and in particular, to a sleep management method, apparatus, and electronic device. Background Art

[0002] In order to reduce the power consumption of a device, for an electronic device that can be powered by a battery, when the sleep condition is met, for example, when there is no event to be processed by the SOC (System on Chip) of the electronic device and the duration reaches the idle waiting duration, power-down processing can be performed to enable the electronic device to enter the sleep state. Among them, the microcontroller of the electronic device can perform a power-down operation on the SOC to make the electronic device enter the sleep state. Moreover, when the sleep condition is met, before notifying the microcontroller to perform the power-down operation, that is, before entering the sleep state, a preprocessing service corresponding to the sleep will be executed.

[0003] In the related art, once the sleep condition is met, the SOC will enter the sleep state. If there is an event to be executed during the execution of the preprocessing service, since the electronic device will enter the sleep state immediately after the preprocessing service is completed, the event that needs to be executed during the execution of the preprocessing service cannot be guaranteed to be executed completely, and there may be a situation where the event execution is interrupted or the event is lost, which affects the user experience. For example: 1 second before the smart doorbell device enters the sleep state, it receives an event for capturing image data. At this time, the smart doorbell device can capture multiple frames of image data within 1 second. However, after 1 second, the smart doorbell device will enter the sleep state and cannot continue to capture. The smart doorbell device needs to be reawakened to continue executing the event of capturing image data. Summary of the Invention

[0004] The purpose of the embodiments of this application is to provide a sleep management method, apparatus, and electronic device to improve the user experience. The specific technical solutions are as follows:

[0005] In a first aspect, the embodiments of this application provide a sleep management method, which is applied to the system on chip SOC of an electronic device. The electronic device further includes a wireless communication module and a microcontroller. Each processing module is set in the SOC, and each processing module is a program module for processing events transmitted by the microcontroller or the wireless communication module. The method includes:

[0006] For each target module among the respective target modules, detect whether the target module meets any one of a plurality of sleep conditions; wherein, the respective target modules include the wireless communication module and each processing module, and the event processing method of each target module includes that the target module processes events when it has a busy status flag obtained by requesting from the SOC, and after meeting the release condition, releases the requested busy status flag, and the busy status flag is used to represent the permission to process events, and the plurality of sleep conditions at least include: whether the processing duration of the event currently being processed by the target module with a busy status flag reaches the maximum working duration allowed by the target module, or whether the idle duration of the target module without a busy status flag reaches a preset idle duration threshold;

[0007] If each of the respective target modules meets one of the plurality of sleep conditions, perform a preprocessing service corresponding to sleep, and detect whether a request for a busy status flag sent by any target module is received during the execution of the preprocessing service;

[0008] If it is detected that a request for a busy status flag sent by any target module is received during the execution of the preprocessing service, end the sleep process; otherwise, send a notification for instructing powering down the SOC to the microcontroller, so that the microcontroller powers down the SOC in response to the notification, so that the electronic device enters a sleep state.

[0009] In a second aspect, an embodiment of the present application provides a sleep management device, which is applied to a system on chip (SOC) of an electronic device. The electronic device further includes a wireless communication module and a microcontroller, and each processing module is provided in the SOC, and each processing module is a program module for processing events transmitted by the microcontroller or the wireless communication module; the device includes:

[0010] A first detection module, configured to, for each target module among the respective target modules, detect whether the target module meets any one of a plurality of sleep conditions; wherein, the respective target modules include the wireless communication module and each processing module, and the event processing method of each target module includes that the target module processes events when it has a busy status flag obtained by requesting from the SOC, and after meeting the release condition, releases the requested busy status flag, and the busy status flag is used to represent the permission to process events, and the plurality of sleep conditions at least include: whether the processing duration of the event currently being processed by the target module with a busy status flag reaches the maximum working duration allowed by the target module, or whether the idle duration of the target module without a busy status flag reaches a preset idle duration threshold;

[0011] An execution module, configured to, if each of the target modules meets one of a plurality of sleep conditions, execute a preprocessing service corresponding to sleep, and detect whether a request for a busy status flag sent by any target module is received during the execution of the preprocessing service;

[0012] A sending module, configured to, if it is detected that a request for a busy status flag sent by any target module is received during the execution of the preprocessing service, end the sleep process; otherwise, send a notification for instructing power-down of the SOC to the microcontroller, so that the microcontroller responds to the notification and powers down the SOC, enabling the electronic device to enter a sleep state.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0014] A memory, configured to store a computer program;

[0015] A processor, configured to implement any of the above sleep management methods when executing the program stored on the memory.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program implements any of the above sleep management methods when executed by a processor.

[0017] Advantageous effects of the embodiments of the present application:

[0018] The sleep management method provided by the embodiment of the present application can detect, for each target module among various target modules, whether the target module meets any one of multiple sleep conditions. If each target module meets one of the multiple sleep conditions, a preprocessing service corresponding to sleep is executed, and it is detected whether a request for a busy status flag sent by any target module is received during the execution of the preprocessing service. If a request for a busy status flag sent by any target module is received during the execution of the preprocessing service, the sleep process is ended. Otherwise, a target notification for instructing the microcontroller to power down the SOC is sent to the microcontroller, and the microcontroller powers down the SOC. It can be seen that when each target module meets one of the multiple sleep conditions and no request for a busy status flag sent by any target module is received during the execution of the preprocessing service, a notification for instructing the microcontroller to power down the SOC can be sent to the microcontroller. When a request for a busy status flag sent by any target module is received during the execution of the preprocessing service, that is, when a to-be-processed event is generated, the electronic device will not enter the sleep state but will directly end the sleep process, thereby realizing reversible sleep. Compared with the related art, the events that need to be executed before sleep can be ensured to be executed completely, and there will be no situation of event execution interruption or event loss, improving the user experience. Also, when a request for a busy status flag sent by any target module is received during the execution of the preprocessing service, the electronic device will not enter the sleep state, so there will be no situation of multiple awakenings, which can reduce the power consumption waste caused by repeated awakenings, thereby realizing power consumption reduction.

[0019] Of course, it is not necessary for any product or method implementing the present application to achieve all the above-mentioned advantages simultaneously. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can also obtain other embodiments based on these drawings.

[0021] Figure 1 It is a schematic diagram of the principle of interaction between the SOC of an electronic device and IOT WiFi and MCU in the related art;

[0022] Figure 2 It is a schematic flowchart of a sleep management method provided by an embodiment of the present application;

[0023] Figure 3 It is a schematic flowchart of the interaction between an SOC and a wireless communication module provided by an embodiment of the present application;

[0024] Figure 4 A schematic diagram of the communication process between the SOC and the wireless communication module provided by the embodiment of the present application;

[0025] Fig. 5(a) is a schematic diagram of the interaction principle between the SOC of an electronic device and IOT WiFi and MCU provided by the embodiment of the present application;

[0026] Fig. 5(b) is a schematic diagram of the dormancy management process of the dormancy management module provided by the embodiment of the present application;

[0027] Figure 6 A schematic diagram of the structure of the dormancy management device provided by the embodiment of the present application;

[0028] Figure 7 A schematic diagram of the structure of an electronic device provided by the embodiment of the present application. Specific embodiments

[0029] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art based on the present application belong to the scope of protection of the present application.

[0030] Next, some professional terms in the embodiments of the present application will be briefly introduced:

[0031] MCU: Microcontroller Unit, a microcontroller, used to process events such as buttons and PIR (Passive Infra-Red sensors), and can also wake up the SOC;

[0032] IOT WiFi: It can be called an Internet of Things WiFi module, which is a type of wireless communication module, responsible for dormancy keep-alive and the processing of cloud messages, and can also wake up the SOC;

[0033] Idle waiting time: After an event is processed, the electronic device will enter the dormancy state after the idle waiting time. For example, after receiving the preview end message, the low-power doorbell device will wait for 15 seconds. If no new event is triggered within 15 seconds, it will enter the dormancy state;

[0034] And, for a better understanding of this solution, the related technologies will be introduced below, as Figure 1 shown:

[0035] The MCU 110 is the microcontroller introduced above, the IOT WiFi 120 is the wireless communication module introduced above, and the SOC 130 is the SOC of the electronic device introduced above. The SOC 130 actively acquires the events generated by the MCU 110. The IOT WiFi 120 actively notifies and sends the events generated by the IOT WiFi 120 to the SOC 130. After the SOC 130 acquires the events, each processing module in the SOC 130 can process the acquired events, which can be divided into MCU event processing and WiFi event processing. After the MCU event processing, alarm processing can also be included. The WiFi event processing can specifically include signaling processing, preview, intercom processing, etc. It should be emphasized that each processing module can process the events only when it has a busy status flag. Specifically, the sleep management module of the SOC 130 can actively poll to check whether each processing module has a busy status flag. When each processing module does not have a busy status flag, it needs to execute a preprocessing service before entering the sleep state. This process can also be called go sleep. In addition, the UI module (User Interface) can also have a busy status flag before event processing.

[0036] However, the sleep management module of the SOC 130 actively queries whether each processing module has a busy status flag, which will result in more decision points during the sleep process. Also, during the execution of the preprocessing service, there are events that need to be executed. Since the electronic device will enter the sleep state immediately after the preprocessing service is completed, the events that need to be executed during the execution of the preprocessing service cannot be guaranteed to be executed completely. Exemplarily, the working time of the electronic device is 20s, and the execution time of the preprocessing service may be 2s. The events received during the execution of the preprocessing service (within 2s) cannot be guaranteed to be fully executed.

[0037] Based on the problems introduced above, the embodiments of the present application provide a sleep management method, device, and electronic device.

[0038] Next, the sleep management method provided by the embodiments of the present application will be introduced.

[0039] Among them, the sleep management method provided in the embodiment of the present application can be applied to the SOC of an electronic device. The electronic device introduced in the embodiment of the present application is an electronic device powered by a battery, specifically, it can be a smart cat's eye device, a smart door lock device, etc. The electronic device can be provided with a camera (for example: a smart camera, a smart cat's eye device), or it can be provided without a camera (for example: a battery-powered robot), and the embodiment of the present application does not make specific limitations on this; in addition, the SOC of the electronic device can be pre-set with sleep logic; exemplarily, in one implementation method, the execution subject of the embodiment of the present application can also be a sleep module in the SOC, which can also be called a sleep management module, and the sleep module has built-in sleep logic; in another implementation method, the execution subject of the embodiment of the present application can also be a CPU (Central Processing Unit) in the SOC, and the CPU is pre-set with sleep logic, and the embodiment of the present application does not make specific limitations on this.

[0040] Furthermore, the electronic device also includes a microcontroller and a wireless communication module, wherein the wireless communication module may be a WiFi module or a 4G module, for example, the WiFi module may be an IOT WiFi; and, a power control submodule may be provided in the microcontroller, and the power control submodule may be used to power off the SOC; exemplarily, in one implementation, the wireless communication module may also be integrated into the microcontroller, and the embodiments of the present application do not make specific limitations on this; in addition, the user may wake up the SOC of the electronic device through the server / client in the cloud, and the embodiments of the present application do not make specific limitations on this.

[0041] The term "device" or "module" in the embodiments of the present application may refer to a hardware device, a software program, or a software program and the necessary carrier for the operation of the software program. With the evolution of technology, the steps required to be performed or the functions undertaken by these "devices" or "modules" (for example, the steps described later after a certain device is "used" for) may be performed using hardware, software, or a combination of hardware and software. As long as the hardware, software, or a combination of hardware and software can perform the steps required to be performed by the "device" or "module", they can be considered as the "device" or "module" in the embodiments of the present application.

[0042] The following is a brief introduction to the application scenarios of the sleep management method provided in the embodiment of the present application:

[0043] The application scenario of the embodiments of this application can be a security scenario or a robot control scenario. Any application scenario of an electronic device powered by a battery is applicable to the embodiments of this application, and the embodiments of this application do not make specific limitations on the application scenario; Exemplarily: This sleep management method can be applied to an intelligent doorbell device or an AGV (Automated Guided Vehicle) device.

[0044] Among them, a sleep management method is applied to the system on chip (SOC) of an electronic device. The electronic device further includes a wireless communication module and a microcontroller. Each processing module is set in the SOC, and each processing module is a program module for processing events transmitted by the microcontroller or the wireless communication module; The method includes:

[0045] For each target module among the respective target modules, detect whether the target module meets any one of multiple sleep conditions; Among them, the respective target modules include the wireless communication module and each processing module. The event processing method of each target module includes that the target module processes events when it has a busy status flag requested from the SOC, and after meeting the release condition, releases the requested busy status flag. The busy status flag is used to represent the permission to process events. The multiple sleep conditions at least include: whether the processing duration of the event currently being processed by the target module with a busy status flag reaches the maximum working duration allowed for the target module, or whether the idle duration of the target module without a busy status flag reaches a preset idle duration threshold;

[0046] If each of the respective target modules meets one of the multiple sleep conditions, perform a preprocessing service corresponding to sleep, and detect whether a request for a busy status flag is received from any target module during the execution of the preprocessing service;

[0047] If it is detected that a request for a busy status flag is received from any target module during the execution of the preprocessing service, end the sleep process; Otherwise, send a notification to the microcontroller for instructing to power down the SOC, so that the microcontroller responds to the notification and powers down the SOC to make the electronic device enter the sleep state.

[0048] It can be seen that when each target module meets one of the multiple sleep conditions and no request for the busy status flag is received from any target module during the execution of the preprocessing service, a notification for instructing power-off of the SOC can be sent to the microcontroller. During the execution of the preprocessing service, when a request for the busy status flag is received from any target module, that is, when a to-be-processed event is generated, the electronic device will not enter the sleep state but directly end the sleep process, thus realizing reversible sleep. Compared with the related art, the events that need to be executed before sleep can be guaranteed to be executed completely, without the situation of event execution interruption or event loss, improving the user experience. Also, during the execution of the preprocessing service, when a request for the busy status flag is received from any target module, the electronic device will not enter the sleep state, so the situation of multiple awakenings will not occur, and the power consumption waste caused by repeated awakenings can be reduced, thereby realizing power consumption reduction.

[0049] The following introduces a sleep management method provided by an embodiment of the present application with reference to the accompanying drawings.

[0050] As Figure 2 shown, a sleep management method provided by an embodiment of the present application is applied to a system on chip (SOC) of an electronic device. The electronic device further includes a wireless communication module and a microcontroller. Each processing module is provided in the SOC, and each processing module is a program module for processing events transmitted by the microcontroller or the wireless communication module. The method includes:

[0051] S201, for each target module among the target modules, detect whether the target module meets any of the multiple sleep conditions;

[0052] Among them, the target modules include the wireless communication module and each processing module. The event processing method of each target module includes that the target module processes events when it has a busy status flag requested from the SOC, and after meeting the release condition, releases the requested busy status flag. The busy status flag is used to represent the permission to process events. The multiple sleep conditions at least include: whether the processing duration of the event currently being processed by the target module with a busy status flag reaches the maximum working duration allowed by the target module, or whether the idle duration of the target module without a busy status flag reaches a preset idle duration threshold;

[0053] Among them, the form of each processing module can be a software module, and each processing module can execute events. Specifically, each processing module can be a program module in the SOC for processing events transmitted by the microcontroller or wireless communication module; Exemplarily, the processing module can be a WiFi event processing module, an MCU event processing module, and the embodiments of the present application do not make any limitations thereto.

[0054] In addition, the wireless communication module can actively report events, so that the SOC can obtain the events. The MCU can notify the SOC to actively query events through a specific notification method. When the wireless communication module adopts the method of actively reporting events, the SOC can reply or not reply after receiving the events, and the embodiments of the present application do not make specific limitations thereto; Among them, the specific notification method can include any one of hardware interrupt, software interrupt, and software notification. The hardware interrupt can be that the microcontroller notifies the SOC through hardware that there is an event, so that the SOC temporarily stops the execution of the current event and actively obtains the events related to the microcontroller. This method has the highest real-time performance and the least resource occupancy; The software interrupt is that the microcontroller sends a request to the I / O port of the SOC. This method is applicable when the hardware resources are insufficient, and the software interrupt method can be used to notify the SOC that there is an event. The real-time performance is not as high as that of the hardware interrupt, and the resource occupancy is less; The software notification is applicable when both the hardware resources and software resources are insufficient. The software can directly query and inform the SOC that there is an event. The real-time performance is the lowest and the resource occupancy is relatively high; The above three specific notification methods can be selected based on the actual situation, and the embodiments of the present application do not make specific limitations thereto.

[0055] It can be understood that meeting any one of the multiple sleep conditions can be considered as: the processing duration of the event currently being processed by the target module with a busy status flag reaches the maximum working duration allowed by the target module, and the maximum working duration allowed by each target module can be different, and the embodiments of the present application do not make specific limitations thereto; For example: the maximum working duration allowed for the target module processing the intercom event is 20s, and the maximum working duration allowed for the target module processing the image capture event is 5s; In addition, meeting any one of the multiple sleep conditions can also be considered as: the idle duration of the target module without a busy status flag reaches the preset idle duration threshold. Among them, the preset idle duration thresholds for different events are also different. The empirical value of the idle duration threshold for events initiated by users can be 2s, and for events initiated by electronic devices, the idle duration threshold can not be set, that is, the idle duration threshold is 0s, and the embodiments of the present application do not make specific limitations thereto; For example: the idle duration threshold for processing the intercom event is 2s, and the idle duration threshold for the image capture event executed when the intelligent cat's eye device detects someone approaching is 0s.

[0056] In addition, the event handling method for each target module includes that the target module can handle events when it has the busy status flag obtained from the SOC request. Then, when each target module does not have the busy status flag obtained from the SOC request, it can also not handle events; in addition, the event handling method of the wireless communication module is also different from that of each processing module; in addition, after the target module meets the release condition, it can also release the busy status flag obtained by the request, where the busy status flag is used to represent the permission to process events, and the target module with the busy status flag can be considered to have the permission to process events; for the sake of clear layout, the event handling method and release condition of the target module will be introduced in the subsequent embodiments and will not be elaborated here.

[0057] S202. If each target module meets one of the multiple sleep conditions, perform the preprocessing service corresponding to sleep, and detect whether a request for the busy status flag sent by any target module is received during the execution of the preprocessing service;

[0058] It can be understood that if each target module meets one of the multiple sleep conditions, it can be considered that the processing duration of the events currently being processed by the target module with the busy status flag among each target module has reached the maximum working duration allowed by the target module, and the idle duration of the target module without the busy status flag among each target module has reached the preset idle duration threshold.

[0059] Among them, the preprocessing services corresponding to hibernation mainly include screen services, ISP (Image Signal Processing) services, DSP (Digital Signal Process) services, WiFi services, MCU services, logging services, storage services, etc., which are not specifically limited in the embodiments of the present application; among them, the ISP service includes image parameter saving, which can also be called image parameter setting, that is, saving the environmental parameters that affect the images captured by the electronic device, for example: saving the light intensity of the captured images; the DSP service can include DSP environment variable saving, which can also be called DSP environment variable setting, that is, saving the parameters of the images captured by the electronic device, for example: parameters such as resolution and bit rate; the WiFi service can include log acquisition, wake-up packet setting, isolation chip setting, etc., and the isolation chip setting can also be executed after hibernation, and this service does not trigger hibernation reversibility; the MCU service can include MCU parameter setting, infrared lamp off setting, etc., and the infrared lamp off setting can also be executed after hibernation, and this service does not trigger hibernation reversibility; the logging service can include key information backup, log disk flushing, etc.; the storage service can include writing configuration files to the storage medium and video recording processing, etc.

[0060] In addition, during the execution of the preprocessing services corresponding to hibernation, it is also possible to detect whether a request for a busy status flag sent by any target module is received during the execution of the preprocessing services. The busy status flag is used to represent the permission to process an event, and it can also be considered as detecting whether a request for the permission to process an event sent by any target module is received during the execution of the preprocessing services. For the sake of clear layout, it will be introduced in subsequent embodiments and will not be elaborated here.

[0061] S203, if it is detected that a request for a busy status flag sent by any target module is received during the execution of the preprocessing services, then end the hibernation process; otherwise, send a notification to the microcontroller for instructing to power down the SOC, so that the microcontroller responds to the notification and powers down the SOC to make the electronic device enter the hibernation state.

[0062] It can be understood that if it is detected that a request for a busy status flag sent by any target module is received during the execution of the preprocessing service, at this time, the sleep process can be directly ended. Exemplarily, the execution of the preprocessing service can be stopped, and the preprocessing service that has been executed can be retained so that the SOC returns a busy status flag to the target module to end the sleep process. And if it is not detected that a request for a busy status flag sent by any target module is received during the execution of the preprocessing service, a notification for instructing power-down of the SOC can be sent to the microcontroller, and the microcontroller can respond to the notification to power down the SOC so that the electronic device enters the sleep state. In addition, after entering the sleep state, the user can wake up the SOC through the server / client in the cloud, or the SOC can be woken up by the microcontroller or the wireless communication module through an event. The embodiments of the present application do not make specific limitations on this.

[0063] It can be seen that when each target module meets one of the multiple sleep conditions and no request for a busy status flag sent by any target module is received during the execution of the preprocessing service, a notification for instructing power-down of the SOC can be sent to the microcontroller. During the execution of the preprocessing service, when a request for a busy status flag sent by any target module is received, that is, when a pending event occurs, the electronic device will not enter the sleep state but will directly end the sleep process, thereby realizing reversible sleep. Compared with the related art, the events that need to be executed before sleep can be guaranteed to be completed, and there will be no interruption or loss of event execution, improving the user experience. And during the execution of the preprocessing service, when a request for a busy status flag sent by any target module is received, the electronic device will not enter the sleep state, so there will be no situation of multiple wake-ups, which can reduce the power consumption waste caused by repeated wake-ups, thereby realizing power consumption reduction and also reducing the time-consuming of the sleep process, improving the user experience.

[0064] In addition, in the embodiments of the present application, the decision-making of sleep management is centralized in the SOC of the electronic device. The SOC does not need to ask each target module whether it has a busy status flag, but each target module actively requests a busy status flag from the SOC. During the sleep management process, concentrating the decision-making point on the SOC of the electronic device can ensure the reliability of the SOC's detection of the busy status flags of each target module.

[0065] Optionally, in another embodiment, for each target module among the various target modules, detecting whether the target module meets one of the multiple sleep conditions includes steps A1 - A3:

[0066] Step A1, for each target module, detect whether the target module has a busy status flag;

[0067] It is understandable that the SOC can detect whether each target module has a busy status flag. For a target module with a busy status flag, it can be considered as the target module currently processing an event. Then, the method of step A2 can be adopted to detect whether the target module meets one of the multiple sleep conditions; for a target module without a busy status flag, it can be considered as the target module that is not currently processing an event, or it can be considered as the target module in an idle waiting state. Then, the method of step A3 can be adopted to detect whether the target module meets one of the multiple sleep conditions.

[0068] Step A2: If the target module has the busy status flag, detect whether the processing duration of the event currently being processed by the target module reaches the maximum working duration allowed for the target module. If it reaches, determine that the target module meets one of the multiple sleep conditions.

[0069] It is understandable that if the target module has a busy status flag, the processing duration of the event currently being processed by the target module can be detected, that is, to detect whether the processing duration of the event currently being processed by the target module reaches the maximum working duration allowed for the target module. If it reaches, it can be determined that the target module meets one of the multiple sleep conditions. Exemplarily: The maximum working duration allowed for the processing module for processing the intercom event is 20s. Then, when it is detected that the working duration of the processing module exceeds 20s, it can be considered that the processing module meets one of the sleep conditions.

[0070] Step A3: If the target module does not have the busy status flag, detect whether the idle duration of the target module reaches a preset idle duration threshold. If it reaches, determine that the target module meets one of the multiple sleep conditions.

[0071] It is understandable that if the target module does not have a busy status flag, the idle duration of the target module can be detected, that is, to detect whether the idle duration of the target module reaches a preset idle duration threshold. If it reaches, it can be determined that the target module meets one of the multiple sleep conditions. Exemplarily: The idle duration threshold of the processing module for processing the intercom event is 2s. Then, when it is detected that the idle duration of the processing module exceeds 2s, it can be considered that the processing module meets one of the sleep conditions.

[0072] It can be seen that in the embodiments of the present application, for each target module, it can be detected whether the target module meets one of the multiple sleep conditions. For a target module with a busy status flag, it can be detected whether the processing duration of the event currently being processed by the target module reaches the maximum working duration allowed for the target module. For a target module without a busy status flag, it can be detected whether the idle duration of the target module reaches a preset idle duration threshold, so as to determine whether the target module meets one of the multiple sleep conditions, providing an implementation basis for sleep management.

[0073] Optionally, in another embodiment, the event processing of each processing module includes steps B1 - B2:

[0074] Step B1, perform execution analysis on any to - be - processed event;

[0075] Step B2, the event processing method of each processing module further includes, in response to the acquisition of any to - be - processed event, requesting a busy status flag from the SOC;

[0076] The release condition includes step C1:

[0077] Step C1, any to - be - processed event is processed.

[0078] It can be understood that for steps B1 and B2, each processing module is a program module in the SOC for processing events transmitted by the micro - controller or wireless communication module. Therefore, the processing module can perform execution analysis on the to - be - processed event, and step B1 can also be considered as the processing module performing execution on the to - be - processed event; the event processing method of each processing module further includes, in response to the acquisition of any to - be - processed event, requesting a busy status flag from the SOC. Then, before performing execution analysis on any to - be - processed event, a busy status flag can be requested from the SOC, and only after obtaining the busy status flag can execution analysis be performed on any to - be - processed event. Exemplarily, processing module a, in response to the acquisition of to - be - processed event 1, requests a busy status flag from the SOC. After the SOC returns the busy status flag to processing module a, processing module a can perform execution analysis on to - be - processed event 1.

[0079] It can be understood that for step C1, after each processing module finishes processing any to - be - processed event, it can be considered that the release condition is met. At this time, the requested busy status flag can be released, and after release, the busy status flag can be returned to the SOC. The embodiments of the present application do not make specific limitations.

[0080] It can be seen that the event processing by each processing module in the embodiments of the present application may include, in response to the acquisition of any pending event, requesting a busy status flag from the SOC. After obtaining the busy status flag, any pending event can be analyzed and executed. After any pending event is processed, the requested busy status flag can be released, so that the decision-making of sleep management can be centralized in the SOC of the electronic device, and the reliability of the SOC for detecting the busy status flags of each target module can be ensured.

[0081] Optionally, in another embodiment, the event processing by the wireless communication module includes step D1:

[0082] Step D1, transferring any pending event to the SOC so that the processing module of the SOC that matches the wireless communication module executes the pending event;

[0083] When the wireless communication module has a busy status flag requested from the SOC, the event processing includes step E1:

[0084] Step E1, for a pending event that does not meet the predetermined conditions, when having a busy status flag requested from the SOC, perform event processing; wherein, the predetermined conditions include: the electronic device exited the sleep state last time in accordance with the specified triggering method and this pending event is the first event after exiting the sleep state in accordance with the specified triggering method, where the specified triggering method is the method by which the wireless communication module triggers the exit from the sleep state;

[0085] The event processing method of the wireless communication module further includes step F1:

[0086] Step F1, for a pending event that meets the predetermined conditions, when it is acquired, perform event processing;

[0087] The release condition includes step G1:

[0088] Step G1, any pending event is processed.

[0089] It can be understood that for step D1, this embodiment introduces the process of the wireless communication module performing event processing. The wireless communication module can transfer any pending event to the SOC so that the processing module of the SOC that matches the wireless communication module executes the pending event. Among them, the processing module of the SOC that matches the wireless communication module may be the wireless communication module event processing module, for example: the WiFi event processing module. The embodiments of the present application do not make specific limitations on this. In addition, before the processing module of the SOC that matches the wireless communication module executes the pending event, it can also request a busy status flag from the SOC. For details, reference can be made to the above embodiments, and no more details will be elaborated here.

[0090] It can be understood that step E1 is a process in which the wireless communication module performs event processing when it has the busy status flag obtained by requesting from the SOC. When dealing with a pending event that does not meet the predetermined conditions, the wireless communication module can transfer the pending event to the SOC when it has the busy status flag obtained by requesting from the SOC. Among them, the predetermined conditions include: the last time the electronic device exited the sleep state was exited in accordance with the specified triggering method, and the pending event is the first event after exiting the sleep state in accordance with the specified triggering method. The specified triggering method is the method by which the wireless communication module triggers the exit from the sleep state. Then, when the pending event is not the first event triggered by the wireless communication module to exit the sleep state, it can be considered that the predetermined conditions are not met. The wireless communication module can actively request the busy status flag from the SOC. When it has the busy status flag obtained by requesting from the SOC, it can transfer any pending event to the SOC.

[0091] It can be understood that step F1 is the case where the pending event meets the predetermined conditions. The wireless communication module can directly transfer any pending event to the SOC after obtaining the pending event without considering whether the wireless communication module has the busy status flag for the pending event that meets the predetermined conditions (the last time the electronic device exited the sleep state was exited in accordance with the specified triggering method, and the pending event is the first event after exiting the sleep state in accordance with the specified triggering method). Also, since the wireless communication module communicates with the SOC based on SPI (Serial Peripheral Interface) / SDIO (Secure Digital Input / Output), there is also a certain time consumption in the process of the wireless communication module requesting the busy status flag from the SOC.

[0092] It can be understood that for step G1, after any pending event is processed by the processing module of the SOC that matches the wireless communication module, it can be considered that the release condition is met. At this time, the requested busy status flag can be released, and after the release, the busy status flag can be returned to the SOC. The embodiments of the present application do not make specific limitations.

[0093] It can be seen that the wireless communication module in the embodiments of the present application can transfer any pending event to the SOC so that the processing module of the SOC that matches the wireless communication module executes the pending event. The wireless communication module can perform event processing when it has the busy status flag obtained by requesting from the SOC for the pending event that does not meet the predetermined conditions, and can directly perform event processing for the pending event that meets the predetermined conditions, reducing the frequency of requesting the busy status flag, simplifying the interaction process between the wireless communication module and the SOC, and also reducing the communication time consumption between the wireless communication module and the SOC.

[0094] Optionally, in another embodiment, for a pending event that does not meet a predetermined condition, when there is a busy status flag obtained by requesting from the SOC, event processing is performed, including step H1:

[0095] Step H1, for a pending event that does not meet a predetermined condition, if the event that does not meet the predetermined condition is not a specified event, event processing is performed when there is a busy status flag obtained by requesting from the SOC; wherein, the specified event includes the most recent event after the first event or the most recent event after releasing the busy status flag;

[0096] The event processing method of the wireless communication module further includes steps J1-J3:

[0097] Step J1, for a pending event that does not meet a predetermined condition, if the pending event that does not meet the predetermined condition is a specified event, send the request content regarding the busy status flag and the transparent data of the pending event to the SOC;

[0098] Step J2, in response to receiving a feedback result including the busy status flag fed back by the SOC and a predetermined busy status valid duration, determine the target duration of the effective time window based on the busy status valid duration, and keep the wireless communication module in a state with a busy status flag within the effective time window having the target duration; wherein, the effective time window is a window representing the life cycle of the busy status flag in the feedback result;

[0099] Step J3, if no feedback result is received within a predetermined time period, cache the pending event that does not meet the predetermined condition, and detect whether the SOC is powered off. In the case of detecting power-off, send a device wake-up notification to the microcontroller to power on the SOC through the microcontroller so that the electronic device exits the sleep state, and obtain an event from the cache queue to get a pending event;

[0100] The release condition further includes step K1:

[0101] Step K1, detecting that the duration of the effective time window has reached.

[0102] It can be understood that this embodiment is for the case where the wireless communication module faces a to-be-processed event that does not meet the predetermined conditions. Step H1 is a process in which the wireless communication module processes an event in the case of having a busy status flag obtained from the SOC for a to-be-processed event that does not meet the predetermined conditions. For a to-be-processed event that does not meet the predetermined conditions, if the event that does not meet the predetermined conditions is not a specified event, then in the case of having a busy status flag obtained from the SOC, any to-be-processed event is passed to the SOC; specifically, for a to-be-processed event that does not meet the predetermined conditions, if the to-be-processed event does not belong to the most recent event after the first event or the most recent event after releasing the busy status flag, then in the case of having a busy status flag obtained from the SOC, any to-be-processed event is passed to the SOC. In addition, when the to-be-processed event is not a specified event, it can be considered that the wireless communication module does not need to request a busy status flag, and when the to-be-processed event is a specified event, it can be considered that the wireless communication module can request a busy status flag before event processing.

[0103] It can be understood that step J1 is for the case where the to-be-processed event does not meet the predetermined conditions and the to-be-processed event that does not meet the predetermined conditions is a specified event. That is, the wireless communication module can request a busy status flag from the SOC, and can send the request content regarding the busy status flag and the transparent data of the to-be-processed event to the SOC, so that the SOC feeds back the busy status flag to the wireless communication module in response to the request content.

[0104] It can be understood that for step J2, the wireless communication module responds to the feedback result that includes the busy status flag fed back by the SOC and the predetermined busy status valid duration, and can determine the target duration of the effective time window based on the busy status valid duration, and keep the wireless communication module in the state with the busy status flag within the effective time window with the target duration. That is, within the effective time window with the target duration, if there are multiple to-be-processed events, the wireless communication module does not need to request the busy status flag from the SOC multiple times, and can directly continuously pass the to-be-processed events to the SOC, thereby reducing the frequency of requesting the busy status flag in this process; after reaching the target duration of the effective time window, the wireless communication module can request the busy status flag from the SOC again, and the embodiments of the present application do not make specific limitations on this; in addition, the effective time window is a window representing the life cycle of the busy status flag in the feedback result, and the end of the effective time window can be considered that the life cycle of the requested busy status flag has ended.

[0105] For a better understanding of the content regarding step J2, the following is introduced in conjunction with the accompanying drawings, as Figure 3 shown:

[0106] It can be understood that, Figure 3For a to-be-processed event that does not meet a predetermined condition, and the event that does not meet the predetermined condition is a specified event, that is, the event that is the most recent one after the first event or the most recent one after releasing the busy status flag.

[0107] S301, the wireless communication module sends the request content regarding the busy status flag and the passthrough data 1 to the SOC;

[0108] S302, the SOC returns a feedback result including the busy status flag and a predetermined busy status valid duration to the wireless communication module;

[0109] S303, the wireless communication module determines the target duration of the effective time window based on the busy status valid duration;

[0110] S304, the wireless communication module sends the passthrough data 2 to the SOC;

[0111] S305, the wireless communication module sends the passthrough data 3 to the SOC;

[0112] S306, the wireless communication module sends the request content regarding the busy status flag and the passthrough data 4 to the SOC.

[0113] In one implementation manner, the determining the effective time window based on the busy status valid duration includes step J21:

[0114] Step J21, determining the effective time window according to a predetermined calculation formula based on the busy status valid duration; wherein, the predetermined calculation formula includes:

[0115] wt = idle time - t2 - t1 - x;

[0116] wherein, wt is the target duration of the effective time window, idle time is the preset idle duration threshold of the wireless communication module, t1 is the time when the wireless communication module sends the passthrough data to the SOC, t2 is the time when the wireless communication module receives the feedback result, and x is a predetermined error time.

[0117] It can be understood that based on the effective duration of the busy state, an effective time window can be determined according to a predetermined calculation formula. The predetermined calculation formula indicates that the target duration of the effective time window can be obtained by subtracting the time when the wireless communication module receives the feedback result, the time when the wireless communication module sends the transparent data to the SOC, and the predetermined error time from the preset idle duration threshold of the wireless communication module. The empirical value of the predetermined error time is 2s. To prevent other time-consuming during the transmission process, the unit of each of the above-mentioned times can be ms, and the embodiments of the present application do not make specific limitations in this regard. Additionally, usually, the calculated target duration of the effective time window is greater than 0, but there may also be a case where the target duration of the effective time window is 0ms, and the embodiments of the present application do not make specific limitations in this regard.

[0118] It can be seen that the wireless communication module can determine the effective time window based on the effective duration of the busy state, and can directly send the transparent data of the event to be processed to the SOC within the effective time window, reducing the frequency of requesting the busy state flag, simplifying the interaction process between the wireless communication module and the SOC, and also reducing the communication time consumption between the wireless communication module and the SOC.

[0119] It can be understood that for step J3, if the feedback result is not received within the predetermined time period, the event to be processed cannot be continuously sent to the SOC. At this time, the wireless communication module can cache the event to be processed and detect whether the SOC is powered off. In the case of detecting power-off, a device wake-up notification is sent to the microcontroller to power on the SOC through the microcontroller so that the electronic device exits the sleep state, and the event is obtained from the cache queue to get the event to be processed, and there is no need to request the busy state flag from the SOC, and the event to be processed can be directly sent to the SOC. It should be emphasized that the event to be processed obtained by the wireless communication module after triggering the electronic device to exit the sleep state can be considered as an event to be processed that meets the predetermined conditions, and the above-described method for the wireless communication module to trigger the electronic device to exit the sleep state can be considered as a specified triggering method. Additionally, in one implementation, if it is detected that the SOC is not powered off, it is possible to repeatedly detect whether the SOC is powered off until the feedback result sent by the SOC is received, or it is detected that the SOC is powered off; in another implementation, it is possible to repeatedly send the request content regarding the busy state flag and the transparent data of the event to be processed to the SOC until the feedback result sent by the SOC is received, or it is detected that the SOC is powered off, and the embodiments of the present application do not make specific limitations in this regard.

[0120] To better understand the content regarding step J3, it will be introduced below with reference to the accompanying drawings, as Figure 4 shown:

[0121] S401, the wireless communication module sends the request content carrying the busy status flag and the transparent data of the to-be-processed event to the SOC;

[0122] S402, detect whether a feedback result is received within a predetermined time period;

[0123] It can be understood that if so, step S403 is executed; if not, step S404 is executed;

[0124] S403, determine the target duration of the effective time window based on the effective duration of the busy status;

[0125] S404, cache the to-be-processed event that does not meet the predetermined conditions;

[0126] It can be understood that this process can ensure that the to-be-processed events are not lost.

[0127] S405, when detecting that the SOC is powered off, send a device wake-up notification to the microcontroller.

[0128] It can be understood that for step K1, when detecting that the duration of the effective time window has reached, it can be considered that the life cycle of the requested busy status flag has ended and it can be considered that the release condition is met. At this time, the requested busy status flag can be released, and after the release, the busy status flag can return to the SOC. The embodiments of the present application do not make specific limitations.

[0129] It can be seen that for the to-be-processed events that do not meet the predetermined conditions, if the to-be-processed event that does not meet the predetermined conditions is a specified event, the wireless communication module can send the request content carrying the busy status flag and the transparent data of the to-be-processed event to the SOC. If the wireless communication module receives a feedback result, it can determine the target duration of the effective time window, thereby reducing the frequency of requesting the busy status flag, simplifying the interaction process between the wireless communication module and the SOC, and at the same time reducing the communication time consumption between the wireless communication module and the SOC. If the wireless communication module does not receive a feedback result within a predetermined time period, it caches the to-be-processed event that does not meet the predetermined conditions, thereby ensuring that the to-be-processed events can be normally executed and there will be no event loss, improving the user experience.

[0130] Optionally, in another embodiment, after detecting whether each target module in each target module meets any of the multiple sleep conditions, the method further includes steps L1-L2:

[0131] Step L1, if there is at least one target module among the target modules that does not meet any of the multiple sleep conditions, detect whether there is any target module whose working duration has reached the target working duration; wherein, the target working duration is the maximum working duration allowed for any target module to work once.

[0132] Step L2, if there is, trigger the step of executing the preprocessing service corresponding to sleep, otherwise, trigger the step of detecting whether each target module among the target modules meets any of the multiple sleep conditions.

[0133] It can be understood that for Step L1, when there is at least one target module among the target modules that does not meet any of the multiple sleep conditions, it is possible to detect whether there is any target module whose working duration has reached the target working duration. The target working duration can be considered as the maximum working duration allowed for any target module to work once. Since some events can be events with a long working duration, the target working duration can be set relatively large, and the empirical value is 10 minutes. The embodiments of the present application do not make specific limitations on this. In addition, in order to reduce the power consumption of the electronic device, a judgment on forced sleep can be set, and the judgment on the target working duration can be regarded as the judgment on forced sleep.

[0134] It can be understood that for Step L2, when the working duration of any target module has reached the target working duration, the sleep process can be enforced, that is, trigger the step of executing the preprocessing service corresponding to sleep. When the working duration of any target module has not reached the target working duration, the step of detecting whether each target module among the target modules meets any of the multiple sleep conditions can be triggered, so as to implement polling for each target module among the target modules, ensure that the electronic device can enter the sleep state in time, and reduce the power consumption of the electronic device.

[0135] It can be seen that when there is at least one target module among the target modules that does not meet any of the multiple sleep conditions, it is possible to detect whether there is any target module whose working duration has reached the target working duration. If there is, trigger the step of executing the preprocessing service corresponding to sleep, which can reduce the power consumption of the electronic device. Otherwise, poll each target module to ensure that the electronic device can enter the sleep state in time, which also reduces the power consumption of the electronic device.

[0136] To better understand this solution, the above solution will be introduced below with reference to the accompanying drawings, as shown in Figures 5(a) and 5(b):

[0137] Figure 5(a) is a schematic diagram of the principle of interaction between the SOC 130 of the electronic device and the IOT WiFi 120 and the MCU 110 respectively.

[0138] The MCU 110 is the microcontroller introduced above, the IOT WiFi 120 is the wireless communication module introduced above, and the SOC 130 is the SOC of the electronic device introduced above. The SOC 130 actively obtains the events generated by the MCU 110. The IOT WiFi 120 actively notifies and actively sends the events generated by the IOT WiFi 120 to the SOC 130. After obtaining the events, the SOC 130 can process the obtained events by each processing module in the SOC 130, which can be divided into MCU event processing and WiFi event processing. After MCU event processing, alarm processing can also be included. The WiFi event processing can specifically include signaling processing, preview, intercom processing, etc. It should be emphasized that each processing module can actively request a busy status flag from the sleep management module, and can only process events when the sleep management module feedbacks the busy status flag. The sleep management module can perform sleep management on the electronic device. In addition, before event processing, the UI module can also request a busy status flag from the sleep management module.

[0139] Figure 5(b) is a schematic diagram of the process of the sleep management module performing sleep management.

[0140] S501, for each target module in each target module, detect whether the target module meets any of the multiple sleep conditions;

[0141] It can be understood that if it is satisfied, step S503 is executed; if not, step S502 is executed.

[0142] S502, detect whether there is any target module in each target module whose working duration has reached the target working duration;

[0143] It can be understood that if it is satisfied, step S503 is executed; if not, return to step S501.

[0144] S503, execute the preprocessing service corresponding to sleep, and detect whether a request for a busy status flag is received during the execution of the preprocessing service;

[0145] It can be understood that if so, step S504 is executed; if not, step S505 is executed.

[0146] S504, end the sleep process;

[0147] S505, send a notification to the microcontroller to indicate powering down the SOC, so that the microcontroller powers down the SOC in response to the notification, causing the electronic device to enter the sleep state.

[0148] It can be understood that the content introduced in steps S501 - S505 has been introduced in the above embodiments and will not be elaborated here.

[0149] It can be seen that when each target module meets one of the multiple sleep conditions and no request for the busy status flag is received from any target module during the execution of the pre - processing service, a notification for indicating powering down the SOC can be sent to the microcontroller. When a request for the busy status flag is received from any target module during the execution of the pre - processing service, that is, when a pending event occurs, the electronic device will not enter the sleep state but will directly end the sleep process, thus realizing reversible sleep. Compared with the related art, the events that need to be executed before sleep can be ensured to be completed without interruption or loss of events, improving the user experience. Also, when a request for the busy status flag is received from any target module during the execution of the pre - processing service, the electronic device does not enter the sleep state, so there will be no situation of multiple awakenings, which can reduce the power consumption waste caused by repeated awakenings, thus realizing power consumption reduction, reducing the time consumption during the sleep process, improving the user experience, and even achieving the effect that the user is unaware of the sleep of the electronic device.

[0150] In addition, in the embodiment of the present application, the decision - making of sleep management is centralized in the SOC of the electronic device. The SOC does not need to ask each target module whether it has a busy status flag, but each target module actively requests the busy status flag from the SOC. During the sleep management process, concentrating the decision - making point on the SOC of the electronic device can ensure the reliability of the SOC's detection of the busy status flags of each target module.

[0151] Based on the above method embodiment, as Figure 6 shown, the embodiment of the present application provides a sleep management device applied to the system - on - chip (SOC) of an electronic device. The electronic device further includes a wireless communication module and a microcontroller. Each processing module is provided in the SOC and is a program module for processing events transmitted by the microcontroller or the wireless communication module. The device includes:

[0152] The first detection module 610 is configured to detect, for each target module among the various target modules, whether the target module satisfies any one of a plurality of sleep conditions; wherein, the various target modules include the wireless communication module and each processing module, and the event processing mode of each target module includes that the target module performs event processing when having a busy status flag obtained from the SOC, and after satisfying the release condition, releases the requested busy status flag, and the busy status flag is used to represent the permission to process events, and the plurality of sleep conditions at least include: whether the processing duration of the event currently being processed by the target module having the busy status flag reaches the maximum working duration allowed by the target module, or whether the idle duration of the target module without the busy status flag reaches a preset idle duration threshold;

[0153] The execution module 620 is configured to, if each of the various target modules satisfies one of the plurality of sleep conditions, perform a preprocessing service corresponding to sleep, and detect whether a request for a busy status flag sent by any target module is received during the execution of the preprocessing service;

[0154] The sending module 630 is configured to, if it is detected that a request for a busy status flag sent by any target module is received during the execution of the preprocessing service, end the sleep process; otherwise, send a notification for instructing powering down of the SOC to the microcontroller, so that the microcontroller powers down the SOC in response to the notification, and the electronic device enters a sleep state.

[0155] Optionally, the first detection module is specifically configured to:

[0156] For each target module, detect whether the target module has a busy status flag;

[0157] If the target module has the busy status flag, detect whether the processing duration of the event currently being processed by the target module reaches the maximum working duration allowed by the target module, and if it reaches, determine that the target module satisfies one of the plurality of sleep conditions;

[0158] If the target module does not have the busy status flag, detect whether the idle duration of the target module reaches a preset idle duration threshold, and if it reaches, determine that the target module satisfies one of the plurality of sleep conditions.

[0159] Optionally, each processing module performs event processing including:

[0160] Perform execution analysis on any event to be processed;

[0161] The event processing method of each processing module further includes requesting a busy status flag from the SOC in response to the acquisition of any event to be processed;

[0162] The release condition includes:

[0163] Any event to be processed is completed.

[0164] Optionally, the event processing of the wireless communication module includes:

[0165] Transferring any event to be processed to the SOC so that the processing module of the SOC that matches the wireless communication module executes the event to be processed;

[0166] When the wireless communication module has a busy status flag obtained from the SOC, the event processing includes:

[0167] For an event to be processed that does not meet the predetermined condition, when having a busy status flag obtained from the SOC, perform event processing; wherein, the predetermined condition includes: the last time the electronic device exited the sleep state was exited in accordance with the specified trigger method and this event to be processed is the first event after exiting the sleep state in accordance with the specified trigger method, and the specified trigger method is the method by which the wireless communication module triggers the exit from the sleep state;

[0168] The event processing method of the wireless communication module further includes:

[0169] For an event to be processed that meets the predetermined condition, when it is acquired, perform event processing;

[0170] The release condition includes:

[0171] Any event to be processed is completed.

[0172] Optionally, for an event to be processed that does not meet the predetermined condition, when the wireless communication module has a busy status flag obtained from the SOC, the event processing includes:

[0173] For an event to be processed that does not meet the predetermined condition, if the event that does not meet the predetermined condition is not the specified event, then when having a busy status flag obtained from the SOC, perform event processing; wherein, the specified event includes the most recent event after the first event or the most recent event after releasing the busy status flag;

[0174] The event processing method of the wireless communication module further includes:

[0175] For a to-be-processed event that does not meet the predetermined conditions, if the to-be-processed event that does not meet the predetermined conditions is a specified event, send the request content carrying the busy status flag and the passthrough data of the to-be-processed event to the SOC;

[0176] In response to receiving the feedback result including the busy status flag fed back by the SOC and the predetermined busy status valid duration, based on the busy status valid duration, determine the target duration of the valid time window, and keep the wireless communication module in the state with the busy status flag within the valid time window having the target duration; wherein, the valid time window is a window representing the life cycle of the busy status flag in the feedback result;

[0177] If the feedback result is not received within the predetermined time period, cache the to-be-processed event that does not meet the predetermined conditions, and detect whether the SOC is powered off. In the case of detecting power-off, send a device wake-up notification to the microcontroller to power on the SOC through the microcontroller so that the electronic device exits the sleep state, and obtain an event from the cache queue to get the to-be-processed event;

[0178] The release condition further includes:

[0179] It is detected that the duration of the valid time window has reached.

[0180] Optionally, the determining the valid time window based on the busy status valid duration includes:

[0181] Based on the busy status valid duration, determine the valid time window according to a predetermined calculation formula; wherein, the predetermined calculation formula includes:

[0182] wt = idle time - t2 - t1 - x;

[0183] wherein, wt is the target duration of the valid time window, idle time is the preset idle duration threshold of the wireless communication module, t1 is the time when the wireless communication module sends the passthrough data to the SOC, t2 is the time when the wireless communication module receives the feedback result, and x is the predetermined error time.

[0184] Optionally, the device further includes:

[0185] A second detection module, configured to, after detecting whether each target module in each target module meets any of the multiple sleep conditions, if there is at least one target module among the target modules that does not meet any of the multiple sleep conditions, detect whether the working duration of any target module has reached the target working duration; wherein, the target working duration is the maximum working duration allowed for a single operation of any target module.

[0186] A trigger module, configured to trigger the step of performing a preprocessing service corresponding to execution and sleep if it exists; otherwise, trigger the step of detecting whether each target module among the target modules meets any one of a plurality of sleep conditions for each target module.

[0187] In the technical solution of this application, operations such as obtaining, storing, using, processing, transmitting, providing, and disclosing the user's personal information are all carried out with the user's authorization.

[0188] This application embodiment also provides an electronic device, as Figure 7 shown, including:

[0189] A memory 701, configured to store a computer program;

[0190] A processor 702, configured to implement any of the above sleep management methods when executing the program stored on the memory 701.

[0191] And the above electronic device may further include a communication bus and / or a communication interface, and the processor 702, the communication interface, and the memory 701 complete communication with each other through the communication bus.

[0192] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.

[0193] The communication interface is used for communication between the above electronic device and other devices.

[0194] The memory may include a Random Access Memory (RAM), and may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.

[0195] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0196] In another embodiment provided by the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned any sleep management method is implemented.

[0197] In another embodiment provided by the present application, there is also provided a computer program product containing instructions, which when running on a computer, causes the computer to execute any sleep management method in the above embodiments.

[0198] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, a computer, a server, or a data center to another website, a computer, a server, or a data center in a wired manner (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server, a data center, etc. that includes one or more available media integrated. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a Solid State Disk (SSD), etc.

[0199] It should be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.

[0200] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and reference can be made to the relevant parts of the method embodiments for the relevant content.

[0201] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included within the protection scope of the present application.

Claims

1. A sleep management method, characterized in that: A system on chip (SOC) applied to an electronic device, wherein the electronic device further comprises a wireless communication module and a microcontroller, wherein the SOC is provided with various processing modules, each processing module being a program module for processing an event transmitted by the microcontroller or the wireless communication module; the method comprises: For each target module in each target module, detecting whether the target module satisfies any one of a plurality of sleep conditions; wherein the target modules include the wireless communication module and the processing modules, and the event processing method of each target module includes the target module performing event processing when having a busy status flag requested from the SOC, and releasing the requested busy status flag after satisfying a release condition, wherein the busy status flag is used to characterize the authority to process the event, and the plurality of sleep conditions at least include: whether the processing duration of the event currently processed by the target module having the busy status flag reaches the maximum working duration allowed by the target module, or whether the idle duration of the target module without the busy status flag reaches a preset idle duration threshold; If each of the target modules satisfies one of the multiple sleep conditions, a pre-processing service corresponding to the sleep condition is executed, and a request for a busy status flag sent by any target module is detected during the execution of the pre-processing service. If it is detected that a request for a busy status indicator is received from any target module during the execution of the pre-processing service, the sleep process is terminated; otherwise, a notification is sent to the microcontroller to instruct the SOC to power off, so that the microcontroller responds to the notification and powers off the SOC to put the electronic device into a sleep state.

2. The method according to claim 1, characterized in that The step of detecting, for each target module in each target module, whether the target module satisfies one of the multiple sleep conditions comprises: For each target module, detecting whether the target module has a busy status flag; If the target module has the busy status flag, detecting whether the processing time of the event currently processed by the target module reaches the maximum working time allowed by the target module, and if so, determining that the target module satisfies one of the multiple sleep conditions; If the target module does not have the busy status flag, it is detected whether the idle time of the target module reaches a preset idle time threshold. If so, it is determined that the target module meets one of the multiple sleep conditions.

3. The method according to claim 1 or 2, characterized in that: Each processing module performs event processing including: Perform execution analysis on any pending event; The event processing method of each processing module further includes, in response to obtaining any event to be processed, requesting a busy status flag from the SOC; The release conditions include: Any pending event is processed.

4. The method according to claim 1 or 2, characterized in that: The wireless communication module performs event processing including: Transferring any pending event to the SOC so that a processing module of the SOC matching the wireless communication module executes the pending event; The wireless communication module performs event processing when having a busy status flag obtained from the SOC request, including: For pending events that do not meet the predetermined conditions, event processing is performed in the case of a busy status flag obtained from the SOC request; wherein the predetermined conditions include: the electronic device last exited sleep in accordance with a specified triggering method and the pending event is the first event after exiting sleep in accordance with the specified triggering method, wherein the specified triggering method is a method in which the wireless communication module triggers exiting sleep; The event processing method of the wireless communication module also includes: For pending events that meet predetermined conditions, in response to obtaining them, event processing is performed; The release conditions include: Any pending events are processed.

5. The method according to claim 4, characterized in that The wireless communication module performs event processing for pending events that do not meet predetermined conditions, in the case of a busy status flag obtained from the SOC request, including: For the pending event that does not meet the predetermined condition, if the event that does not meet the predetermined condition is not a designated event, the event processing is performed with the busy status indicator obtained from the SOC request; wherein the designated event includes the most recent event after the first event or the most recent event after the busy status indicator is released; The event processing method of the wireless communication module also includes: For the pending event that does not meet the predetermined condition, if the pending event that does not meet the predetermined condition is a designated event, the request content carrying the busy status indicator and the transparent transmission data of the pending event are sent to the SOC; In response to receiving a feedback result including the busy state identifier of the SOC feedback and a predetermined busy state effective duration, a target duration of an effective time window is determined based on the busy state effective duration, and the wireless communication module is kept in a state with the busy state identifier within the effective time window with the target duration; wherein the effective time window is a window representing the life cycle of the busy state identifier in the feedback result; If no feedback result is received within the predetermined time period, the to-be-processed event that does not meet the predetermined condition is cached, and whether the SOC is powered off is detected. If the power off is detected, a device wake-up notification is sent to the microcontroller, so that the SOC is powered on by the microcontroller to make the electronic device exit the sleep state, and the event is obtained from the cache queue to obtain the to-be-processed event; The release conditions also include: It was detected that the validity time window had expired.

6. The method according to claim 5, characterized in that Determining the effective time window based on the effective duration of the busy state includes: Based on the effective duration of the busy state, the effective time window is determined according to a predetermined calculation formula; wherein the predetermined calculation formula includes: wt = idle time - t2 - t1 - x; Among them, wt is the target duration of the effective time window, idle time is the preset idle duration threshold of the wireless communication module, t1 is the time when the wireless communication module sends transparent data to the SOC, t2 is the time when the wireless communication module receives the feedback result, and x is the predetermined error time.

7. The method according to claim 1, characterized in that After detecting, for each target module in each target module, whether the target module satisfies any one of the multiple sleep conditions, the method further includes: If at least one of the target modules does not meet any of the multiple sleep conditions, then detecting whether the working time of any of the target modules has reached the target working time; wherein the target working time is the maximum working time allowed for a single operation of any target module; If so, the step of executing the preprocessing service corresponding to the sleep condition is triggered. Otherwise, the step of detecting whether each target module in each target module satisfies any one of the multiple sleep conditions is triggered.

8. A sleep management device, characterized in that: A system on chip (SOC) applied to an electronic device, wherein the electronic device further comprises a wireless communication module and a microcontroller, wherein the SOC is provided with various processing modules, each processing module being a program module for processing an event transmitted by the microcontroller or the wireless communication module; the device comprises: A first detection module is used to detect, for each target module among the target modules, whether the target module satisfies any of a plurality of sleep conditions; wherein the target modules include the wireless communication module and the processing modules, and the event processing method of each target module includes the target module performing event processing when it has a busy status identifier requested from the SOC, and releasing the requested busy status identifier after a release condition is satisfied, wherein the busy status identifier is used to characterize the authority to process the event, and the plurality of sleep conditions at least include: whether the processing duration of the event currently processed by the target module with the busy status identifier reaches the maximum working duration allowed by the target module, or whether the idle duration of the target module without the busy status identifier reaches a preset idle duration threshold; An execution module, configured to execute a pre-processing service corresponding to the sleep state if each of the target modules satisfies one of the multiple sleep conditions, and detect whether a request for a busy state flag sent by any target module is received during the execution of the pre-processing service; The sending module is used to terminate the sleep process if it detects that a request for a busy status indicator is received from any target module during the execution of a pre-processing service; otherwise, send a notification to the microcontroller to instruct the SOC to be powered off, so that the microcontroller responds to the notification and powers off the SOC to put the electronic device into a sleep state.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-7 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.