Data acquisition method and electronic device under abnormal sleep condition

By recording and sending relevant information on the DSP, the problem of increased power consumption caused by the DSP not sleeping is solved, rapid analysis and solution determination are achieved, and the battery life of the device is improved.

CN117692998BActive Publication Date: 2024-09-13HONOR DEVICE CO LTD
View PDF 16 Cites 0 Cited by

Patent Information

Application Number
CN202310934649.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-27
Publication Date
2024-09-13
Estimated Expiration
2043-07-27

AI Technical Summary

Technical Problem

The digital signal processor (DSP) fails to sleep effectively when it should be sleeping, resulting in increased power consumption of the device and affecting the battery life of the device. Moreover, existing analysis methods are difficult and costly.

Method used

Provide a data acquisition method that records algorithm-related information on the DSP, detects whether the DSP does not sleep, and sends relevant information, on-site information and logs to the server to help developers quickly determine the cause of the DSP not sleeping. The method includes recording relevant information when running the algorithm on the DSP, stopping unnecessary algorithms, deleting relevant information, detecting non-sleeping conditions, and sending remaining algorithm information to the server after detecting non-sleeping.

Benefits of technology

By quickly obtaining and analyzing the reasons why the DSP does not sleep, it helps R&D personnel determine solutions, reduces the difficulty and cost of analysis, and improves the battery life of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117692998B
    Figure CN117692998B
Patent Text Reader

Abstract

The present application provides a method and electronic device for acquiring data under abnormal sleep conditions. Electronic devices such as mobile phones equipped with DSPs can detect whether the DSP is abnormally not in sleep. When it is detected that the DSP is not in sleep, the electronic device can obtain information such as algorithm-related information, DSP on-site information, DSP logs, etc. when the DSP is not in sleep, and send it to the server for analysis and use by researchers and developers, to help researchers and developers quickly determine the cause of the DSP not in sleep, and then determine a solution as soon as possible. Among them, the electronic device can determine whether the DSP is in sleep by timing the sleep timer of the DSP. At the same time, combined with the inactivity of the target application, it is determined whether the DSP should be in sleep but is not in sleep (i.e., not in sleep).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminals, and in particular to methods and electronic devices for acquiring data under abnormal sleep conditions. Background Technology

[0002] Digital signal processors (DSPs) are used to handle computationally intensive tasks such as model inference, image enhancement, and video stream processing. After a DSP completes a computational task and there are no other computational tasks, it will enter a sleep state according to a sleep strategy. However, as the number of algorithms running on DSPs increases and their operating scenarios become more complex, DSPs often fail to sleep when they should, resulting in a sleep-not-sleep problem. This leads to increased power consumption and affects the device's battery life. Summary of the Invention

[0003] This application provides a method and electronic device for acquiring data under abnormal hibernation conditions.

[0004] Electronic devices such as mobile phones equipped with DSPs can detect whether the DSP is experiencing an abnormal situation of not sleeping. When DSP not sleeping is detected, the electronic device can obtain information such as algorithm-related information, DSP status information, and DSP logs, and send them to the server for analysis by developers. This helps developers quickly determine the cause of the DSP not sleeping and thus determine a solution as soon as possible.

[0005] Firstly, this application provides a data acquisition method. This method can be applied to an electronic device including a DSP. The method includes: running a first number of algorithms on the DSP; wherein, when starting to run any algorithm, recording relevant information about the algorithm, the relevant information including at least the algorithm name; stopping the running of a second number of algorithms; deleting the relevant information of the second number of algorithms, the second number being less than or equal to the first number; detecting that the DSP is not in sleep mode, sending the relevant information of the currently remaining third number of algorithms to a server; DSP not in sleep mode means that the DSP should be in sleep mode but is not; wherein, when the target application corresponding to the first number of algorithms is inactive, the DSP should be in sleep mode; inactivity of the target application includes situations where the operation of the target application does not require the DSP to execute any algorithms.

[0006] Implementing the method provided in the first aspect, the electronic device can, while running each algorithm on the DSP, record relevant information about that algorithm and delete that information after stopping execution. Simultaneously, the electronic device can determine the activity of a target application by identifying whether its operation requires the DSP to execute any algorithms, and thus determine whether the DSP should hibernate if it does not. Upon detecting that the DSP is not hibernating, the electronic device can trigger a hibernation anomaly report, sending relevant information about the currently retained algorithms to the server.

[0007] When the target application is inactive, all registered algorithms should be deregistered sequentially, and their associated information should be deleted. Therefore, developers can conveniently and efficiently identify algorithms that might cause the DSP to not sleep by using the information retained when the DSP is not in sleep mode.

[0008] In conjunction with the method provided in the first aspect, in some embodiments, the relevant information also includes one or more of the following: computing power level, voting frequency, and registration time.

[0009] Information such as computing power level, voting frequency, and registration time are important parameters for DSPs to run various algorithms. Based on this information, researchers can more accurately and efficiently determine the reasons why the DSP does not sleep at the algorithm level.

[0010] In conjunction with the method provided in the first aspect, in some embodiments, after detecting that the DSP is not in sleep mode, the method further includes: sending the current DSP's field information to the server, and / or sending the current DSP's log to the server.

[0011] The DSP's field information and logs can further reflect the DSP's working status when it is not in sleep mode, thereby helping R&D personnel to determine the cause of the DSP not sleeping.

[0012] In conjunction with the method provided in the first aspect, in some embodiments, after detecting that the DSP is not sleeping, before sending the relevant information of the currently remaining third number of algorithms to the server, the method further includes: confirming that the duration of the DSP not sleeping has reached a preset value.

[0013] By implementing the method provided in the above embodiments, the electronic device may not trigger a sleep anomaly report until the duration of the DSP not sleeping reaches a preset duration. Only after the duration of the DSP not sleeping reaches the preset duration will the electronic device trigger a sleep anomaly report. This can mask relatively unimportant short-term sleep anomalies, helping developers focus on long-term DSP sleep anomalies, prioritize identifying the causes of long-term DSP sleep anomalies, and thus prioritize resolving these issues.

[0014] In conjunction with the method provided in the first aspect, in some embodiments, detecting that the DSP is not in sleep mode specifically includes: detecting that the target application is inactive and that the sleep timer of the DSP obtained in two consecutive acquisitions is the same; wherein, the sleep timer starts timing after the DSP enters sleep mode and stops timing after the sleep mode ends.

[0015] By implementing the method provided in the above embodiments, an electronic device can determine whether the DSP is in sleep mode by tracking the sleep timer of the DSP, and thus determine whether the DSP should be in sleep mode. Simultaneously, by considering the inactivity of the target application, it can be determined whether the DSP is experiencing a problem where it should be in sleep mode but is not (i.e., not in sleep mode).

[0016] In conjunction with the method provided in the first aspect, in some embodiments, confirming that the duration of the DSP not sleeping has reached a preset value specifically includes: continuing to acquire the sleep timer's timing N times; N≥1; when any one of the acquired N timings is the same as the timing of the DSP's sleep timer acquired in the previous two acquisitions, it is determined that the duration of the DSP not sleeping has reached the preset value. N=M-1. Where M is the counting threshold of the non-sleep counter.

[0017] In conjunction with the method provided in the first aspect, in some embodiments, the first number of algorithms include image processing algorithms; the operation of the target application does not require the use of the DSP to execute any algorithms, including the target application turning off the camera.

[0018] In one embodiment, when the target application accesses the camera, the DSP needs to run various image processing algorithms. At this time, the DSP is occupied. When the target application closes the camera, it no longer needs to utilize the DSP to execute these image processing algorithms. At this point, the DSP should enter sleep mode.

[0019] In conjunction with the method provided in the first aspect, in some embodiments, the target application includes one or more of a camera application, an instant messaging application, and a motion-sensing game application.

[0020] The target application can also be a video editing application. When the target application performs video editing tasks, it requires the DSP to run various image processing algorithms. At this time, the DSP is occupied. When the target application should stop the video editing task, it no longer needs to utilize the DSP to execute the aforementioned image processing algorithms. At this point, the DSP should enter sleep mode. Therefore, in another embodiment, the operation of the target application without utilizing the DSP to execute any algorithms also includes the target application not performing video editing tasks.

[0021] In conjunction with the method provided in the first aspect, in some embodiments, the electronic device includes a hardware abstraction layer (HAL), which includes a detection thread and a reporting module; if the DSP is not sleeping, the relevant information of the remaining third number of algorithms is sent to the server, specifically including: the detection thread detects that the DSP is not sleeping; the reporting module sends the relevant information of the remaining third number of algorithms to the server.

[0022] By implementing the method provided in the above embodiments, the detection thread can independently detect in real time whether the DSP is experiencing a sleep-related problem.

[0023] In conjunction with the method provided in the first aspect, in some embodiments, HAL further includes a state registration module that records relevant information about the algorithms. Specifically, this includes: the state registration module creating a state registry; the state registration module recording relevant information about the algorithms in the state registry; and deleting relevant information about a second number of algorithms. Specifically, this includes: the state registration module deleting relevant information about a second number of algorithms from the state registry, leaving relevant information about a third number of algorithms.

[0024] In a second aspect, this application provides an electronic device including one or more processors and one or more memories; wherein the one or more memories are coupled to one or more processors, and the one or more memories are used to store a computer program, which, when executed by one or more processors, causes the electronic device to perform the method described in the first aspect and any possible implementation thereof.

[0025] Thirdly, embodiments of this application provide a chip system applied to an electronic device. The chip system includes one or more processors, which are used to invoke a computer program to cause the electronic device to perform the methods described in the first aspect and any possible implementation thereof.

[0026] Fourthly, this application provides a computer-readable storage medium including a computer program that, when run on an electronic device, causes the electronic device to perform the method described in the first aspect and any possible implementation thereof.

[0027] Fifthly, this application provides a computer program product containing instructions that, when the computer program product is run on an electronic device, cause the electronic device to perform the method described in the first aspect and any possible implementation thereof.

[0028] Understandably, the electronic device provided in the second aspect, the chip system provided in the third aspect, the computer storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method provided in this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here. Attached Figure Description

[0029] Figure 1 This is a system architecture diagram of an Android-based electronic device 100 provided in an embodiment of this application;

[0030] Figure 2 This is a flowchart of a method for detecting whether a DSP is experiencing a sleep-not-sleep problem, provided in an embodiment of this application.

[0031] Figure 3 This is a schematic diagram illustrating the operation of a detection thread in a normal sleep scenario of a DSP, as provided in an embodiment of this application.

[0032] Figure 4 This is a schematic diagram illustrating the operation of a detection thread in a DSP non-sleep scenario, as provided in an embodiment of this application.

[0033] Figure 5 This is a schematic diagram illustrating the operation of the detection thread in another DSP non-sleep scenario provided in this application embodiment;

[0034] Figure 6 A schematic diagram of the structure of the electronic device 100 is shown. Detailed Implementation

[0035] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be a limitation of this application.

[0036] When a DSP completes a computational task and there are no other computational tasks, it will enter a sleep state according to the sleep strategy. However, as more and more algorithms run on the DSP and the working scenarios of the DSP become more complex, the DSP often fails to enter a sleep state when it should, resulting in increased power consumption and affecting the device's battery life.

[0037] Before addressing the DSP's sleep-prone behavior, developers first need to identify the causes of sleep-prone behavior within the complex operating scenarios of the DSP. However, sleep-prone issues are often characterized by low probability, difficulty in reproducing, and significant latency. Therefore, post-hoc analysis methods based on full dump mechanisms are difficult and costly.

[0038] In view of this, embodiments of this application provide a data acquisition method for acquiring relevant data when a non-sleep problem occurs, helping R&D personnel to quickly determine the cause of the DSP not sleeping.

[0039] By implementing the above method, an electronic device 100 equipped with a DSP, such as a mobile phone or tablet, can create a status registry. Before each algorithm runs on the DSP, the electronic device 100 can register the relevant information of the algorithm in the aforementioned status registry, and delete the relevant information after stopping the algorithm. This relevant information includes, but is not limited to, the algorithm name, computing power level, voting frequency, and registration time. The relevant information of any algorithm registered in the status registry is also called the algorithm's registration information. In addition, the electronic device 100 can create a detection thread to detect whether the DSP is experiencing a sleep-related problem. When a sleep-related problem occurs, the electronic device 100 can save the status registry, the DSP's on-site data, and the DSP logs, and upload them to the cloud for analysis by R&D personnel. This helps R&D personnel quickly determine the cause of the DSP's sleep-related problem and identify a solution.

[0040] The detection thread periodically acquires the working status of the target application. When the target application is in an inactive state where it does not need to occupy the DSP, the detection thread can obtain the DSP's sleep timer and determine whether the DSP is sleeping by comparing the consistency of two consecutive timers, thus determining whether the DSP is experiencing a sleep-related issue. Specifically, if the target application is in an inactive state and the sleep timer counts are consistent across two consecutive timers, the detection thread can determine that the DSP is experiencing a sleep-related issue.

[0041] In one embodiment, upon detecting a non-sleep issue, the electronic device 100 can immediately save and upload the status registry, the DSP's field data, and the DSP logs.

[0042] In another embodiment, the electronic device can also be configured with a non-sleep counter to record the duration of the non-sleep problem. When the DSP remains in a non-sleep state for an extended period, the electronic device 100 can save and upload the status registry, the DSP's field data, and the DSP logs. This allows developers to focus more intently on scenarios where the DSP remains in a non-sleep state for extended periods, helping them to more quickly identify the cause of the non-sleep issue.

[0043] Not limited to mobile phones and tablets, electronic device 100 can also be a desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, artificial intelligence (AI) device, wearable device, in-vehicle device, smart home device and / or smart city device. The specific type of electronic device 100 is not limited in the embodiments of this application.

[0044] Figure 1 This is a system architecture diagram of an Android-based electronic device 100 provided in an embodiment of this application.

[0045] The Android architecture is a layered architecture. A layered architecture divides the system into several layers. These layers communicate with each other through interfaces. The Android layered architecture can include five layers, from top to bottom: application layer, framework layer, hardware abstraction layer, driver layer, and hardware layer. Figure 1 Only the application layer, hardware abstraction layer, and hardware layer are shown; the framework layer and driver layer are not shown.

[0046] The application layer may include a series of applications. In this embodiment, the application layer includes at least a camera application.

[0047] Camera applications may include multiple algorithms that need to run on a DSP, such as Algorithm 01, Algorithm 02, Algorithm 03, etc. For example, the above algorithms are typically computationally intensive algorithms for processing images, such as white balance algorithms, color correction algorithms, defocus blur algorithms, background blur algorithms, portrait beautification algorithms, and various filter algorithms, etc.

[0048] Beyond camera applications, the application layer also includes other applications that require DSP during operation, especially those that need to access the camera to provide shooting services to users, such as WeChat and TikTok. These applications also include multiple algorithms that need to run on the DSP. Applications that require DSP during runtime can be called target applications, and the algorithms within target applications that need to run on the DSP can be called DSP algorithms.

[0049] The hardware abstraction layer provides a virtual hardware platform for the operating system. In this embodiment, the hardware abstraction layer includes at least a status registration module, a maintenance monitoring system, a reporting module, and a DSP system.

[0050] A DSP system is a virtual hardware platform for the DSP chip at the hardware layer. The DSP system runs various DSP algorithms with the support provided by the DSP chip.

[0051] The state registration module includes a state registry. Upon startup of the target application, the state registration module creates a state registry. When the DSP starts running any DSP algorithm, the state registration module records relevant information about the algorithm in the aforementioned state registry, such as the algorithm name, computing power level (indicating algorithm complexity, which can be reflected by algorithm execution time), voting frequency (indicating the frequency at which the DSP runs the algorithm; for example, if executed per frame in a 30FPS video stream, the algorithm's voting frequency is 1 / 30), and registration time (the time the DSP starts running the algorithm). The information related to any algorithm registered in the state registry is also called the algorithm's registration information. After stopping the algorithm, the state registration module can delete the algorithm's registration information from the state registry. Stopping means that the algorithm has finished running and is no longer needed for a period of time. For example, the background blur algorithm can be stopped after exiting portrait mode.

[0052] The monitoring system includes a detection thread. After the target application starts, the monitoring system can create and initialize the detection thread. Then, the monitoring system can use the detection thread to detect whether the DSP is experiencing a sleep-not-sleep problem. DSP sleep-not-sleep is an abnormal sleep state of the DSP, specifically referring to the DSP failing to sleep when it should be sleeping when there are no computing tasks. Subsequent embodiments will describe in detail the method of the detection thread for detecting whether the DSP is experiencing a sleep-not-sleep problem; it will not be elaborated here.

[0053] After detecting a problem where the DSP does not sleep, the monitoring system can send a sleep anomaly indication to the DSP system, triggering the DSP system to perform a partial dump (also known as minidump), which saves the DSP's current memory information, register information and other valid information to a file, that is, saves the DSP's on-site information.

[0054] Simultaneously, the maintenance system can send a sleep anomaly indication to the reporting module, indicating that the DSP is not sleeping, triggering the reporting module to report the sleep anomaly to the cloud. In response to the sleep anomaly indication, the reporting module can obtain DSP field information and DSP logs from the DSP system. Simultaneously, the reporting module can also obtain the status registry from the status registration module. Then, the reporting module can report the sleep anomaly to the cloud, and send the aforementioned DSP field information, DSP logs, and status registry together to the cloud for storage, allowing R&D personnel to subsequently analyze and investigate the cause of the DSP not sleeping.

[0055] Taking a camera application as an example, the camera application includes DSP algorithms such as Algorithm 01, Algorithm 02, and Algorithm 03. After the camera application is started, Algorithm 01, Algorithm 02, and Algorithm 03 can be loaded onto the DSP in sequence and run on the DSP. At this time, the state registry in the state registration module can be as shown in Table 1:

[0056] Table 1

[0057]

[0058] For example, at a certain point, the camera application can turn off the camera, switch to background operation (standby), or shut down. Since the camera is off, the camera application no longer needs to process images reported by the camera, and therefore, it no longer needs to run various DSP algorithms. Thus, the camera application can stop the various DSP algorithms running on the DSP. After successful stopping, the DSP algorithm will be deregistered in the state registration module; that is, the registration information of the algorithm will be deleted from the state registry.

[0059] However, for various reasons, the camera application may fail to stop one or more DSP algorithms. In this case, the registration information of the algorithms that failed to stop will be retained in the state registry. For example, the camera application may successfully stop DSP algorithms such as Algorithm 01, but fail to stop Algorithms 02 and 03. Therefore, referring to Table 2, the registration information of Algorithms 02 and 03 will be retained in the state registry.

[0060] Table 2

[0061]

[0062] At this point, if the camera application is running in the background or closed while the DSP is not in sleep mode (e.g., still running one or more DSP algorithms that failed to stop, or other computational tasks), the detection thread can confirm that the DSP is not in sleep mode. Therefore, the reporting module can report the DSP sleep anomaly to the cloud and send the status registry shown in Table 2, along with the current DSP status information and DSP logs, to the cloud. Then, developers can analyze and determine the reason for the DSP not sleeping based on the above information.

[0063] Algorithm 01 was successfully stopped when the camera application was running in the background or closed. This indicates that the DSP's failure to sleep was at least not caused by Algorithm 01. Correspondingly, as shown in Table 2, the registration information for the successfully stopped Algorithm 01 is not included in the status registry at this time. This avoids the need for developers to further analyze whether Algorithm 01 induced the DSP's failure to sleep, and helps developers quickly determine the cause of the DSP's failure to sleep and find a solution to the problem.

[0064] In the implementation scenarios shown in Tables 1 and 2: the camera application can be referred to as the target application; when the camera application stops calling the camera and switches to background operation or is closed, the camera application is inactive; the algorithms 01, 02, 03, etc. shown in Table 1 can be referred to as the first number of algorithms, the stopped DSP algorithms such as Algorithm 01 can be referred to as the second number of algorithms, and the remaining Algorithms 02 and 03 can be referred to as the third number of algorithms.

[0065] Figure 2 This is a flowchart of a method for detecting whether a DSP is experiencing a sleep-not-sleep problem, provided in an embodiment of this application.

[0066] S101. Initialize the detection thread.

[0067] The DSP system includes a sleep timer (SlpTimer). When the DSP enters sleep mode, the SlpTimer turns on and begins timing; when the DSP is woken up, the SlpTimer stops timing. During the time the SlpTimer is on and timing, at any given moment, the SlpTimer's timing corresponds to the current system time of the electronic device 100; after the SlpTimer stops timing, at any given moment, the SlpTimer's timing is the moment it stopped timing.

[0068] For example, SlpTimer starts counting at 00:00 and stops counting at 00:25. Within the time range of 00:00 to 00:25, the timing of SlpTimer at any given moment corresponds to the system time of electronic device 100 at that moment. For example, if SlpTimer's timing is 00:09, then the system time of electronic device 100 is 00:09. After 00:25 and before SlpTimer is turned on again, the timing of SlpTimer can remain at 00:25. During this period, the timing of SlpTimer is the stop time of SlpTimer at 00:25. For example, SlpTimer can be turned on again at system time 01:00. At this time, the timing of SlpTimer is updated from 00:25 to 01:00 and is updated in real time with the system time until SlpTimer is turned off again and stops counting.

[0069] After the detection thread is created in the maintenance and monitoring system, it can be initialized. The detection thread includes the last sleep time parameter, denoted as LastSlpTime. LastSlpTime is used to record the last SlpTimer time obtained by the detection thread. During initialization, the detection thread can set the value of LastSlpTime to 0, i.e., LastSlpTime = 0.

[0070] The detection thread also has a non-sleep counter (NonSlpCounter) to record the duration of the DSP's non-sleep state. After each detection of a non-sleep DSP, the NonSlpCounter value is incremented by 1. During initialization, the detection thread can also set the NonSlpCounter value to 0, i.e., NonSlpCounter = 0.

[0071] S102. Obtain system status and determine whether the target application is active.

[0072] System status can be used to indicate the working state of electronic device 100: working / sleep. When electronic device 100 is working, system status can further indicate the working state of each application on electronic device 100: active / inactive. Therefore, the detection thread can determine whether the target application is active through the above system status. In this embodiment, the working state of the target application running a DSP algorithm (i.e., occupying the DSP) can be called the active state; the working state of the target application not running a DSP algorithm (i.e., not occupying the DSP) can be called the inactive state.

[0073] When the camera is turned on, the DSP algorithms used for image preprocessing (such as white balance algorithms, color correction algorithms, etc.) will inevitably occupy the DSP. Therefore, in one implementation, the working state (active / inactive) of the target application can be determined specifically based on whether the target application has the camera turned on.

[0074] Taking camera apps as an example, when the camera app is running in the foreground, the camera is on. At this time, the camera app is active. When the camera app switches to the background, the camera is off. At this time, the camera app is inactive or dormant. Taking instant messaging apps that support video calls, such as WeChat, as another example, when a video call begins, the camera is on. At this time, WeChat and other instant messaging apps are active. After the video call ends, the camera is off. At this time, WeChat and other instant messaging apps are inactive. Furthermore, even when WeChat and other instant messaging apps are running in the background, they are still inactive.

[0075] The target applications are not limited to camera apps and instant messaging applications such as WeChat; they also include motion-sensing apps and games. This application's embodiments do not impose such limitations.

[0076] The target application can also be a video editing application. Once the video editing application is started and enters any video editing task, it needs to utilize the DSP to execute various image processing algorithms. At this time, the video editing application needs to occupy the DSP, and is therefore active. Conversely, when all video editing tasks are exited, the video editing application no longer needs to occupy the DSP, and is inactive. Therefore, in some implementations, the activity level of the target application can be determined based on whether the target application is executing video editing tasks.

[0077] The detection thread can periodically obtain the system status and then periodically detect whether the target application is active.

[0078] S103. When the target application is inactive, obtain the SlpTimer timer and determine whether the currently obtained SlpTimer timer Ts1 is consistent with the previously obtained SlpTimer timer Ts0.

[0079] When there is only one target application, the inactivity of that single target application is equivalent to the inactivity of the target application. When there are multiple target applications, the inactivity of all target applications is equivalent to the inactivity of the target application.

[0080] At the start of a certain cycle, S102 is executed, and the detection thread can determine that the target application is inactive based on the acquired system status. At this time, the detection thread can obtain the timing of SlpTimer from the DSP system, denoted as Ts1.

[0081] LastSlpTime is used to record the last time the detection thread acquired the SlpTimer. After acquiring the SlpTimer time Ts1, the detection thread can retrieve the last SlpTimer time Ts0 by reading LastSlpTime. Specifically, when the detection thread executes S102 for the first time after creation, the last SlpTimer time obtained by reading LastSlpTime is the initial value of LastSlpTime, for example, 0.

[0082] If the timings (Ts1, Ts0) of SlpTimer are consistent in two consecutive acquisitions, it means that SlpTimer is not enabled, i.e., the DSP is not in sleep mode; conversely, if they are inconsistent, it means that SlpTimer is enabled, and the DSP has entered sleep mode. In scenarios where the target application is inactive, the DSP not being in sleep mode indicates a sleep anomaly where the DSP should be in sleep mode but is not, i.e., a non-sleep problem.

[0083] Therefore, after obtaining Ts1 and Ts0, the detection thread can compare whether Ts1 and Ts0 are consistent, and thus determine whether the DSP has a sleep-not-sleep problem.

[0084] S104. When Ts1 is the same as Ts0, increment the count of the non-sleep counter (NonSlpCounter) and determine whether the count value of NonSlpCounter is greater than or equal to the threshold.

[0085] If the timing values ​​Ts1 and Ts0 of SlpTimer are obtained in two consecutive transactions, it means that SlpTimer is not enabled, i.e., the DSP is not in sleep mode. At this point, the detection thread can confirm that the DSP is not in sleep mode.

[0086] Considering the potential for DSP processing delays, the DSP may still have data to process when the target application exits its active state and will not enter a sleep state. Therefore, the detection thread can set a NonSlpCounter and a count threshold for it to detect whether the DSP has not entered a sleep state for an extended period after the target application has exited its active state.

[0087] Therefore, after detecting that the DSP is not sleeping, the detection thread can first increment the NonSlpCounter count, indicating that the DSP has not slept once. After incrementing the NonSlpCounter count, the detection thread can compare the NonSlpCounter count value with the threshold to determine whether the current NonSlpCounter count value is greater than or equal to the threshold, that is, to determine whether the DSP has not slept for a long time.

[0088] The above thresholds can be set empirically. In particular, considering the impact of the period during which the detection thread acquires the system state on the time range indicated by the NonSlpCounter count, the setting of the above thresholds should also take into account the period during which the detection thread acquires the system state. For example, when the period during which the detection thread acquires the system state is long, the NonSlpCounter counting threshold can be set smaller. When the period during which the detection thread acquires the system state is short, the NonSlpCounter counting threshold can be set larger.

[0089] S105. When the count value of NonSlpCounter is greater than or equal to the threshold, a hibernation anomaly report is triggered.

[0090] If the NonSlpCounter count value is greater than or equal to the threshold, it means that the DSP has not entered a sleep state for a long time. At this time, the detection thread can trigger a sleep anomaly report.

[0091] Combination Figure 1The maintenance and testing system can send a hibernation anomaly indication to the DSP system, triggering the DSP system to perform a minidump to save the on-site information and obtain the DSP's on-site data. Simultaneously, the maintenance and testing system can send a hibernation anomaly indication to the reporting module. In response to the hibernation anomaly indication, the reporting module can obtain the DSP's on-site information, DSP logs, and status registry. Then, the reporting module can report the hibernation anomaly to the cloud, and send the aforementioned DSP on-site information, DSP logs, and status registry to the cloud for storage.

[0092] S106. When the count value of NonSlpCounter is less than the threshold, continue the detection.

[0093] If the NonSlpCounter count is less than the threshold, it means the DSP has not been in a non-sleep state for an extended period. At this point, the detection thread can continue detecting until the NonSlpCounter count is less than or equal to the threshold, triggering a sleep anomaly report. Specifically, at the start of the next cycle, the detection thread can again retrieve the system status to determine if the target application is active, retrieve the SlpTimer timer again, and verify that the two SlpTimer times are consistent, etc.

[0094] S107. When Ts1 and Ts0 are inconsistent, clear the count value of NonSlpCounter to zero, assign the current SlpTimer timer Ts1 to LastSlpTime, update LastSlpTime, and then continue to detect.

[0095] The inconsistency between Ts1 and Ts2 indicates that SlpTimer is enabled, meaning the DSP has entered sleep mode. This suggests that the DSP is not experiencing a sleep-related issue.

[0096] At this point, the detection thread can assign the latest acquired SlpTimer timer Ts1 to LastSlpTime to update LastSlpTime. Thus, during the next execution of S103, the detection thread can obtain the previous SlpTimer timer Ts1 through LastSlpTime, and then compare the latest acquired SlpTimer timer Ts2 with the previous SlpTimer timer Ts1 to determine whether the SlpTimer is running and whether the DSP is in sleep mode.

[0097] Meanwhile, the detection thread can clear the count value of NonSlpCounter to zero. When the count value of NonSlpCounter is not 0 and is less than the threshold, clearing the count value of NonSlpCounter can be used to calculate the duration of the DSP's continuous non-sleep state, that is, to restart the detection of whether the DSP has been in a non-sleep state for a long time.

[0098] S108. When the target application is active, clear the count of NonSlpCounter and then continue the detection.

[0099] An active target application means it is consuming DSP. Accordingly, the DSP will not enter sleep mode, and therefore, there will be no sleep anomaly where it should be sleeping but isn't. In this case, the detection thread only needs to clear the NonSlpCounter count to zero, so that it can recalculate the duration of continuous non-sleep activity of the DSP after detecting non-sleep activity.

[0100] For example, Figure 3 This is a schematic diagram illustrating the operation of a detection thread in a normal sleep scenario of a DSP, as provided in an embodiment of this application.

[0101] like Figure 3 As shown, the coordinate axis T represents time, i.e., the time axis. The time axis has moments T1, T2, T3, ..., Tn-1, Tn with consistent intervals. The interval between any two adjacent moments can represent the preset detection cycle of the detection thread, i.e., the cycle in which the detection thread executes S102 and obtains the system status.

[0102] For example, the monitoring system can create and initialize a detection thread at time T1. After initialization, LastSlpTime = 0, and NonSlpCounter = 0. Subsequently, running S102, the detection thread can confirm that the current target application is active. Therefore, the detection thread can clear the count of NonSlpCounter to zero and then continue detection. At this time, after the first detection, LastSlpTime = 0, and NonSlpCounter = 0.

[0103] Before the next cycle (time T2) arrives, for example, at time TX, the target application can exit the active state and become inactive. For example, if the camera application goes into the background at time TX, it can exit the active state; if instant messaging applications like WeChat end their video call service at time TX, they can exit the active state. At this time, the DSP stops running its various algorithms and enters a sleep state. Simultaneously, the state registration module deregisters the registration information of each DSP algorithm in the state registry. After the DSP enters the sleep state, SlpTimer starts and begins timing. The SlpTimer's timing continuously changes with the system time.

[0104] Then, when the next cycle (time T2) arrives, the detection thread executes S102 again. At this time, the detection thread can confirm that the current target application is inactive. Therefore, the detection thread can obtain the SlpTimer's time, denoted as X1. Comparing X1 with LastSlpTime (at this time, LastSlpTime = 0), the detection thread can determine that the two SlpTimer timeouts are inconsistent. Therefore, the detection thread can clear the NonSlpCounter count value to zero and assign the currently obtained SlpTimer time X1 to LastSlpTime. At this point, after the second detection, LastSlpTime = X1, and NonSlpCounter = 0.

[0105] Continuing, when the next cycle (time T3) arrives, the detection thread executes S102 again. This time, the detection thread continues to confirm that the current target application is inactive. Therefore, the detection thread again acquires the SlpTimer time, denoted as X2, where X2 ≠ X1. Comparing X2 with LastSlpTime (at this time, LastSlpTime = X1), the detection thread determines that the two SlpTimer timeouts are inconsistent. Therefore, the detection thread continues to clear the NonSlpCounter count value to zero and assigns the currently acquired SlpTimer timeout X2 to LastSlpTime. At this point, after the third detection, LastSlpTime = X2, and NonSlpCounter = 0.

[0106] And so on. When time Tn-2 arrives, the detection thread executes S102 again. The detection thread continues to confirm that the current target application is inactive, and therefore, it retrieves the timer Xn-3 of SlpTimer again. At this point, after the (n-2)th detection, LastSlpTime = Xn-3, and NonSlpCounter = 0.

[0107] For example, the DSP can end its sleep cycle at time TY. Time TY is between time Tn-2 and Tn-1. After the sleep cycle ends, the timing of SlpTimer will no longer change.

[0108] At this point, when time Tn-1 arrives, the detection thread executes S102 again. The detection thread can confirm that the target application is currently active, so it can directly clear the count of NonSlpCounter and continue detection. At this time, after the (n-1)th detection, LastSlpTime = Xn-3, and NonSlpCounter = 0.

[0109] like Figure 3As shown, in a scenario where the DSP is in normal sleep mode, the detection thread will not trigger a sleep exception report. Simultaneously, the detection thread can update LastSlpTime in real time to keep it consistent with the DSP system's SlpTimer.

[0110] Figure 4 This is a schematic diagram of the operation of the detection thread in a DSP non-sleep scenario provided in an embodiment of this application.

[0111] like Figure 4 As shown, at time TX, the target application exits the active state and becomes inactive; however, the DSP does not enter sleep mode, resulting in the DSP not sleeping issue. Because the DSP does not enter sleep mode, the SlpTimer is not enabled. The SlpTimer's timing remains at the last time it ended sleep, for example, X0.

[0112] At this point, when time T2 arrives, the detection thread executes S102 again. At this time, the detection thread can confirm that the target application is currently inactive. Therefore, the detection thread can obtain the SlpTimer's timer X0. Comparing X0 with LastSlpTime (at this time, LastSlpTime = 0), the detection thread can determine that the two SlpTimer timers are inconsistent. Therefore, the detection thread can clear the NonSlpCounter count value to zero and assign the currently obtained SlpTimer timer X0 to LastSlpTime. After the second detection, LastSlpTime = X0, and NonSlpCounter = 0.

[0113] When time T3 arrives, the detection thread executes S102 again. At this time, the detection thread continues to confirm that the current target application is inactive. Therefore, the detection thread can obtain the SlpTimer timer. Since SlpTimer is not enabled, the SlpTimer timer obtained by the detection thread is still X0. Comparing X0 with LastSlpTime (at this time, LastSlpTime = X0), the detection thread can determine that the SlpTimer timers are consistent. At this point, the detection thread can determine that the DSP is experiencing a sleep-related issue. Subsequently, the detection thread can increment the NonSlpCounter counter. After the third detection, LastSlpTime = X0, and NonSlpCounter = 1.

[0114] Similarly, when time T8 arrives, the detection thread executes S102 again. The detection thread continues to confirm that the current target application is inactive, and retrieves the SlpTimer timer again, which is still X0. Therefore, the NonSlpCounter count continues to increase. After the 8th detection, LastSlpTime = X0, and NonSlpCounter = 6.

[0115] For example, the threshold of NonSlpCounter can be set to 10. The TY time when the target application resumes its active state is between T8 and T9.

[0116] At this point, when time T9 arrives, the detection thread executes S102 again. The detection thread can then confirm that the target application is active, and therefore can directly reset the NonSlpCounter counter to zero before continuing detection. After the 9th detection, LastSlpTime = X0, and NonSlpCounter = 0.

[0117] Figure 5 This is a schematic diagram of the detection thread working in another DSP non-sleep scenario provided in this application embodiment.

[0118] Similarly, at time TX, the target application exits the active state and enters an inactive or sleep state, but the DSP does not enter a sleep state. Accordingly, SlpTimer is not enabled. The SlpTimer's timing remains at the last sleep time X0. The threshold for NonSlpCounter is 10. The target application resumes its active state at time TY, which can be after time T12, for example, between time T12 and T13.

[0119] like Figure 5 As shown, when time T12 arrives, the detection thread executes S102 again. The detection thread continues to confirm that the current target application is inactive, and the timer obtained again by SlpTimer is still X0. Therefore, the count value of NonSlpCounter continues to increase. After the 12th detection, LastSlpTime = X0, and NonSlpCounter = 10. At this time, NonSlpCounter = 10 reaches the preset threshold, so the detection thread can trigger a sleep anomaly report.

[0120] refer to Figure 4 and Figure 5 When a DSP fails to sleep, the monitoring thread can detect this issue. The monitoring thread will not trigger a sleep anomaly report until the duration of the DSP's sleep failure reaches the preset duration indicated by the NonSlpCounter threshold. Once the duration of the DSP's sleep failure reaches the preset duration indicated by the NonSlpCounter threshold, the monitoring thread will trigger a sleep anomaly report and send the DSP's on-site information, DSP logs, and status registry data to the cloud.

[0121] Setting the NonSlpCounter threshold can mask relatively unimportant short-term non-sleep issues, helping developers focus on long-term DSP non-sleep issues, prioritize identifying the causes of long-term DSP non-sleep issues, and then prioritize solving these issues.

[0122] In some embodiments, the detection thread may not set the NonSlpCounter threshold. In this case, the detection thread can immediately trigger a sleep anomaly report after detecting that the DSP is not sleeping.

[0123] Figure 6 A schematic diagram of the structure of the electronic device 100 is shown.

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

[0125] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0126] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, DSPs, baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0127] The processor 110 may also include a memory for storing instructions and data.

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

[0129] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback.

[0130] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0131] The charging management module 140 receives charging input from the charger. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.

[0132] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, display 194, camera 193, and wireless communication module 160, etc.

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

[0134] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization.

[0135] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1.

[0136] A modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor.

[0137] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

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

[0139] In this embodiment of the application, after triggering the sleep anomaly report, the reporting module can send information such as DSP field information, status registry, and DSP logs at the time of sleep anomaly to the cloud through wireless communication methods such as 2G / 3G / 4G / 5G provided by the mobile communication module 150, or wireless communication methods such as Wi-Fi / Bluetooth / GNSS / FM / NFC / IR provided by the wireless communication module 160.

[0140] Electronic device 100 implements display functions through a GPU, display screen 194, and application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU performs mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information. Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be manufactured using organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), miniled, microled, micro-OLEDs, quantum dot light-emitting diodes (QLEDs), etc.

[0141] In this embodiment of the application, the electronic device 100 can display a user interface (UI) through the display functions provided by the GPU, the display screen 194, and the application processor, such as the shooting interface of a camera application, the interactive interface of an instant messaging application like WeChat, and the video call interface.

[0142] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0143] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, converting it into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise and brightness. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

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

[0145] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0146] In this embodiment, based on the shooting functions provided by the ISP, camera 193, video codec, GPU, display 194, and application processor, target applications such as camera and WeChat can call the camera to perform shooting or video call functions.

[0147] The DSP is used to process digital signals. Besides processing the aforementioned digital image signals, it can also process other digital signals. For example, when the electronic device 100 is selecting a frequency point, the DSP is used to perform Fourier transforms on the frequency energy. Therefore, in this embodiment, the DSP algorithm also includes a frequency point selection algorithm, and the target application also includes applications that implement access network functions based on the frequency point selection algorithm.

[0148] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0149] Random access memory (RAM) can be directly read and written by the processor 110. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data. Non-volatile memory can also store executable programs and user and application data. Executable programs and user and application data stored in non-volatile memory can be pre-loaded into RAM for direct reading and writing by the processor 110.

[0150] In this embodiment, the executable program code and user data of the data acquisition method and DSP sleep-prone detection method described in this embodiment can be stored in non-volatile memory. When implementing the above data acquisition method and DSP sleep-prone detection method, the electronic device 100 can load the executable program code and user data from the non-volatile memory into the random access memory and execute them, thereby realizing real-time detection of whether the DSP is experiencing a sleep-prone problem, and realizing the saving and reporting of relevant data when the DSP is experiencing a sleep-prone problem.

[0151] The external memory interface 120 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to perform data storage functions.

[0152] Electronic device 100 can implement audio functions through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0153] A pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. The electronic device 100 can calculate the position and intensity of a touch based on the detection signal from the pressure sensor 180A. A gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. A barometric pressure sensor 180C is used to measure barometric pressure. A magnetic sensor 180D includes a Hall effect sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set. An accelerometer 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). A distance sensor 180F is used to measure distance. A proximity sensor 180G may include, for example, a light-emitting diode (LED) and a photodetector, such as a photodiode. Electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that an object is near electronic device 100. When insufficient reflected light is detected, electronic device 100 can determine that no object is near electronic device 100. An ambient light sensor 180L is used to sense ambient light intensity. A fingerprint sensor 180H is used to collect fingerprints. A temperature sensor 180J is used to detect temperature. A touch sensor 180K, also called a "touch device," can be placed on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In some embodiments, the touch sensor 180K can also be placed on the surface of electronic device 100, in a different location than display screen 194. A bone conduction sensor 180M can acquire vibration signals. Buttons 190 include a power button, volume buttons, etc. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control. Motor 191 can generate vibration alerts. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, and also to indicate messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card.

[0154] As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the listed items. As used in the above embodiments, depending on the context, the term “when” can be interpreted as meaning “if…” or “after…” or “in response to determining…” or “in response to detecting…”. Similarly, depending on the context, the phrase “when…” or “if (the stated condition or event) is interpreted as meaning “if…” or “in response to determining…” or “when (the stated condition or event) is detected” or “in response to detecting (the stated condition or event)”.

[0155] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially 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, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.

[0156] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A data acquisition method, It is characterized in that Applied to an electronic device, the electronic device includes a digital signal processor DSP, and the method includes: Starting a target application and running a first number of algorithms on the DSP; Wherein, when starting to run any algorithm, relevant information of the algorithm is recorded, and the relevant information at least includes the algorithm name of the algorithm; Closing the target application or switching the target application to background operation, and stopping the operation of the second number of algorithms; deleting relevant information of the second number of algorithms, where the second number is less than or equal to the first number; Detecting that the DSP is not in sleep mode, sending information related to the third number of algorithms currently remaining to the server; The DSP not sleeping means that the DSP should sleep but does not sleep; wherein, when the target application corresponding to the first number of algorithms is inactive, the DSP should sleep; the target application being inactive includes the target application being closed and the target application being switched to background operation.

2. The method according to claim 1, It is characterized in that The relevant information may also include one or more of the following: computing power level, voting frequency, and registration time.

3. The method according to claim 1, It is characterized in that After detecting that the DSP is not in sleep mode, the method further includes: Send the current DSP's on-site information to the server, And / or, sending the current log of the DSP to the server.

4. The method according to any one of claims 1 to 3, It is characterized in that After detecting that the DSP is not in sleep mode and before sending the relevant information of the third number of algorithms currently remaining to the server, the method further includes: It is confirmed that the duration of the DSP not being in sleep mode reaches a preset value.

5. The method according to claim 4, It is characterized in that The detecting that the DSP is not in sleep mode specifically includes: It is detected that the target application is inactive and the sleep timer of the DSP obtained twice is the same; The sleep timer starts timing after the DSP enters sleep mode, and stops timing after the DSP ends sleep mode.

6. The method according to claim 5, It is characterized in that The step of confirming that the duration of the DSP not sleeping reaches a preset value specifically includes: Continue to obtain the timing of the sleep timer N times; wherein N≥1; When any one of the N acquired timings is the same as the timings of the sleep timer of the DSP acquired twice before and after, it is determined that the duration of the DSP not sleeping reaches a preset value.

7. The method according to claim 5, It is characterized in that The first number of algorithms include image processing algorithms; the target application being closed and the target application being switched to background operation include the target application closing a camera.

8. The method according to claim 7, It is characterized in that The target application includes one or more of a camera application, an instant messaging application, and a somatosensory game application.

9. The method according to claim 1, It is characterized in that The electronic device includes a hardware abstraction layer HAL, and the HAL includes a detection thread and a reporting module; the detecting that the DSP is not in sleep mode and sending the relevant information of the remaining third number of algorithms to the server specifically includes: The detection thread detects that the DSP is not in sleep mode; The reporting module sends the relevant information of the remaining third number of algorithms to the server.

10. The method according to claim 9, It is characterized in that The HAL also includes a status registration module, which records the relevant information of the algorithm, specifically including: The state registration module creates a state registration table; The state registration module records the relevant information of the algorithm in the state registration table; The deleting the relevant information of the second number of algorithms specifically includes: The state registration module deletes the relevant information of the second number of algorithms from the state registration table, and the relevant information of the third number of algorithms remains.

11. An electronic device, It is characterized in that The method comprises one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store a computer program, and when the one or more processors execute the computer program, the method according to any one of claims 1 to 10 is executed.

12. A computer-readable storage medium comprising a computer program, It is characterized in that When the computer program is run on an electronic device, the method according to any one of claims 1 to 10 is executed.

Citation Information

Patent Citations

  • A method for utilizing DSP micro dormancy mechanism to save power for terminal

    CN101080050A

  • Dormant background applications on mobile devices

    CN102681896A

  • Methods and apparatus for efficient service layer assistance for modem sleep operations

    CN104885533A

  • Dormancy control system and dormancy control method thereof

    CN106954253A

  • Electronic device and semi-sleep control method thereof

    CN107577479A