CN115291711A - Peripheral power consumption control method and device and computer readable storage medium - Google Patents

Peripheral power consumption control method and device and computer readable storage medium Download PDF

Info

Publication number
CN115291711A
CN115291711A CN202210973866.5A CN202210973866A CN115291711A CN 115291711 A CN115291711 A CN 115291711A CN 202210973866 A CN202210973866 A CN 202210973866A CN 115291711 A CN115291711 A CN 115291711A
Authority
CN
China
Prior art keywords
peripheral
power consumption
linked list
state
recording node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210973866.5A
Other languages
Chinese (zh)
Inventor
牛晓军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN202210973866.5A priority Critical patent/CN115291711A/en
Publication of CN115291711A publication Critical patent/CN115291711A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3293Power saving characterised by the action undertaken by switching to a less power-consuming processor, e.g. sub-CPU
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/325Power saving in peripheral device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Power Sources (AREA)

Abstract

The invention discloses a peripheral power consumption control method, a device and a computer readable storage medium, wherein the method comprises the following steps: traversing a preset peripheral linked list, and executing closing or low-power consumption processing on a peripheral with zero opening times in the peripheral linked list; traversing a preset process linked list by taking the peripheral dimension of the peripheral linked list as a unit for the peripheral with nonzero starting times in the peripheral linked list; in the process linked list, deleting a first recording node of a process corresponding to the peripheral which is not queried, or deleting a second recording node of a process in a sleep state or a zombie state corresponding to the peripheral, or deleting a third recording node of a process which is in a waiting state and cannot respond, and has a state duration exceeding a preset threshold, corresponding to the peripheral. The method and the device effectively avoid the abstraction of conventional monitoring, greatly improve the perceptibility, accuracy and effectiveness of power consumption management and control, and enhance the use experience of a user on the power consumption management and control.

Description

Peripheral power consumption control method and device and computer readable storage medium
Technical Field
The present invention relates to the field of mobile communications, and in particular, to a method and an apparatus for managing and controlling peripheral power consumption, and a computer-readable storage medium.
Background
In the prior art, with the continuous development of intelligent terminal equipment, the cruising ability requirements of users on equipment such as mobile phones are higher and higher. On the premise that the battery capacity of equipment is limited by the size of the whole machine, how to improve the endurance capacity by reducing the power consumption of the whole machine becomes a constantly pursued target of various large equipment manufacturers. At present, a power consumption management scheme of an Android operating platform is only simple statistics of power consumption of each application, and further detailed and intelligent power consumption management and control capabilities are lacked.
Therefore, how to monitor the non-application side of the device, the abstract of the conventional monitoring is avoided, the perception, accuracy and effectiveness of power consumption management and control are improved, and the technical problem to be solved urgently is formed.
Disclosure of Invention
In order to solve the technical defects in the prior art, the invention provides a peripheral power consumption control method, which comprises the following steps:
traversing a preset peripheral linked list, and executing closing or low-power consumption processing on a peripheral with zero opening times in the peripheral linked list;
traversing a preset process linked list by taking the peripheral dimension of the peripheral linked list as a unit for the peripheral with nonzero starting times in the peripheral linked list;
deleting a first recording node of a process corresponding to the peripheral which is not inquired, or deleting a second recording node of a process in a sleep state or a zombie state corresponding to the peripheral, or deleting a third recording node of a process which is in a waiting state and cannot respond, and has a state duration exceeding a preset threshold, corresponding to the peripheral in the process linked list;
recording and counting the opening times of the first recording node, the second recording node and the third recording node, and generating peripheral behavior data corresponding to the peripheral according to the opening times.
Optionally, before traversing a preset peripheral linked list and executing a closing or low power consumption process on a peripheral with zero opening times in the peripheral linked list, the method includes:
statically prefabricating the peripheral needing power consumption management and control in a preset code;
and acquiring a peripheral node corresponding to the peripheral, wherein the peripheral node comprises a peripheral name, the times of starting by the process and a pointer pointing to the process which is depended on.
Optionally, before traversing a preset peripheral linked list and performing shutdown or low power consumption processing on a peripheral with zero opening times in the peripheral linked list, the method further includes:
in a hardware layer, creating a recording node for the process of starting or registering the peripheral service corresponding to the peripheral;
and recording the process name, the process identification number, the starting time, the registration time, the processor occupancy rate and the process state of the process through the recording node, and counting the recording nodes of the peripheral equipment.
Optionally, the traversing a preset peripheral linked list, and performing closing or low power consumption processing on a peripheral with zero opening times in the peripheral linked list includes:
establishing a two-dimensional resource monitoring table by taking the peripheral and the corresponding process as dimensions;
and dividing the two-dimensional resource monitoring table into the associated peripheral linked list and the process linked list.
Optionally, traversing a preset process linked list for the peripherals with nonzero starting times in the peripheral linked list by taking the peripheral dimension of the peripheral linked list as a unit, includes:
searching and analyzing the process in the process linked list according to the process identification number;
and acquiring one or more of the process name, the starting time length, the registration time length, the processor occupancy rate and the process state of the process.
Optionally, the deleting, in the process linked list, a first record node of a process that the peripheral is not queried about, or a second record node of a process that the peripheral is in a sleep state or a zombie state, or a third record node of a process that the peripheral is in a waiting state and cannot respond to the process, and a state duration of which exceeds a preset threshold, includes:
determining that the process exits from operation when the process corresponding to the process identification number is not queried in the process linked list;
deleting the first recording node of the process which is quitted from running.
Optionally, the deleting, in the process chain table, a first recording node of a process to which the peripheral device corresponds is not queried, or a second recording node of a process in a sleep state or a zombie state to which the peripheral device corresponds is deleted, or a third recording node of a process which is in a waiting state and cannot respond, and has a state duration exceeding a preset threshold, further includes:
when the process corresponding to the process identification number is inquired in the process linked list and the process is in the sleep state or the zombie state, determining that the process stops running;
deleting the second recording node of the process which has stopped running.
Optionally, the deleting, in the process chain table, a first recording node of a process to which the peripheral device corresponds is not queried, or a second recording node of a process in a sleep state or a zombie state to which the peripheral device corresponds is deleted, or a third recording node of a process which is in a waiting state and cannot respond, and has a state duration exceeding a preset threshold, further includes:
querying the process corresponding to the process identification number in the process chain table, determining that the process has a dependence failure on the peripheral when the process is in the waiting state and cannot respond, and the state duration of the waiting state and cannot respond exceeds the preset threshold;
deleting the third recording node of the process whose dependency on the peripheral failed.
The invention also provides a peripheral power consumption management and control device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the peripheral power consumption management and control method are realized.
The invention further provides a computer-readable storage medium, where a peripheral power consumption management and control program is stored, and when being executed by a processor, the peripheral power consumption management and control program implements the steps of the peripheral power consumption management and control method according to any one of the above items.
By implementing the peripheral power consumption control method, the peripheral power consumption control device and the computer readable storage medium, the peripheral power consumption control method, the peripheral power consumption control device and the computer readable storage medium perform closing or low-power consumption processing on the peripheral with zero opening times in the peripheral linked list by traversing the preset peripheral linked list; traversing a preset process linked list by taking the peripheral dimension of the peripheral linked list as a unit for the peripheral with nonzero starting times in the peripheral linked list; deleting a first recording node of a process corresponding to the peripheral which is not inquired, or deleting a second recording node of a process in a sleep state or a zombie state corresponding to the peripheral, or deleting a third recording node of a process which is in a waiting state and cannot respond, and has a state duration exceeding a preset threshold, corresponding to the peripheral in the process linked list; recording and counting the opening times of the first recording node, the second recording node and the third recording node, and generating peripheral behavior data corresponding to the peripheral according to the opening times. The monitoring scheme of the non-application side is realized, the abstract of conventional monitoring is effectively avoided, the perceptibility, accuracy and effectiveness of power consumption management and control are greatly improved, and the use experience of a user on the power consumption management and control is enhanced.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
fig. 1 is a schematic diagram of a hardware structure of a mobile terminal according to the present invention;
FIG. 2 is a flowchart of a peripheral power consumption management method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for managing peripheral power consumption according to a second embodiment of the present invention;
FIG. 4 is a flowchart illustrating a method for managing and controlling peripheral power consumption according to a third embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for managing and controlling peripheral power consumption according to a fourth embodiment of the present invention;
fig. 6 is a flowchart of a fifth embodiment of a peripheral power consumption management and control method according to the present invention;
FIG. 7 is a flowchart illustrating a method for managing and controlling peripheral power consumption according to a sixth embodiment of the present invention;
FIG. 8 is a flowchart illustrating a method for managing power consumption of a peripheral device according to a seventh embodiment of the present invention;
fig. 9 is a flowchart of an eighth embodiment of a peripheral power consumption management and control method according to the present invention;
fig. 10 is a first peripheral management control information presentation diagram according to an eighth embodiment of the peripheral power consumption management control method according to the present invention;
fig. 11 is a diagram illustrating second peripheral management control information according to an eighth embodiment of the peripheral power consumption management method of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
In the following description, suffixes such as "module", "part", or "unit" used to indicate elements are used only for facilitating the description of the present invention, and have no particular meaning in themselves. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, wiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following specifically describes the components of the mobile terminal with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), 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 duplex Long Term Evolution), and TDD-LTE (Time Division duplex Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is for receiving an audio or video signal. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of the phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
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 that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or the backlight when the mobile terminal 100 moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing gestures of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometers and taps), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The user input unit 107 may include other input devices 1072 in addition to the touch panel 1071. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation on or near the touch panel, the touch panel is transmitted to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the 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 having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
Based on the hardware structure of the mobile terminal, the invention provides various embodiments of the method.
Example one
Fig. 2 is a flowchart of a peripheral power consumption management and control method according to a first embodiment of the present invention. A method for managing and controlling peripheral power consumption comprises the following steps:
s1, traversing a preset peripheral linked list, and executing closing or low-power consumption processing on a peripheral with zero opening times in the peripheral linked list;
s2, traversing a preset process linked list for the peripherals with nonzero starting times in the peripheral linked list by taking the peripheral dimension of the peripheral linked list as a unit;
s3, deleting a first recording node of a process corresponding to the peripheral which is not inquired, or deleting a second recording node of a process in a sleep state or a zombie state corresponding to the peripheral, or deleting a third recording node of a process which is in a waiting state and cannot respond, and has a state duration exceeding a preset threshold, corresponding to the peripheral in the process linked list;
and S4, recording and counting the opening times of the first recording node, the second recording node and the third recording node, and generating peripheral behavior data corresponding to the peripheral according to the opening times.
In this embodiment, the information of the peripheral devices which normally work in the system of the device and the process information which depends on the peripheral devices are counted, a two-dimensional monitoring table with the peripheral devices and the process as dimensions is established, whether the process depends on the peripheral devices is determined by monitoring the CPU occupancy rate of the process and the behavior rules of peripheral device operation, and the information is comprehensively monitored to determine whether the peripheral devices are closed to reduce power consumption.
In this embodiment, firstly, a two-dimensional resource monitoring table with peripheral devices and processes as dimensions is established; secondly, traversing the process state by taking the peripheral dimension as a unit to determine whether the peripheral needs to be closed; and thirdly, closing and operating the peripheral equipment without process dependence at low power consumption.
In this embodiment, first, a two-dimensional resource monitoring table is established with the peripheral and the process as coordinates, and specifically, the resource monitoring table is organized by using a two-dimensional linked list data structure, where one dimension is the peripheral and two dimensions are the process information; then, taking the external dimension as a unit, and comprehensively analyzing the process information depending on the external dimension, wherein the analysis angle comprises but is not limited to CPU occupancy rate, the time length for opening the external equipment and the process state; and finally, performing forced low-power consumption or shutdown processing on the peripheral which has no process dependence or the peripheral which has invalid dependence.
It can be seen that, in the embodiment, the peripheral power consumption is intended to be reduced by monitoring the peripheral power consumption caused by the abnormal operation behavior of each application on the peripheral and processing the abnormality in time, instead of the conventional application power consumption.
The method has the advantages that the preset peripheral linked list is traversed, and the peripheral with zero starting times in the peripheral linked list is closed or processed with low power consumption; traversing a preset process linked list by taking the peripheral dimension of the peripheral linked list as a unit for the peripheral with nonzero starting times in the peripheral linked list; deleting a first recording node of a process corresponding to the peripheral which is not inquired, or deleting a second recording node of a process in a sleep state or a zombie state corresponding to the peripheral, or deleting a third recording node of a process which is in a waiting state and cannot respond, and has a state duration exceeding a preset threshold, corresponding to the peripheral in the process linked list; recording and counting the opening times of the first recording node, the second recording node and the third recording node, and generating peripheral behavior data corresponding to the peripheral according to the opening times. The monitoring scheme of the non-application side is realized, the abstract of conventional monitoring is effectively avoided, the perceptibility, accuracy and effectiveness of power consumption management and control are greatly improved, and the use experience of a user on the power consumption management and control is enhanced.
Example two
Fig. 3 is a flowchart of a second embodiment of the peripheral power consumption control method according to the present invention, where, based on the above embodiments, before traversing a preset peripheral linked list and executing a shutdown or low power consumption process on a peripheral whose open frequency in the peripheral linked list is zero, the method includes:
s01, statically prefabricating the peripheral needing power consumption control in a preset code;
s02, peripheral nodes corresponding to the peripherals are obtained, wherein the peripheral nodes comprise peripheral names, times of starting by the processes and pointers pointing to the processes depended on.
Optionally, in this embodiment, a two-dimensional resource monitoring table with a peripheral and a process as dimensions is established. Qiz, the peripheral establishment belongs to static establishment, peripherals which need power consumption control can be statically prefabricated in codes, and include but are not limited to peripherals such as an LCD (liquid crystal display) screen, a TP (touch control) layer component, a fan component, a colorful lamp set and the like, and peripheral nodes comprise peripheral names, times of being opened by a process, pointers pointing to depended processes and the like.
The method has the advantages that the peripheral needing power consumption management and control is statically prefabricated in the preset code; and acquiring a peripheral node corresponding to the peripheral, wherein the peripheral node comprises a peripheral name, the number of times of starting by the process and a pointer pointing to the process which is depended on. The monitoring scheme of the non-application side is realized, the abstract of conventional monitoring is effectively avoided, the perceptibility, accuracy and effectiveness of power consumption management and control are greatly improved, and the use experience of a user on the power consumption management and control is enhanced.
EXAMPLE III
Fig. 4 is a flowchart of a method for managing and controlling power consumption of a peripheral device according to a third embodiment of the present invention, where based on the above embodiment, before traversing a preset peripheral device chain table and performing a closing or low power consumption process on a peripheral device whose opening frequency in the peripheral device chain table is zero, the method further includes:
s03, creating a recording node for the process of starting or registering the peripheral service corresponding to the peripheral in a hardware layer;
and S04, recording the process name, the process identification number, the starting time, the registration time, the processor occupancy rate and the process state of the process through the recording node, and counting the recording nodes of the peripheral equipment.
Optionally, in this embodiment, a Process record node task is created for a Process of opening/registering a peripheral service in the Hardware layer, information such as a Process name, a PID (Process Identification, process Identification number, or Process identifier), a peripheral registration/opening duration, a CPU occupancy rate, and a Process state is recorded in the record node task, and a record node in the peripheral is counted, that is, open _ cnt + +.
The method has the advantages that a recording node is created for the process of starting or registering the peripheral service corresponding to the peripheral through a hardware layer; and recording the process name, the process identification number, the starting time, the registration time, the processor occupancy rate and the process state of the process through the recording node, and counting the recording nodes of the peripheral equipment. The monitoring scheme of the non-application side is realized, the abstraction of conventional monitoring is effectively avoided, the perceptibility, accuracy and effectiveness of power consumption management and control are greatly improved, and the use experience of a user on the power consumption management and control is enhanced.
Example four
Fig. 5 is a flowchart of a fourth embodiment of the method for managing and controlling peripheral power consumption according to the present invention, where, based on the above embodiments, the traversing a preset peripheral linked list and performing shutdown or low power consumption processing on a peripheral whose open frequency in the peripheral linked list is zero includes:
s11, establishing a two-dimensional resource monitoring table by taking the peripheral and the corresponding process as dimensions;
and S12, dividing the two-dimensional resource monitoring table into the associated peripheral linked list and the process linked list.
Optionally, in this embodiment, in the peripheral linked list, the process state of the process linked list is traversed by taking an external dimension as a unit, and whether the peripheral needs to be closed is determined.
Optionally, in this embodiment, first, the peripheral linked list in the two-dimensional resource monitoring table is traversed, and then the corresponding process linked list is traversed.
Optionally, in this embodiment, when traversing the peripheral linked list, when the peripheral open _ cnt is 0, the peripheral node of the next peripheral continues to be searched in the traversing the peripheral linked list.
Optionally, in this embodiment, when the open _ cnt of the peripheral is not 0, the process linked list under the peripheral is traversed.
The method has the advantages that the peripheral and the corresponding process are used as dimensions, and the two-dimensional resource monitoring table is created; and dividing the two-dimensional resource monitoring table into the associated peripheral link list and the process link list. The monitoring scheme of the non-application side is realized, the abstraction of conventional monitoring is effectively avoided, the perceptibility, accuracy and effectiveness of power consumption management and control are greatly improved, and the use experience of a user on the power consumption management and control is enhanced.
EXAMPLE five
Fig. 6 is a flowchart of a fifth embodiment of the method for managing and controlling peripheral power consumption according to the present invention, where, based on the above embodiments, traversing a preset process linked list for a peripheral with a non-zero starting time in the peripheral linked list by using a peripheral dimension of the peripheral linked list as a unit includes:
s21, searching and analyzing the process in the process linked list according to the process identification number;
s22, acquiring one or more of the process name, the starting time, the registration time, the processor occupancy rate and the process state of the process.
Optionally, in this embodiment, when traversing the process linked list under the peripheral, the current process state is analyzed, the process corresponding to the PID is searched through the ps process query command, and information such as cpu occupancy rate, process state, and the like of the process is determined.
The method has the advantages that the process in the process linked list is searched and analyzed through the process identification number; and acquiring one or more of the process name, the starting time length, the registration time length, the processor occupancy rate and the process state of the process. The monitoring scheme of the non-application side is realized, the abstract of conventional monitoring is effectively avoided, the perceptibility, accuracy and effectiveness of power consumption management and control are greatly improved, and the use experience of a user on the power consumption management and control is enhanced.
EXAMPLE six
Fig. 7 is a flowchart of a sixth embodiment of a method for managing and controlling power consumption of an external device according to the present invention, where based on the above embodiments, deleting, in the process chain table, a first recording node of a process corresponding to the external device that is not queried, or deleting, in the process chain table, a second recording node of a process in a sleep state or a zombie state that corresponds to the external device, or deleting, in the process chain table, a third recording node of a process that is in a waiting state but cannot respond, and has a state duration exceeding a preset threshold includes:
s31, determining that the process exits from running when the process corresponding to the process identification number is not inquired in the process linked list;
s32, deleting the first recording node of the process which is quitted to run.
Optionally, in this embodiment, when the process is not found, it is described that the process has exited running, the process node is directly deleted, and the open _ cnt is executed to the peripheral.
The method has the advantages that when the process corresponding to the process identification number is not inquired in the process linked list, the process is determined to quit running; deleting the first recording node of the process which is quitted from running. The monitoring scheme of the non-application side is realized, the abstract of conventional monitoring is effectively avoided, the perceptibility, accuracy and effectiveness of power consumption management and control are greatly improved, and the use experience of a user on the power consumption management and control is enhanced.
EXAMPLE seven
Fig. 8 is a flowchart of a seventh embodiment of a method for managing and controlling power consumption of an external device according to the present invention, where based on the above embodiments, the deleting a first recording node of a process corresponding to the external device that is not queried, or deleting a second recording node of a process in a sleep state or a zombie state corresponding to the external device, or deleting a third recording node of a process that is in a waiting state but cannot respond, and has a state duration exceeding a preset threshold, further includes:
s33, when the process corresponding to the process identification number is inquired in the process chain table and the process is in the sleep state or the zombie state, determining that the process stops running;
and S34, deleting the second recording node of the process which stops running.
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 an open _ cnt is executed to an external device. Wherein, the sleeping state (sleeping) means that the process is waiting for the event to be completed; the zombie state (zombie) means that the child process exits, the parent process still runs, but the parent process does not read the exit state of the child process, and at the moment, the child process enters the zombie state.
The method has the advantages that the process is determined to be stopped when the process corresponding to the process identification number is inquired in the process linked list and is in the sleep state or the zombie state; deleting the second recording node of the process which has stopped running. The monitoring scheme of the non-application side is realized, the abstraction of conventional monitoring is effectively avoided, the perceptibility, accuracy and effectiveness of power consumption management and control are greatly improved, and the use experience of a user on the power consumption management and control is enhanced.
Example eight
Fig. 9 is a flowchart of an eighth embodiment of the method for managing and controlling power consumption of a peripheral device, where based on the above embodiments, the method includes deleting, in the process chain table, a first recording node of a process to which the peripheral device corresponds, or deleting a second recording node of a process in a sleep state or a zombie state to which the peripheral device corresponds, or deleting a third recording node of a process to which the peripheral device corresponds, which is in a waiting state but cannot respond, and whose state duration exceeds a preset threshold, and further includes:
s35, when the process corresponding to the process identification number is inquired in the process linked list, the process is in the waiting state and cannot respond, and the state duration of the waiting state and cannot respond exceeds the preset threshold value, determining that the process has failed to depend on the peripheral;
s36, deleting the third recording node of the process with the failed dependence on the peripheral equipment.
Optionally, in this embodiment, when the process is in the wait state and cannot respond, and the state duration of the wait state and cannot respond exceeds the preset threshold, determining that the dependency of the process on the peripheral is invalid, deleting the process node, and executing open _ cnt to the peripheral. The waiting and non-responding state comprises an Interrupt state and an un _ Interrupt state, namely, whether an asynchronous signal of a communication mechanism specific to the Linux process can be responded or not, normally, the process can respond to the asynchronous signal in the waiting state, but the process cannot respond to the asynchronous signal in the waiting state has two cases, namely, when the process is just created and initialization is not completed, the process is in a waiting and non-responding state, and when the process is in some hardware operation, the process does not wish to Interrupt the flow of the hardware operation, and the process is in a waiting and non-responding state.
Optionally, in this embodiment, when the state duration of the wait but no response state exceeds the preset threshold, that is, the open _ time has exceeded a timeout threshold of one hour (which may be adjusted accordingly according to the type of the peripheral or the type of the process), determining that the dependency of the process on the peripheral is invalid, deleting the node of the process, and executing the open _ cnt — on the peripheral.
Optionally, in this embodiment, please refer to the first peripheral management control information presentation diagram shown in fig. 10 and the second peripheral management control information presentation diagram shown in fig. 11. In the embodiment, the total opening times, the abnormal interception times and the application information of the abnormally operated peripheral are counted and prompted to the user. The embodiment records the time when the peripheral is opened and the time when the peripheral is finally closed, for the normally closed peripheral (for example, the peripheral which is not forcibly closed in the embodiment), for example, the percentage of energy consumption saving shown to the user is 0, and for the peripheral which is forcibly closed in the embodiment, the estimated operating time/the operated time x 100% is used to show the percentage of energy consumption saving xx% to the user.
The method has the advantages that when the process corresponding to the process identification number is inquired in the process linked list, the process is in the waiting state and cannot respond, and the state duration of the waiting state and cannot respond exceeds the preset threshold value, the dependence failure of the process on the peripheral equipment is determined; deleting the third logging node of the process whose dependency on the peripheral failed. The monitoring scheme of the non-application side is realized, the abstraction of conventional monitoring is effectively avoided, the perceptibility, accuracy and effectiveness of power consumption management and control are greatly improved, and the use experience of a user on the power consumption management and control is enhanced.
Example nine
Based on the foregoing embodiments, the present invention further provides a peripheral power consumption management and control device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the computer program, when executed by the processor, implements the steps of the peripheral power consumption management and control method according to any one of the foregoing embodiments.
It should be noted that the device embodiment and the method embodiment belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment, and technical features in the method embodiment are correspondingly applicable in the device embodiment, which is not described herein again.
Example ten
Based on the foregoing embodiment, the present invention further provides a computer-readable storage medium, where a peripheral power consumption management and control program is stored on the computer-readable storage medium, and when being executed by a processor, the peripheral power consumption management and control program implements the steps of the peripheral power consumption management and control method according to any one of the foregoing embodiments.
It should be noted that the media embodiment and the method embodiment belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment, and technical features in the method embodiment are correspondingly applicable in the media embodiment, which is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a component of' 8230; \8230;" does not exclude the presence of another like element in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A method for managing and controlling peripheral power consumption is characterized by comprising the following steps:
traversing a preset peripheral linked list, and executing closing or low-power consumption processing on a peripheral with zero opening times in the peripheral linked list;
traversing a preset process linked list by taking the peripheral dimension of the peripheral linked list as a unit for the peripheral with nonzero opening times in the peripheral linked list;
deleting a first recording node of a process corresponding to the peripheral which is not inquired, or deleting a second recording node of a process in a sleep state or a zombie state corresponding to the peripheral, or deleting a third recording node of a process which is in a waiting state and cannot respond, and has a state duration exceeding a preset threshold, corresponding to the peripheral in the process linked list;
recording and counting the opening times of the first recording node, the second recording node and the third recording node, and generating peripheral behavior data corresponding to the peripheral according to the opening times.
2. The method for managing and controlling the power consumption of the peripherals according to claim 1, wherein before traversing a preset peripheral linked list and executing shutdown or low power consumption processing on the peripherals with zero open times in the peripheral linked list, the method comprises:
statically prefabricating the peripheral needing power consumption control in a preset code;
and acquiring a peripheral node corresponding to the peripheral, wherein the peripheral node comprises a peripheral name, the times of starting by the process and a pointer pointing to the process which is depended on.
3. The method for managing and controlling the power consumption of the peripheral according to claim 2, wherein before traversing a preset peripheral chain table and performing a shutdown or low power consumption process on a peripheral with zero number of open times in the peripheral chain table, the method further comprises:
in a hardware layer, creating a recording node for the process of starting or registering the peripheral service corresponding to the peripheral;
and recording the process name, the process identification number, the starting time, the registration time, the processor occupancy rate and the process state of the process through the recording node, and counting the recording nodes of the peripheral equipment.
4. The method for managing and controlling the power consumption of the peripherals according to claim 3, wherein traversing a preset peripheral linked list and performing shutdown or low power consumption processing on the peripherals with zero open times in the peripheral linked list comprises:
establishing a two-dimensional resource monitoring table by taking the peripheral and the corresponding process as dimensions;
and dividing the two-dimensional resource monitoring table into the associated peripheral linked list and the process linked list.
5. The method for managing and controlling the power consumption of the peripherals according to claim 4, wherein traversing a preset process linked list for the peripherals with non-zero starting times in the peripheral linked list by taking the peripheral dimension of the peripheral linked list as a unit comprises:
searching and analyzing the process in the process linked list according to the process identification number;
and acquiring one or more of the process name, the starting time, the registration time, the processor occupancy rate and the process state of the process.
6. The method for managing and controlling peripheral power consumption according to claim 5, wherein deleting, in the process chain table, a first recording node of a process to which the peripheral is not queried, or deleting a second recording node of a process in a sleep state or a zombie state to which the peripheral is corresponding, or deleting a third recording node of a process which is in a waiting state but cannot respond, and has a state duration exceeding a preset threshold, includes:
determining that the process exits from operation when the process corresponding to the process identification number is not queried in the process linked list;
deleting the first recording node of the process which is quitted from running.
7. The method for managing and controlling power consumption of a peripheral device according to claim 6, wherein the deleting, in the process chain table, a first recording node of a process corresponding to the peripheral device that is not queried, or a second recording node of a process in a sleep state or a zombie state corresponding to the peripheral device, or a third recording node of a process that is in a waiting state but cannot respond, and has a state duration exceeding a preset threshold, further comprises:
when the process corresponding to the process identification number is inquired in the process linked list and the process is in the sleep state or the zombie state, determining that the process stops running;
deleting the second recording node of the process which has stopped running.
8. The method for managing and controlling power consumption of a peripheral device according to claim 7, wherein the deleting, in the process chain table, a first recording node of a process corresponding to the peripheral device that is not queried, or a second recording node of a process in a sleep state or a zombie state corresponding to the peripheral device, or a third recording node of a process that is in a waiting state but cannot respond, and has a state duration exceeding a preset threshold, further comprises:
querying the process corresponding to the process identification number in the process chain table, determining that the process has a dependence failure on the peripheral when the process is in the waiting state and cannot respond, and the state duration of the waiting state and cannot respond exceeds the preset threshold;
deleting the third recording node of the process whose dependency on the peripheral failed.
9. A peripheral power consumption management device, characterized in that it comprises a memory, a processor and a computer program stored on said memory and executable on said processor, said computer program, when executed by said processor, implementing the steps of the peripheral power consumption management method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that a peripheral power consumption management program is stored thereon, which when executed by a processor implements the steps of the peripheral power consumption management method according to any one of claims 1 to 8.
CN202210973866.5A 2022-08-15 2022-08-15 Peripheral power consumption control method and device and computer readable storage medium Pending CN115291711A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210973866.5A CN115291711A (en) 2022-08-15 2022-08-15 Peripheral power consumption control method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210973866.5A CN115291711A (en) 2022-08-15 2022-08-15 Peripheral power consumption control method and device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115291711A true CN115291711A (en) 2022-11-04

Family

ID=83830279

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210973866.5A Pending CN115291711A (en) 2022-08-15 2022-08-15 Peripheral power consumption control method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115291711A (en)

Similar Documents

Publication Publication Date Title
CN107368518B (en) Notification message management method, terminal and computer readable storage medium
CN107402694B (en) Application switching method, device and computer-readable storage medium
CN110062105B (en) Interface display method and terminal equipment
CN110196667B (en) Notification message processing method and terminal
JP2021523510A (en) Background application display method and mobile terminal
CN109471690B (en) Message display method and terminal equipment
CN108874280B (en) Screen division method, terminal and computer readable storage medium
CN108073458B (en) Memory recovery method, mobile terminal and computer-readable storage medium
CN108984066B (en) Application icon display method and mobile terminal
CN110569119B (en) Background application program management method and terminal
CN107765941B (en) Icon display method, terminal and computer readable storage medium
WO2021164716A1 (en) Display method and electronic device
CN109189576B (en) Redis-based request processing method, server and computer-readable storage medium
CN108920040B (en) Application icon sorting method and mobile terminal
CN108536349B (en) Icon management method and mobile terminal
CN110752981A (en) Information control method and electronic equipment
CN111475066B (en) Background switching method of application program and electronic equipment
CN109992192B (en) Interface display method and terminal equipment
CN108089935B (en) Application program management method and mobile terminal
CN108170360B (en) Control method of gesture function and mobile terminal
CN109947617B (en) Method, terminal and readable storage medium for monitoring display content of application interface
CN109947323B (en) Terminal display method and terminal
CN109521916B (en) File processing method based on flexible screen, mobile terminal and storage medium
CN109508300B (en) Disk fragment sorting method and device and computer readable storage medium
CN111638843A (en) Information processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination