A peripheral device power consumption management method, device and computer readable storage medium

By traversing peripheral and process lists, identifying and handling invalid processes, and generating peripheral behavior data, the abstraction problem of power management solutions on the Android operating platform is solved, achieving precise power control and improving user experience.

CN115291711BActive Publication Date: 2026-11-24NUBIA TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210973866.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-15
Publication Date
2026-11-24
Estimated Expiration
2042-08-15

AI Technical Summary

Technical Problem

In existing technologies, the power management solutions of the Android operating platform lack the ability to granularly and intelligently control power consumption on the non-application side of the device, resulting in insufficient perception and accuracy of power consumption control.

Method used

By traversing the peripheral device list, peripheral devices that are identified and shut down or perform low-power processing are identified. Combined with processes that are not found in the process list, are in a sleep or zombie state, or have timed out while waiting for a response, peripheral device behavior data is generated to realize a monitoring solution for non-application side.

Benefits of technology

It improves the perceptibility, accuracy and effectiveness of power consumption management, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115291711B_ABST
    Figure CN115291711B_ABST
Patent Text Reader

Abstract

This invention discloses a peripheral power consumption management method, device, and computer-readable storage medium. The method includes: traversing a preset peripheral linked list and performing shutdown or low-power processing on peripherals in the linked list that have been turned on zero times; for peripherals in the linked list that have been turned on non-zero times, traversing a preset process linked list in units of peripheral dimensions; in the process linked list, deleting a first record node of a process for which no corresponding peripheral is found, or deleting a second record node of a process corresponding to the peripheral that is in a sleep or zombie state, or deleting a third record node of a process corresponding to the peripheral that is in a waiting and unresponsive state for a duration exceeding a preset threshold. This invention effectively avoids the abstractness of conventional monitoring, greatly improves the perceptibility, accuracy, and effectiveness of power consumption management, and enhances the user experience of power consumption management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mobile communications, and more particularly to a peripheral power consumption management method, device, and computer-readable storage medium. Background Technology

[0002] In the current technology, with the continuous development of smart terminal devices, users have increasingly higher requirements for the battery life of mobile phones and other devices. Given that the battery capacity of devices is limited by the overall size of the device, how to improve battery life by reducing overall power consumption has become a relentless goal for major device manufacturers. Currently, the power management solutions of the Android operating platform are merely simple statistics on the power consumption of individual applications, lacking further refined and intelligent power control capabilities.

[0003] Therefore, how to monitor devices from a non-application perspective, avoid the abstract nature of conventional monitoring, and improve the perception, accuracy, and effectiveness of power consumption control has become an urgent technical problem to be solved. Summary of the Invention

[0004] To address the aforementioned technical deficiencies in the prior art, this invention proposes a peripheral power consumption management method, which includes: Traverse the preset peripheral list and perform shutdown or low-power processing on peripherals in the peripheral list that have been opened zero times; For peripherals in the peripheral list that have been opened a non-zero number of times, traverse the preset process list using the peripheral dimension of the peripheral list as the unit; In the process chain, delete the first record node of the process for which no corresponding peripheral is found, and record and count the number of times the first record node is opened; or, delete the second record node of the process corresponding to the peripheral that is in a sleep or zombie state, and record and count the number of times the second record node is opened; or, delete the third record node of the process corresponding to the peripheral that is in a waiting and unresponsive state and whose state duration exceeds a preset threshold, and record and count the number of times the third record node is opened. Peripheral behavior data corresponding to the peripheral is generated based on the number of times it is turned on.

[0005] Optionally, before traversing the preset peripheral list and performing shutdown or low-power processing on peripherals in the peripheral list that have been turned on zero times, the process includes: The peripherals that require power consumption management are statically pre-built in the preset code; Obtain the peripheral node corresponding to the peripheral device, wherein the peripheral node includes the peripheral device name, the number of times it has been opened by the process, and a pointer to the process that it depends on.

[0006] Optionally, before traversing the preset peripheral list and performing shutdown or low-power processing on peripherals in the peripheral list that have been turned on zero times, the method further includes: At the hardware layer, a record node is created for the process that enables or registers the peripheral service corresponding to the peripheral device. The process name, process ID, start time, registration time, processor utilization, and process status of the process are recorded through the recording nodes, and the recording nodes of the peripheral device are counted.

[0007] Optionally, traversing the preset peripheral list and performing shutdown or low-power processing on peripherals in the peripheral list that have been turned on zero times includes: A two-dimensional resource monitoring table is created, using the peripheral devices and their corresponding processes as dimensions. The two-dimensional resource monitoring table is divided into the associated peripheral linked list and the process linked list.

[0008] Optionally, the step of traversing a preset process list, using the peripheral dimension of the peripheral list as the unit, for peripherals in the peripheral list that have been opened a non-zero number of times, includes: The process in the process list is located and analyzed based on the process identification number; Obtain one or more of the following: process name, startup duration, registration duration, processor utilization, and process state.

[0009] Optionally, deleting the first record node of the process for which no corresponding peripheral is found in the process list includes: If no process corresponding to the process ID is found in the process list, it is determined that the process has exited the process. Delete the first record node of the process that has exited the running process.

[0010] Optionally, deleting the second record node of the process corresponding to the peripheral device that is in a sleeping or zombie state from the process list includes: When a process corresponding to the process ID is found in the process chain and the process is in the sleep state or the zombie state, it is determined that the process has stopped running. Delete the second record node of the process that has stopped running.

[0011] Optionally, deleting the third record node of the process corresponding to the peripheral device in the process list that is in a waiting and unresponsive state for a duration exceeding a preset threshold includes: When a process corresponding to the process ID is found in the process chain, and the process is in the waiting and unresponsive state, and the duration of the waiting and unresponsive state exceeds the preset threshold, it is determined that the process's dependency on the peripheral device has failed. Delete the third record node of the process whose dependency on the peripheral device has failed.

[0012] The present invention also proposes a peripheral power consumption management device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the peripheral power consumption management method as described in any of the preceding claims.

[0013] The present invention also proposes a computer-readable storage medium storing a peripheral power management program, which, when executed by a processor, implements the steps of the peripheral power management method as described in any of the preceding claims.

[0014] The peripheral power consumption management method, device, and computer-readable storage medium of this invention traverse a preset peripheral linked list and perform shutdown or low-power processing on peripherals in the peripheral linked list that have been turned on zero times. For peripherals in the peripheral linked list that have been turned on non-zero times, a preset process linked list is traversed in units of peripheral dimensions. In the process linked list, a first record node of a process for which no corresponding peripheral is found is deleted, and the number of times the first record node is turned on is recorded and counted; or, a second record node of a process corresponding to the peripheral that is in a sleep or zombie state is deleted, and the number of times the second record node is turned on is recorded and counted; or, a third record node of a process corresponding to the peripheral that is in a waiting and unresponsive state for a duration exceeding a preset threshold is deleted, and the number of times the third record node is turned on is recorded and counted; peripheral behavior data corresponding to the peripheral is generated based on the number of times the peripheral is turned on. This implements a non-application-side monitoring scheme, effectively avoiding the abstractness of conventional monitoring, greatly improving the perceptibility, accuracy, and effectiveness of power consumption management, and enhancing the user experience of power consumption management. Attached Figure Description

[0015] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings: Figure 1 This is a schematic diagram of the hardware structure of a mobile terminal according to the present invention; Figure 2 This is a flowchart of the first embodiment of the peripheral power consumption control method of the present invention; Figure 3 This is a flowchart of the second embodiment of the peripheral power consumption control method of the present invention; Figure 4This is a flowchart of the third embodiment of the peripheral power consumption control method of the present invention; Figure 5 This is a flowchart of the fourth embodiment of the peripheral power consumption control method of the present invention; Figure 6 This is a flowchart of the fifth embodiment of the peripheral power consumption control method of the present invention; Figure 7 This is a flowchart of the sixth embodiment of the peripheral power consumption control method of the present invention; Figure 8 This is a flowchart of the seventh embodiment of the peripheral power consumption control method of the present invention; Figure 9 This is a flowchart of the eighth embodiment of the peripheral power consumption control method of the present invention; Figure 10 This is a diagram showing the first peripheral control information of the eighth embodiment of the peripheral power consumption control method of the present invention; Figure 11 This is a diagram showing the second peripheral control information of the eighth embodiment of the peripheral power consumption control method of the present invention. Detailed Implementation

[0016] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0017] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.

[0018] Terminals can be implemented in various forms. For example, the terminals described in this invention may include mobile terminals such as mobile phones, tablets, laptops, handheld computers, personal digital assistants (PDAs), portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, etc., as well as fixed terminals such as digital TVs and desktop computers.

[0019] The following description will use a mobile terminal as an example. Those skilled in the art will understand that, apart from elements specifically designed for mobile purposes, the construction according to embodiments of the present invention can also be applied to fixed-type terminals.

[0020] Please see Figure 1This is a schematic diagram of the hardware structure of a mobile terminal implementing various embodiments of the present invention. The mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an A / V (Audio / Video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111, etc. Those skilled in the art will understand that... Figure 1 The mobile terminal structure shown does not constitute a limitation on the mobile terminal. The mobile terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0021] The following is combined with Figure 1 A detailed introduction to each component of the mobile terminal: The radio frequency unit 101 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with the processor 110; additionally, it transmits uplink data to the base station. Typically, the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, and a duplexer. Furthermore, the radio frequency unit 101 can also communicate wirelessly with networks and other devices. The aforementioned wireless communications may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution), and TDD-LTE (Time Division Duplexing-Long Term Evolution).

[0022] WiFi is a short-range wireless transmission technology. Mobile terminals, through the WiFi module 102, can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 1 WiFi module 102 is shown, but it is understood that it is not a necessary component of a mobile terminal and can be omitted as needed without changing the nature of the invention.

[0023] The audio output unit 103 can convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into audio signals and output them as sound when the mobile terminal 100 is in call signal receiving mode, call mode, recording mode, voice recognition mode, broadcast receiving mode, etc. Furthermore, the audio output unit 103 can also provide audio output related to specific functions performed by the mobile terminal 100 (e.g., call signal receiving sound, message receiving sound, etc.). The audio output unit 103 may include a speaker, a buzzer, etc.

[0024] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on the display unit 106. The image frames processed by the GPU 1041 can be stored in the memory 109 (or other storage media) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) in operating modes such as telephone call mode, recording mode, and voice recognition mode, and can process such sound into audio data. The processed audio (voice) data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 101 in telephone call mode. The microphone 1042 can implement various types of noise cancellation (or suppression) algorithms to eliminate (or suppress) noise or interference generated during the reception and transmission of audio signals.

[0025] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1061 according to the ambient light level, and the proximity sensor can turn off the display panel 1061 and / or backlight when the mobile terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, tapping), etc. Other sensors that may be configured in the phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0026] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0027] User input unit 107 can be used to receive input numerical or character information, and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, user input unit 107 may include touch panel 1071 and other input devices 1072. Touch panel 1071, also known as touch screen, can collect touch operations on or near the user (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near touch panel 1071), and drive corresponding connection devices according to a pre-set program. Touch panel 1071 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to processor 110, and can receive and execute commands from processor 110. In addition, touch panel 1071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may also include other input devices 1072. Specifically, other input devices 1072 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc., without being limited here.

[0028] Furthermore, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of touch event. Subsequently, the processor 110 provides corresponding visual output on the display panel 1061 based on the type of touch event. Although in Figure 1 In this embodiment, the touch panel 1071 and the display panel 1061 are two independent components to realize the input and output functions of the mobile terminal. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to realize the input and output functions of the mobile terminal. The specific implementation is not limited here.

[0029] Interface unit 108 serves as an interface through which at least one external device can connect to mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 108 may be used to receive input (e.g., data, power, etc.) from the external device and transmit the received input to one or more elements within mobile terminal 100, or it may be used to transmit data between mobile terminal 100 and the external device.

[0030] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 109 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0031] The processor 110 is the control center of the mobile terminal. It connects various parts of the mobile terminal via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 109, and by calling data stored in the memory 109, it performs various functions and processes data of the mobile terminal, thereby providing overall monitoring of the mobile terminal. The processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 110.

[0032] The mobile terminal 100 may also include a power supply 111 (such as a battery) that supplies power to various components. Preferably, the power supply 111 can be logically connected to the processor 110 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0033] although Figure 1 As not shown, the mobile terminal 100 may also include a Bluetooth module, etc., which will not be described in detail here.

[0034] Based on the above-described mobile terminal hardware structure, various embodiments of the method of the present invention are proposed.

[0035] Example 1 Figure 2 This is a flowchart of the first embodiment of the peripheral power consumption management method of the present invention. A peripheral power consumption management method, the method comprising: S1. Traverse the preset peripheral list and perform shutdown or low-power processing on peripherals in the peripheral list that have been opened zero times; S2. For peripherals in the peripheral list that have been opened a non-zero number of times, traverse the preset process list in units of peripheral dimension of the peripheral list. S3. In the process chain list, delete the first record node of the process for which no corresponding peripheral is found, and record and count the number of times the second record node is opened; or, delete the second record node of the process corresponding to the peripheral that is in a sleep state or zombie state, and record and count the number of times the second record node is opened; or, delete the third record node of the process corresponding to the peripheral that is in a waiting and unresponsive state and whose state duration exceeds a preset threshold, and record and count the number of times the second record node is opened. S4. Generate peripheral behavior data corresponding to the peripheral based on the number of times the device is turned on.

[0036] In this embodiment, the system collects information on the peripherals that are working normally in the system and the processes that depend on the peripherals. A two-dimensional monitoring table is established with peripherals and processes as the dimensions. By monitoring the CPU utilization of processes and the behavior of peripheral operations, it is determined whether a process depends on a peripheral. Based on the comprehensive monitoring information, it is determined whether to turn off the peripherals to reduce power consumption.

[0037] In this embodiment, firstly, a two-dimensional resource monitoring table is established with peripherals and processes as the dimensions; secondly, the process status is traversed in units of peripherals to determine whether peripherals need to be turned off; and thirdly, peripherals that no longer depend on processes are turned off or subjected to low-power operation processing.

[0038] In this embodiment, firstly, a two-dimensional resource monitoring table is established with peripherals and processes as coordinates. Specifically, a two-dimensional linked list data structure is used to organize the resource monitoring table, with one dimension being peripherals and the other being process information. Then, using the peripheral dimension as the unit, the process information that depends on it is comprehensively analyzed. The analysis angles include, but are not limited to, CPU utilization, duration of peripheral access, and process status. Finally, peripherals that no longer depend on processes or have invalid dependencies are forced to operate at low power or are turned off.

[0039] As can be seen, in this embodiment, the aim is to reduce peripheral power consumption by monitoring abnormal operation behavior of various applications that leads to high peripheral power consumption, and to handle the abnormality in a timely manner, rather than the power consumption of conventional applications.

[0040] The beneficial effect of this embodiment is that by traversing a preset peripheral linked list and performing shutdown or low-power processing on peripherals in the peripheral linked list that have been turned on zero times; for peripherals in the peripheral linked list that have been turned on non-zero times, a preset process linked list is traversed in units of peripheral dimensions; in the process linked list, the first record node of the process for which no corresponding peripheral is found is deleted, and the number of times the first record node is turned on is recorded and counted; or, the second record node of the process corresponding to the peripheral that is in a sleep or zombie state is deleted, and the number of times the first record node is turned on is recorded and counted; or, the third record node of the process corresponding to the peripheral that is in a waiting and unresponsive state and whose state duration exceeds a preset threshold is deleted, and the number of times the first record node is turned on is recorded and counted; peripheral behavior data corresponding to the peripheral is generated based on the number of times it is turned on. This implements a non-application-side monitoring scheme, effectively avoiding the abstractness of conventional monitoring, greatly improving the perceptibility, accuracy and effectiveness of power consumption control, and enhancing the user experience of power consumption control.

[0041] Example 2 Figure 3 This is a flowchart of the second embodiment of the peripheral power consumption management method of the present invention. Based on the above embodiment, before traversing the preset peripheral linked list and performing shutdown or low-power processing on peripherals in the peripheral linked list that have been turned on zero times, the process includes: S01. Statically pre-configure the peripherals that require power consumption control in the preset code; S02. Obtain the peripheral node corresponding to the peripheral, wherein the peripheral node includes the peripheral name, the number of times it has been opened by the process, and a pointer to the process that it depends on.

[0042] Optionally, in this embodiment, a two-dimensional resource monitoring table is established with peripherals and processes as the dimensions. Qiz, the establishment of peripherals is static creation, and peripherals that require power consumption management will be statically pre-built in the code, including but not limited to LCD screens, TP touch layer components, fan components, colorful light groups, etc. Peripheral nodes include peripheral names, the number of times they are opened by processes, and pointers to the processes they depend on.

[0043] The beneficial effect of this embodiment is that by statically pre-setting the peripherals requiring power consumption management in the preset code, and obtaining the peripheral nodes corresponding to the peripherals, wherein the peripheral nodes include the peripheral name, the number of times they are started by the process, and a pointer to the process that the peripherals depend on, a non-application-side monitoring scheme is implemented. This effectively avoids the abstraction of conventional monitoring, greatly improves the perceptibility, accuracy, and effectiveness of power consumption management, and enhances the user experience of power consumption management.

[0044] Example 3 Figure 4 This is a flowchart of the third embodiment of the peripheral power consumption management method of the present invention. Based on the above embodiment, before traversing the preset peripheral linked list and performing shutdown or low-power processing on peripherals in the peripheral linked list that have been turned on zero times, the method further includes: S03. At the hardware layer, create a record node for the process that enables or registers the peripheral service corresponding to the peripheral device; S04. Record the process name, process ID, start time, registration time, processor utilization, and process status of the process through the recording node, and count the recording nodes of the peripheral device.

[0045] Optionally, in this embodiment, a process record node task is created at the hardware layer for the process of opening / registering peripheral services. The record node task records information such as process name, PID (Process Identification), duration of registering / opening peripherals, CPU utilization, and process status, and counts the record nodes in the peripherals, i.e., open_cnt++.

[0046] The beneficial effect of this embodiment is that, at the hardware layer, a record node is created for the process that starts or registers the peripheral service corresponding to the peripheral device; the record node records the process name, process ID, start duration, registration duration, processor utilization, and process status of the process, and counts the record nodes of the peripheral device. This implements a non-application-side monitoring scheme, effectively avoiding the abstractness of conventional monitoring, greatly improving the perceptibility, accuracy, and effectiveness of power consumption management, and enhancing the user experience of power consumption management.

[0047] Example 4 Figure 5 This is a flowchart of the fourth embodiment of the peripheral power consumption control method of the present invention. Based on the above embodiment, the step of traversing the preset peripheral linked list and performing shutdown or low-power processing on peripherals in the peripheral linked list that have been turned on zero times includes: S11. Create a two-dimensional resource monitoring table with the peripheral device and the corresponding process as the dimensions; S12. Divide the two-dimensional resource monitoring table into the associated peripheral linked list and the process linked list.

[0048] Optionally, in this embodiment, in the peripheral device linked list, the process states of the process linked list are traversed in units of peripheral device dimension to determine whether the peripheral device needs to be turned off.

[0049] Optionally, in this embodiment, firstly, the peripheral linked list in the two-dimensional resource monitoring table is traversed, and then the corresponding process linked list is traversed.

[0050] Optionally, in this embodiment, when traversing the peripheral list, if the peripheral open_cnt is 0, the search continues to find the peripheral node of the next peripheral in the peripheral list.

[0051] Optionally, in this embodiment, when the open_cnt of the peripheral is not 0, the process list under the peripheral is traversed again.

[0052] The beneficial effect of this embodiment is that by creating a two-dimensional resource monitoring table with the peripheral device and the corresponding process as the dimensions, and dividing the two-dimensional resource monitoring table into an associated peripheral device linked list and a process linked list, a non-application-side monitoring scheme is implemented. This effectively avoids the abstractness of conventional monitoring, greatly improves the perceptibility, accuracy, and effectiveness of power consumption management, and enhances the user experience of power consumption management.

[0053] Example 5 Figure 6 This is a flowchart of the fifth embodiment of the peripheral power consumption management method of the present invention. Based on the above embodiment, the step of traversing a preset process list for peripherals in the peripheral list that have been opened a non-zero number of times includes, using the peripheral dimension of the peripheral list as the unit: S21. Locate and analyze the process in the process list based on the process identification number; S22. Obtain one or more of the following: process name, startup duration, registration duration, processor utilization, and process state.

[0054] Optionally, in this embodiment, when traversing the process list under the aforementioned peripheral device, the current process status is analyzed, and the process with the corresponding PID is found by using the ps process query command to determine the CPU utilization, process status, and other information of the process.

[0055] The beneficial effect of this embodiment is that it uses the process identifier to find and analyze the process in the process list; it obtains one or more of the process name, start duration, registration duration, processor utilization, and process state of the process. This implements a non-application-side monitoring scheme, effectively avoiding the abstractness of conventional monitoring, greatly improving the perceptibility, accuracy, and effectiveness of power consumption management, and enhancing the user experience of power consumption management.

[0056] Example 6 Figure 7 This is a flowchart of the sixth embodiment of the peripheral power consumption management method of the present invention. Based on the above embodiment, the step of deleting the first record node of the process for which no corresponding peripheral is found in the process chain includes: S31. If no process corresponding to the process identification number is found in the process chain, it is determined that the process has exited the process; S32. Delete the first record node of the process that has exited the running process.

[0057] Optionally, in this embodiment, if the process is not found, it means that the process has exited the program. The process node is then deleted directly, and open_cnt-- is executed on the peripheral device.

[0058] The beneficial effect of this embodiment is that, when no process corresponding to the process identification number is found in the process chain, it is determined that the process has exited execution; the first record node of the exited process is deleted. This implements a non-application-side monitoring scheme, effectively avoiding the abstractness of conventional monitoring, greatly improving the perceptibility, accuracy, and effectiveness of power consumption management, and enhancing the user experience of power consumption management.

[0059] Example 7 Figure 8 This is a flowchart of the seventh embodiment of the peripheral power consumption management method of the present invention. Based on the above embodiment, the step of deleting the second record node of the process corresponding to the peripheral in the process chain list that is in a sleep state or zombie state includes: S33. When the process corresponding to the process identification number is found in the process chain list and the process is in the sleep state or the zombie state, it is determined that the process has stopped running. S34. Delete the second record node of the process that has stopped running.

[0060] Optionally, in this embodiment, when the process is in the sleep state or the zombie state, it is determined that the process has stopped running, the process node is deleted, and open_cnt-- is executed on the peripheral device. Here, the sleep state refers to a process waiting for an event to complete; the zombie state refers to a situation where a child process exits, the parent process is still running, but the parent process has not read the child process's exit status, at which point the child process enters the zombie state.

[0061] The beneficial effect of this embodiment is that, by querying the process chain list and finding the process corresponding to the process identification number, and the process being in the sleep state or the zombie state, it is determined that the process has stopped running; the second record node of the stopped process is then deleted. This implements a non-application-side monitoring scheme, effectively avoiding the abstractness of conventional monitoring, greatly improving the perceptibility, accuracy, and effectiveness of power consumption management, and enhancing the user experience of power consumption management.

[0062] Example 8 Figure 9 This is a flowchart of the eighth embodiment of the peripheral power consumption management method of the present invention. Based on the above embodiment, the step of deleting the third record node of the process corresponding to the peripheral in the process linked list that is in a waiting and unresponsive state and whose state duration exceeds a preset threshold includes: S35. When the process corresponding to the process identification number is found in the process chain, and the process is in the waiting and unresponsive state, and the duration of the waiting and unresponsive state exceeds the preset threshold, it is determined that the process's dependency on the peripheral device has failed. S36. Delete the third record node of the process whose dependency on the peripheral device has failed.

[0063] Optionally, in this embodiment, when the process is in the waiting and unresponsive state and the duration of the waiting and unresponsive state exceeds the preset threshold, it is determined that the process's dependency on the peripheral device has failed, the process node is deleted, and open_cnt-- is executed on the peripheral device. The waiting and unresponsive state includes the Interrupt state and the uninterrupt state, i.e., whether it can respond to asynchronous signals, a communication mechanism unique to Linux processes. Normally, a process can respond to asynchronous signals while in the waiting state. However, there are two situations where a process cannot respond to asynchronous signals while in the waiting state: the former is when the process has just been created and has not completed initialization, in which case the process is in the waiting and unresponsive state; the latter is when the process is performing certain hardware operations and does not want to interrupt the hardware operation process, in which case the process is in the waiting and unresponsive state.

[0064] Optionally, in this embodiment, when the duration of the waiting and unresponsive state exceeds the preset threshold, i.e., open_time has exceeded the one-hour timeout threshold (which can be adjusted accordingly based on the peripheral type or process type), it is determined that the process's dependency on the peripheral has failed, the process node is deleted, and open_cnt-- is executed on the peripheral.

[0065] Optionally, in this embodiment, please refer to Figure 10 The first peripheral control information display diagram shown and Figure 11 The diagram shown illustrates the second peripheral device control information display. In this embodiment, the total number of times peripherals were opened, the number of abnormal openings, the number of abnormal interceptions, and application information related to abnormal peripheral operations are recorded and displayed to the user. This embodiment records the time when peripherals were opened and the time when they were finally closed. For peripherals that were closed normally (e.g., peripherals not forcibly closed using this embodiment's method), the energy saving percentage displayed to the user is 0. For peripherals forcibly closed using this embodiment's method, the energy saving percentage is displayed as xx% by dividing the estimated working time by the actual working time multiplied by 100%.

[0066] The beneficial effect of this embodiment is that, by querying the process list and finding the process corresponding to the process identification number, and the process being in the waiting and unresponsive state, and the duration of the waiting and unresponsive state exceeding the preset threshold, it is determined that the process's dependency on the peripheral device has failed; the third record node of the process whose dependency on the peripheral device has failed is then deleted. This implements a non-application-side monitoring scheme, effectively avoiding the abstractness of conventional monitoring, greatly improving the perceptibility, accuracy, and effectiveness of power consumption management, and enhancing the user experience of power consumption management.

[0067] Example 9 Based on the above embodiments, the present invention also proposes a peripheral power consumption management device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the peripheral power consumption management method as described in any of the above embodiments.

[0068] It should be noted that the above-described device embodiments and method embodiments belong to the same concept. The specific implementation process can be found in the method embodiments, and the technical features in the method embodiments are also applicable to the device embodiments, which will not be repeated here.

[0069] Example 10 Based on the above embodiments, the present invention also proposes a computer-readable storage medium storing a peripheral power consumption management program, which, when executed by a processor, implements the steps of the peripheral power consumption management method as described in any of the above embodiments.

[0070] It should be noted that the above-described medium embodiments and method embodiments belong to the same concept. The specific implementation process can be found in the method embodiments, and the technical features in the method embodiments are also applicable to the medium embodiments, which will not be repeated here.

[0071] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0072] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0073] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0074] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A method for controlling peripheral power consumption, characterized in that, The method includes: Traverse the preset peripheral list and perform shutdown or low-power processing on peripherals in the peripheral list that have been opened zero times; For peripherals in the peripheral list that have been opened a non-zero number of times, traverse the preset process list using the peripheral dimension of the peripheral list as the unit; In the process chain, delete the first record node of the process for which no corresponding peripheral is found, and record and count the number of times the first record node is opened; or, delete the second record node of the process corresponding to the peripheral that is in a sleep or zombie state, and record and count the number of times the second record node is opened; or, delete the third record node of the process corresponding to the peripheral that is in a waiting and unresponsive state and whose state duration exceeds a preset threshold, and record and count the number of times the third record node is opened. And generate peripheral behavior data corresponding to the peripheral based on the number of times it is turned on.

2. The peripheral power consumption control method according to claim 1, characterized in that, Before traversing the preset peripheral list and performing shutdown or low-power processing on peripherals in the peripheral list that have been turned on zero times, the process includes: The peripherals that require power consumption management are statically pre-built in the preset code; Obtain the peripheral node corresponding to the peripheral device, wherein the peripheral node includes the peripheral device name, the number of times it has been opened by the process, and a pointer to the process that it depends on.

3. The peripheral power consumption control method according to claim 2, characterized in that, Before traversing the preset peripheral list and performing shutdown or low-power processing on peripherals in the peripheral list that have been turned on zero times, the method further includes: At the hardware layer, a record node is created for the process that enables or registers the peripheral service corresponding to the peripheral device. The process name, process ID, start time, registration time, processor utilization, and process status of the process are recorded through the recording nodes, and the recording nodes of the peripheral device are counted.

4. The peripheral power consumption control method according to claim 3, characterized in that, The step of traversing the preset peripheral list and performing shutdown or low-power processing on peripherals in the peripheral list that have been turned on zero times includes: A two-dimensional resource monitoring table is created, using the peripheral devices and their corresponding processes as dimensions. The two-dimensional resource monitoring table is divided into the associated peripheral linked list and the process linked list.

5. The peripheral power consumption control method according to claim 4, characterized in that, The step of traversing a preset process list, using the peripheral dimension of the peripheral list as the unit, for peripherals that have been opened a non-zero number of times in the peripheral list, includes: The process in the process list is located and analyzed based on the process identification number; Obtain one or more of the following: process name, startup duration, registration duration, processor utilization, and process state.

6. The peripheral power consumption control method according to claim 5, characterized in that, The step of deleting the first record node of the process for which no corresponding peripheral device is found in the process list includes: If no process corresponding to the process ID is found in the process list, it is determined that the process has exited the process. Delete the first record node of the process that has exited the running process.

7. The peripheral power consumption control method according to claim 6, characterized in that, The step of deleting the second record node of the process corresponding to the peripheral device that is in a sleeping or zombie state from the process list includes: When a process corresponding to the process ID is found in the process chain and the process is in the sleep state or the zombie state, it is determined that the process has stopped running. Delete the second record node of the process that has stopped running.

8. The peripheral power consumption control method according to claim 7, characterized in that, The step of deleting the third record node of the process corresponding to the peripheral device in the process chain list that is in a waiting and unresponsive state for a duration exceeding a preset threshold includes: When a process corresponding to the process ID is found in the process chain, and the process is in the waiting and unresponsive state, and the duration of the waiting and unresponsive state exceeds the preset threshold, it is determined that the process's dependency on the peripheral device has failed. Delete the third record node of the process whose dependency on the peripheral device has failed.

9. A peripheral power consumption management device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the peripheral power consumption management method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a peripheral power consumption management program, which, when executed by a processor, implements the steps of the peripheral power consumption management method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Process processing method, mobile terminal and computer readable storage medium

    CN107239332A

  • Overtime detection method, device and equipment and storage medium

    CN111176869A