Linux system power consumption optimization positioning method, device and storage medium
By calculating the dynamic power consumption of each subsystem of the laptop, subdividing it into system units and generating evaluation sequences, the problem of power consumption optimization positioning in domestic hardware systems is solved, and accurate positioning and power consumption optimization are achieved without hardware support.
Patent Information
- Application Number
- CN202411929864.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-26
AI Technical Summary
It is difficult for the prior art to optimize power consumption positioning on laptops with domestic hardware systems.
By calculating the dynamic power consumption of each subsystem under different system states, the fine-number system is a system unit, generates an evaluation sequence, iteratively updates the membership matrix, determines the cluster to which the system unit belongs, and determines the power consumption level and optimization direction based on the cluster.
The power-optimized system components can be accurately positioned without complex algorithms, suitable for the lack of hardware support.
Smart Images

Figure CN119376519B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system power consumption, and in particular to a Linux system power consumption optimization positioning method, device and storage medium. Background Art
[0002] With the rise of mobile office and the requirements of energy conservation and emission reduction, the power consumption requirements or battery life requirements for various computer devices are becoming more and more important. Therefore, power consumption optimization is very important. Power consumption optimization can significantly improve the performance of laptops. By properly adjusting the power consumption of the CPU and GPU, you can ensure that they run in the best state, thereby improving overall performance. Power consumption optimization can also help optimize the heat dissipation of laptops. When running at high power consumption, the CPU and GPU will generate a lot of heat. If the heat dissipation is not good, it will cause the temperature to be too high, which will affect performance and even damage the hardware. By setting the power consumption reasonably, you can optimize the heat dissipation while ensuring performance, and avoid performance degradation caused by excessive temperature. Power consumption optimization can also extend battery life. By reducing power consumption, you can reduce battery consumption while ensuring performance, thereby extending the usage time.
[0003] The prerequisite for optimizing the power consumption of laptop computers is to locate the components that can be optimized. In the prior art, you can use the power consumption measurement interface inside the device and supported by the operating system, such as the RAPL of the Intel CPU to measure the power consumption of the CPU, or the built-in power management and test chips to test the power consumption of each peripheral and send the data through a certain protocol; or directly set the test points in the hardware, and use professional instruments to test the current and voltage and calculate the power consumption. However, the former is only suitable for Intel CPUs, and is not applicable to current domestic CPUs. The latter requires hardware support from hardware manufacturers, but the existing hardware does not meet this condition. Summary of the invention
[0004] The embodiment of the present invention provides a Linux system power consumption optimization positioning method, device and storage medium to solve the technical problem in the prior art that power consumption optimization positioning cannot be performed on a notebook computer with a domestic hardware system.
[0005] In a first aspect, an embodiment of the present invention provides a Linux system power consumption optimization positioning method, comprising:
[0006] The dynamic power consumption of each subsystem is calculated by the difference in energy-saving status of each subsystem under different system states;
[0007] Each subsystem is subdivided into various system units, and an evaluation sequence of each system unit is generated according to the dynamic power consumption of the subsystem to which each system unit belongs and the power consumption influencing factor of each system unit;
[0008] Set the size of the membership matrix;
[0009] Iteratively updating the membership matrix based on the evaluation sequence of each system unit until the membership matrix no longer changes significantly or a preset number of iterations is reached;
[0010] Determining the cluster to which each system unit belongs according to the updated membership matrix;
[0011] The power consumption level is determined according to the cluster to which it belongs, and the power consumption optimization direction is determined according to the power consumption level and the power consumption influencing factors.
[0012] In a second aspect, an embodiment of the present invention further provides a Linux system power consumption optimization positioning device, comprising:
[0013] A calculation module, used to calculate the dynamic power consumption of each subsystem according to the difference in energy-saving state of each subsystem under different system states;
[0014] A subdivision module is used to subdivide each subsystem into various system units, and generate an evaluation sequence of each system unit according to the dynamic power consumption of the subsystem to which each system unit belongs and the power consumption influencing factor of each system unit;
[0015] A setting module, used to set the size of the membership matrix;
[0016] An updating module, configured to iteratively update the membership matrix based on the evaluation sequence of each system unit until the membership matrix no longer changes significantly or a preset number of iterations is reached;
[0017] A cluster determination module, used to determine the cluster to which each system unit belongs according to the updated membership matrix;
[0018] The optimization direction determination module is used to determine the power consumption level according to the cluster to which it belongs, and to determine the power consumption optimization direction according to the power consumption level and the power consumption influencing factor.
[0019] In a third aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the Linux system power consumption optimization positioning method provided in the above embodiment.
[0020] The Linux system power consumption optimization positioning method, device and storage medium provided by the embodiment of the present invention calculate the dynamic power consumption of each subsystem through the energy-saving state difference of each subsystem under different system states; subdivide each subsystem into each system unit, and generate the evaluation sequence of each system unit according to the dynamic power consumption of the subsystem to which each system unit belongs and the power consumption influencing factor of each system unit; set the size of the membership matrix; iteratively update the membership matrix based on the evaluation sequence of each system unit until the membership matrix no longer changes significantly or reaches a preset number of iterations; determine the cluster to which each system unit belongs according to the updated membership matrix; determine the power consumption level according to the cluster to which it belongs, and determine the power consumption optimization direction according to the power consumption level and the power consumption influencing factor. It can be realized without complex algorithms, and can accurately locate the components whose power consumption can be optimized in the absence of hardware support. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0022] Figure 1 It is a flowchart of a Linux system power consumption optimization positioning method provided by Embodiment 1 of the present invention;
[0023] Figure 2 It is a schematic diagram of the subsystem division structure in the Linux system power consumption optimization and positioning method provided in the first embodiment of the present invention;
[0024] Figure 3 It is a flowchart of a Linux system power consumption optimization positioning method provided by Embodiment 2 of the present invention;
[0025] Figure 4 It is a structural diagram of a Linux system power consumption optimization positioning device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0026] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0027] Embodiment 1
[0028] Figure 1: is a flow chart of a Linux system power consumption optimization positioning method provided by Embodiment 1 of the present invention. This embodiment is applicable to the case of optimizing power consumption positioning of a laptop computer, especially a laptop computer installed with a Linux system. The method can be executed by a Linux system power consumption optimization positioning device, and specifically comprises the following steps:
[0029] Step 110, calculating the dynamic power consumption of each subsystem according to the difference in energy-saving states of each subsystem under different system states.
[0030] In the prior art, since the physical quantities of each unit are different, it is not convenient to perform an overall evaluation; secondly, it is impossible to measure the power consumption of each unit alone, and only the power consumption of the corresponding large subsystem can be measured. For example, the power consumption of the entire CPU, the entire peripheral, etc. It is not convenient to perform power consumption evaluation. In this embodiment, since there is no power consumption measurement interface or hardware test point, a method using a similar replacement method is adopted to adjust the system to various pre-set states, and calculate the system power consumption of each subsystem based on the overall system power consumption.
[0031] In this embodiment, the subsystem may be a component constituting a laptop computer. For example, a screen subsystem, an input / output subsystem, and a storage system. In particular, for components that have a large impact on power consumption, the subsystem division should meet the following rules: each subsystem can adjust power consumption by adjusting the energy-saving state, and the sum of the power consumption of all subsystems is equal to the power consumption of the laptop computer.
[0032] Exemplarily, it may include: directly changing or indirectly changing the system state formed by the energy-saving strategy of each subsystem; using battery information or a power meter to test the total power consumption under different system states; setting different system states, calculating the dynamic power consumption of each subsystem according to the difference in energy-saving state of each subsystem under different system states, and calculating the static power consumption of the entire system; the subsystems include: a CPU subsystem and a peripheral subsystem.
[0033] Figure 2 This is a schematic diagram of the subsystem division structure in the Linux system power consumption optimization positioning method provided in the first embodiment of the present invention, see Figure 2 , dividing the entire system into three subsystems: CPU, peripherals and screen.
[0034] Furthermore, when only one subsystem has an energy-saving state difference between the two system states, and the one subsystem is in a shut down or idle state, the dynamic power consumption of the one subsystem can be determined according to the dynamic power consumption difference between the two system states, and the one subsystem can be set to a known state; when there are energy-saving state differences between multiple subsystems in the two system states, and the dynamic power consumption of only one subsystem is in an unknown state, the dynamic power consumption of the subsystem in the unknown state is determined according to the difference between the two system states and other known states.
[0035] For example, running a certain process set, service or application, standby state, character interface state, external display and turning off the laptop screen are selected as each system state, among which running a certain process set, service or application state is the target evaluation and analysis state, and the other system states are slightly set on this basis; the total power consumption in each system state is calculated using battery power change information, total battery capacity and test time: Pexe, Ps2Idle, Ptext, Pext_monitor. According to the difference in energy-saving state of each subsystem under different system states, the dynamic power consumption of each subsystem can be calculated as:
[0036] The static power consumption of the whole system is:
[0037] .
[0038] If you are evaluating and analyzing a device without a battery, you only need to use a power meter to test the total power consumption of different system states. Just set it to 0.
[0039] Step 120: subdivide each subsystem into system units, and generate an evaluation sequence for each system unit according to the dynamic power consumption of the subsystem to which each system unit belongs and the power consumption influencing factor of each system unit.
[0040] Optionally, the subsystem is composed of several system units, and the system unit is a unit that affects power consumption. The system unit can be software or hardware. Exemplarily, it can be subdivided in the following way: the CPU subsystem is subdivided according to each software unit, and the system unit includes: each process, timer and / or interrupt; the peripheral subsystem is subdivided into each device and each controller.
[0041] Taking the CPU subsystem as an example, the system unit may include: process, interrupt and / or timer, etc. Among them, a single or multiple different types of collections can be used as a system unit. In the case where there may be multiple processes, multiple timers, or a specific process or timer, multiple processes or timers can be combined together or separated into a system unit, or a specific process and timer can be formed into a system unit.
[0042] Furthermore, the evaluation sequence of each system unit can be generated based on the dynamic power consumption of the subsystem to which each system unit belongs and the power consumption influencing factor of each system unit, and specifically optimized as follows: the power consumption influencing factor is determined based on the operating time of the system unit and the characteristic data; when the subsystem is a CPU-type subsystem, the characteristic data includes: the number of context switches of the system unit; when the subsystem is a peripheral subsystem, the characteristic data includes: the maximum power consumption of the device under the current energy-saving configuration of the system unit as the characteristic data; based on the dynamic power consumption of the subsystem to which each system unit belongs, the operating time of the system unit and the corresponding characteristic data, the evaluation items of each system unit are generated; and the evaluation sequence is generated using a combination of the evaluation items of each system unit.
[0043] Exemplarily, for the system unit of the CPU subsystem to which it belongs, the total CPU time Xi occupied by processes, interrupts and\or timers in the system unit, and the total number of switching times Yi are obtained, and the power consumption impact factor can be determined corresponding to the system unit running time and characteristic data respectively. Then, for the data processing of the equipment and full-load power consumption of the equipment in the system unit of the device subsystem to which it belongs: the submodule of the peripheral subsystem, the energy-saving state of the equipment, if the equipment is in the full working state D0, the value is 1; if the equipment is in the energy-saving state Dx, it is converted into an interval value of 0~1 according to the theoretical or empirical value of the current energy-saving state of the equipment. Then multiply it by the full-load power consumption of the equipment as the characteristic data, which is equivalent to taking the highest power consumption of the equipment under the current energy-saving configuration of the system unit as the characteristic data. Then normalize the same type of data. For the same type of quantifiable data, normalization can be performed. For example, the CPU time occupied and the number of context switching times of the submodule of the CPU subsystem are normalized respectively. For the submodule of the peripheral subsystem, the proportion of equipment usage time is converted into 0~1, and the product data of the equipment energy-saving state and the full-load power consumption data can also be normalized. The subsystem power consumption P can also be normalized.
[0044] Exemplarily, there are N system units that need to be evaluated, and an evaluation sequence X=[x1,x2...xi...xn] is generated, where xi=(F1,F2,P), xi represents the data of the i-th system unit, F1 and F2 represent the operating time and characteristic data of the corresponding subsystem units, and P represents the dynamic power consumption of the subsystem to which it belongs.
[0045] Step 130, setting the size of the membership matrix.
[0046] In this embodiment, the membership matrix is used to classify each system unit according to the power consumption level. Exemplarily, multiple optimization levels can be set according to the optimization requirements, each level corresponds to a cluster, and the number of columns of the membership matrix is set according to the number of levels.
[0047] Exemplarily, the number of columns of the membership matrix may be determined according to the number of classification clusters for power consumption optimization purposes; and the number of rows of the membership matrix may be determined according to the number of system units.
[0048] Determine the number of clusters C, for example, 2 means that these subsystems are divided into two categories, and establish the membership matrix U:
[0049]
[0050] where u ij Indicates the membership of the i-th element to the j-th cluster.
[0051] Step 140, iteratively updating the membership matrix based on the evaluation sequence of each system unit until the membership matrix no longer changes significantly or reaches a preset number of iterations.
[0052] The membership matrix is iteratively optimized using the values in the evaluation sequence as factors until the membership matrix no longer changes significantly. When it no longer changes significantly, it can be determined that the cluster to which each system unit belongs is clear. In this case, there is no need to continue iterative updating. Or if the expected effect is not achieved within the preset number of times due to insufficient data or errors, there is no need to continue iterative updating.
[0053] Step 150: Determine the cluster to which each system unit belongs according to the updated membership matrix.
[0054] Through the above steps, an iteratively updated membership matrix is obtained, and each element in the membership matrix is obtained to obtain the corresponding cluster, thereby determining the power consumption level of each system unit.
[0055] Step 160: determine the power consumption level according to the cluster to which it belongs, and determine the power consumption optimization direction according to the power consumption level and the subsystem to which it belongs.
[0056] Exemplarily, it may include: when there is a power consumption influencing factor and the operating time of the system unit is greater than a preset second time threshold and belongs to a high power consumption category, determining that there is a power consumption optimization direction for the usage frequency and logic of the system unit; for a system unit of a CPU subsystem, when there is a power consumption influencing factor data less than a preset first threshold and belongs to a high power consumption category, determining that there is a power consumption optimization direction for the subsystem CPU energy-saving software / hardware configuration; when there is a power consumption influencing factor data greater than a preset second threshold and belongs to a high power consumption category, determining that there is an optimization direction for the software corresponding to the system unit.
[0057] This embodiment calculates the dynamic power consumption of each subsystem through the energy-saving state difference of each subsystem under different system states; subdivides each subsystem into each system unit, generates an evaluation sequence of each system unit according to the dynamic power consumption of the subsystem to which each system unit belongs and the power consumption influencing factor of each system unit; sets the size of the membership matrix; iteratively updates the membership matrix based on the evaluation sequence of each system unit until the membership matrix no longer changes significantly or reaches a preset number of iterations; determines the cluster to which each system unit belongs according to the updated membership matrix; determines the power consumption level according to the cluster to which it belongs, and determines the power consumption optimization direction according to the power consumption level and the power consumption influencing factor. It can be realized without complex algorithms, and can accurately locate system components whose power consumption can be optimized in the absence of hardware support.
[0058] Embodiment 2
[0059] Figure 3 It is a flow chart of the Linux system power consumption optimization positioning method provided by the second embodiment of the present invention. This embodiment is optimized based on the above embodiment, and the membership matrix is iteratively updated based on the evaluation sequence of each system unit until the membership matrix no longer changes significantly or reaches a preset number of iterations. The specific optimization is: performing original random assignment on the membership matrix, and calculating the center of each classification cluster in the membership matrix after the original assignment; using the evaluation sequence of each system unit to update the membership of each element in the membership matrix for each classification cluster; recalculating the center of each classification cluster in the membership matrix, and updating the membership of each element in the membership matrix for each classification cluster; judging whether the membership matrix has significant changes or whether it has reached a preset number of iterations, and when there is no significant change or the preset number of iterations has not been reached, returning to the step of recalculating the center of each classification cluster in the membership matrix and updating the membership moment.
[0060] See also Figure 3 , the Linux system power consumption optimization positioning method comprises:
[0061] Step 210 , calculating the dynamic power consumption of each subsystem according to the difference in energy-saving states of each subsystem under different system states.
[0062] Step 220: subdivide each subsystem into system units, and generate an evaluation sequence for each system unit according to the dynamic power consumption of the subsystem to which each system unit belongs and the power consumption influencing factor of each system unit.
[0063] Step 230, setting the size of the membership matrix.
[0064] Step 240, performing original random assignment on the membership matrix, and calculating the center of each classification cluster in the membership matrix after the original assignment.
[0065] In this embodiment, the elements in the membership matrix are originally randomly assigned, and the center of each classification cluster in the membership matrix is calculated.
[0066] Exemplarily, optionally, the center of each classification cluster in the membership matrix can be calculated as follows:
[0067]
[0068] v j is the center of the classification cluster, m is the weighting coefficient, u ij is the element in the i-th row and j-th column of the membership matrix, and N is the number of data in the evaluation sequence of each system unit.
[0069] Step 250, using the evaluation sequence of each system unit, updates the membership of each element in the membership matrix to each classification cluster; recalculates the center of each classification cluster in the membership matrix, and updates the membership of each element in the membership matrix to each classification cluster.
[0070] Exemplarily, the membership of each element in the membership matrix for each classification cluster may be updated in the following manner:
[0071] Among them, C sets the number of classification clusters, x i is the ith data in the evaluation sequence of each system unit.
[0072] Then, the recalculated results are used to recalculate the centers of each cluster of the membership matrix, and the membership of each element in the membership matrix for each classification cluster is updated.
[0073] Step 260, determine whether there is a significant change in the membership matrix or whether the preset number of iterations has been reached. If there is no significant change or the preset number of iterations has not been reached, return to the step of calculating the center of each classification cluster in the membership matrix and updating the membership of each element in the membership matrix for each classification cluster.
[0074] After the above iterative calculation, it is determined whether the membership matrix has significant changes. If there is no significant change, it can be said that the classification result has been determined and no further iterative calculation is required. In addition, if there is still a significant change after a preset number of iterative calculations, it can be said that the data is small or other factors affect it and an accurate result cannot be obtained. Iterative calculation can also be stopped. If the above conditions are not met, return to the iterative calculation step.
[0075] Step 270: Determine the cluster to which each system unit belongs based on the updated membership matrix.
[0076] Step 280: determine the power consumption level according to the cluster to which it belongs, and determine the power consumption optimization direction according to the power consumption level and the power consumption influencing factor.
[0077] This embodiment iteratively updates the membership matrix based on the evaluation sequence of each system unit until the membership matrix no longer changes significantly or reaches a preset number of iterations. The specific optimization is: perform original random assignment on the membership matrix, calculate the center of each classification cluster in the membership matrix after the original assignment; use the evaluation sequence of each system unit to update the membership of each element in the membership matrix for each classification cluster; calculate the center of each classification cluster in the membership matrix again, and update the membership of each element in the membership matrix for each classification cluster; determine whether the membership matrix has significant changes or whether it has reached a preset number of iterations. If there is no significant change or the preset number of iterations has not been reached, return to the step of recalculating the center of each classification cluster in the membership matrix and updating the membership moment. It can accurately calculate the affiliation relationship of each system unit to the power consumption cluster, providing an accurate reference for the subsequent optimization direction.
[0078] Embodiment 3
[0079] Figure 4 is a schematic diagram of the structure of the Linux system power consumption optimization positioning device provided by the third embodiment of the present invention, see Figure 4 , the Linux system power consumption optimization positioning device comprises:
[0080] A calculation module 310, configured to calculate the dynamic power consumption of each subsystem according to the energy-saving state difference of each subsystem under different system states;
[0081] A subdivision module 320, configured to subdivide each subsystem into individual system units, and generate an evaluation sequence for each system unit according to the dynamic power consumption of the subsystem to which each system unit belongs and a power consumption influencing factor of each system unit;
[0082] A setting module 330, used to set the size of the membership matrix;
[0083] An updating module 340, configured to iteratively update the membership matrix based on the evaluation sequence of each system unit until the membership matrix no longer changes significantly or a preset number of iterations is reached;
[0084] A cluster determination module 350, configured to determine the cluster to which each system unit belongs according to the updated membership matrix;
[0085] The optimization direction determination module 360 is used to determine the power consumption level according to the cluster to which it belongs, and determine the power consumption optimization direction according to the power consumption level and the power consumption influencing factor.
[0086] The Linux system power consumption optimization and positioning device provided in this embodiment calculates the dynamic power consumption of each subsystem through the energy-saving state difference of each subsystem under different system states; subdivides each subsystem into each system unit, and generates an evaluation sequence of each system unit according to the dynamic power consumption of the subsystem to which each system unit belongs and the power consumption influencing factor of each system unit; sets the size of the membership matrix; iteratively updates the membership matrix based on the evaluation sequence of each system unit until the membership matrix no longer changes significantly or reaches a preset number of iterations; determines the cluster to which each system unit belongs according to the updated membership matrix; determines the power consumption level according to the cluster to which it belongs, and determines the power consumption optimization direction according to the power consumption level and the power consumption influencing factor. It can be realized without complex algorithms, and can accurately locate components whose power consumption can be optimized in the absence of hardware support.
[0087] Based on the above embodiments, the calculation module includes:
[0088] A change unit, used to directly or indirectly change the system state formed by the energy-saving strategy of each subsystem;
[0089] A test unit for testing total power consumption under different system states using battery information or a power meter;
[0090] The calculation unit is used to set different system states, calculate the dynamic power consumption of each subsystem according to the energy-saving state difference of each subsystem under different system states, and calculate the static power consumption of the entire system; the subsystems include: a CPU subsystem and a peripheral subsystem.
[0091] Based on the above embodiments, the subdivision module includes:
[0092] The first subdivision unit is used to subdivide the CPU subsystem according to each software unit, the system unit includes: each process, timer and / or interrupt;
[0093] The second subdivision unit is used to subdivide the peripheral subsystem into each device and each controller.
[0094] Based on the above embodiments, the subdivision module further includes:
[0095] A determination unit, configured to determine a power consumption influencing factor according to the operating time of the system unit and characteristic data, wherein when the subsystem is a CPU subsystem, the characteristic data includes: the number of context switches of the system unit; when the subsystem is a peripheral subsystem, the characteristic data includes: the maximum power consumption of the device under the current energy-saving configuration of the system unit as characteristic data;
[0096] An evaluation item generating unit, used to generate evaluation items for each system unit based on the dynamic power consumption of the subsystem to which each system unit belongs, the operating time of the system unit and the corresponding characteristic data;
[0097] The evaluation sequence generating unit is used to generate an evaluation sequence by combining the evaluation items of each system unit.
[0098] Based on the above embodiments, the setting module includes:
[0099] A column number determination unit, used to determine the number of columns of the membership matrix according to the number of classification clusters for power consumption optimization;
[0100] The row number determination unit is used to determine the number of rows of the membership matrix according to the number of the system units.
[0101] Based on the above embodiments, the update module includes:
[0102] An assignment unit, used for performing an original random assignment on the membership matrix, and calculating the center of each classification cluster in the membership matrix after the original assignment;
[0103] An updating unit, used to update the membership of each element in the membership matrix for each classification cluster using the evaluation sequence of each system unit; calculate the center of each classification cluster in the membership matrix again, and update the membership of each element in the membership matrix for each classification cluster;
[0104] The return unit is used to determine whether there is a significant change in the membership matrix or whether a preset number of iterations has been reached. When there is no significant change or the preset number of iterations has not been reached, return to the step of calculating the center of each classification cluster in the membership matrix and updating the membership of each element in the membership matrix for each classification cluster.
[0105] Based on the above embodiments, the calculation unit is used for:
[0106] When only one subsystem has a difference in energy-saving state between the two system states and the one subsystem is in a closed or idle state, determining the dynamic power consumption of the one subsystem according to the dynamic power consumption difference between the two system states, and setting the one subsystem to a known state;
[0107] According to the fact that multiple subsystems have energy-saving state differences in two system states, and the dynamic power consumption of only one subsystem is unknown, the dynamic power consumption of the subsystem in the unknown state is determined according to the difference between the two system states and other known states.
[0108] Based on the above embodiments, the calculation unit is used for:
[0109] When only one subsystem has a difference in energy-saving state between the two system states and the one subsystem is in a closed or idle state, determining the dynamic power consumption of the one subsystem according to the dynamic power consumption difference between the two system states, and setting the one subsystem to a known state;
[0110] According to the fact that multiple subsystems have energy-saving state differences in two system states, and the dynamic power consumption of only one subsystem is unknown, the dynamic power consumption of the subsystem in the unknown state is determined according to the difference between the two system states and other known states.
[0111] Based on the above embodiments, the optimization direction determination module includes:
[0112] A first power consumption optimization direction determining unit, for a system unit of a peripheral subsystem, when the operating time of the system unit in the power consumption influencing factor is less than a preset first time threshold and the system unit belongs to a high power consumption category, determines that a software / hardware configuration corresponding to the system unit has a power consumption optimization direction;
[0113] A second power consumption optimization direction determining unit, configured to determine that the use frequency and logic of the system unit have a power consumption optimization direction when the operating time of the system unit in the power consumption influencing factor is greater than a preset second time threshold and belongs to a high power consumption category;
[0114] A third power consumption optimization direction determining unit, for a system unit of a CPU subsystem, determines that there is a power consumption optimization direction for the CPU energy-saving software / hardware configuration of the subsystem when there is power consumption impact factor data that is less than a preset first threshold value and belongs to a high power consumption category;
[0115] The fourth power consumption optimization direction determining unit is used to determine whether there is an optimization direction on the software corresponding to the system unit when there is power consumption impact factor data greater than a preset second threshold and belongs to a high power consumption category.
[0116] The Linux system power consumption optimization and positioning device provided in the embodiment of the present invention can execute the Linux system power consumption optimization and positioning method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0117] Embodiment 4
[0118] Embodiment 4 of the present invention further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the Linux system power consumption optimization positioning method as described in any one of the above embodiments.
[0119] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device.
[0120] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0121] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0122] Computer program code for performing the operation of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0123] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A Linux system power consumption optimization positioning method, characterized in that: include: Divide the entire system into CPU, peripherals and screen subsystems; Directly or indirectly changing the system state formed by the energy-saving strategies of each subsystem, including: selecting and running a process set, service or application, standby state, character interface state, external display and turning off the notebook screen as each system state, wherein the state of running a process set, service or application is the target evaluation and analysis state; Use battery information or a power meter to test the total power consumption in different system states, including: using battery power change information, total battery capacity, and test time to calculate the total power consumption in each system state: Ps2idle, Ptext, Pext_monitor; When only one subsystem has a difference in energy-saving state between two system states and the one subsystem is in a shutdown or idle state, determining the dynamic power consumption of the one subsystem according to the dynamic power consumption difference between the two system states, and setting the one subsystem to a known state, includes: ; According to the fact that there are differences in energy-saving states of multiple subsystems in two system states, and the dynamic power consumption of only one subsystem is in an unknown state, the dynamic power consumption of the subsystem in the unknown state is determined according to the difference between the two system states and other known states. ; And calculate the static power consumption of the entire system: ; Each subsystem is subdivided into various system units, and an evaluation sequence of each system unit is generated according to the dynamic power consumption of the subsystem to which each system unit belongs and the power consumption influencing factor of each system unit; Set the size of the membership matrix; Iteratively updating the membership matrix based on the evaluation sequence of each system unit until the membership matrix no longer changes significantly or a preset number of iterations is reached; Determining the cluster to which each system unit belongs according to the updated membership matrix; Determine the power consumption level according to the cluster to which it belongs, and determine the power consumption optimization direction according to the power consumption level and power consumption influencing factors; The setting of the size of the membership matrix includes: Determine the number of columns of the membership matrix according to the number of classification clusters for power consumption optimization purpose; The number of rows of the membership matrix is determined according to the number of the system units.
2. The method according to claim 1, characterized in that: Each subsystem is subdivided into various system units, including: Subdivide the CPU-like subsystem into individual software units, system units, including: each process, timer and / or interrupt; Break down the peripheral subsystem into per-device and per-controller.
3. The method according to claim 2, characterized in that The step of generating an evaluation sequence for each system unit according to the dynamic power consumption of the subsystem to which each system unit belongs and the power consumption influencing factor of each system unit includes: Determine the power consumption influencing factor according to the operating time of the system unit and the characteristic data, when the subsystem is a CPU subsystem, the characteristic data includes: the number of context switches of the system unit, when the subsystem is a peripheral subsystem, the characteristic data includes: the maximum power consumption of the device under the current energy-saving configuration of the system unit as the characteristic data; Generate evaluation items for each system unit based on the dynamic power consumption of the subsystem to which each system unit belongs, the operating time of the system unit and the corresponding characteristic data; An evaluation sequence is generated using the combination of evaluation items of each system unit.
4. The method according to claim 1, characterized in that: The iterative updating of the membership matrix based on the evaluation sequence of each system unit until the membership matrix no longer changes significantly or reaches a preset number of iterations includes: Performing original random assignment on the membership matrix, and calculating the center of each classification cluster in the membership matrix after the original assignment; Using the evaluation sequence of each system unit, the membership of each element in the membership matrix for each classification cluster is updated; the center of each classification cluster in the membership matrix is calculated again, and the membership of each element in the membership matrix for each classification cluster is updated; Determine whether there is a significant change in the membership matrix or whether a preset number of iterations has been reached. If there is no significant change or the preset number of iterations has not been reached, return to the step of calculating the center of each classification cluster in the membership matrix and updating the membership of each element in the membership matrix for each classification cluster.
5. The method according to claim 1, characterized in that The determining of the power consumption level according to the cluster to which it belongs, and determining the power consumption optimization direction according to the power consumption level and the power consumption influencing factor, includes: For a system unit of a peripheral subsystem, when the operating time of the system unit in the power consumption influencing factor is less than a preset first time threshold and the system unit belongs to a high power consumption category, it is determined that the software / hardware configuration corresponding to the system unit has a power consumption optimization direction; When the operating time of the system unit in the power consumption influencing factor is greater than a preset second time threshold and belongs to a high power consumption category, determining that the use frequency and logic of the system unit have a power consumption optimization direction; For a system unit of a CPU subsystem, when there is power consumption impact factor data that is less than a preset first threshold value and belongs to a high power consumption category, it is determined that there is a power consumption optimization direction for the CPU energy-saving software / hardware configuration of the subsystem; When there is power consumption impact factor data that is greater than a preset second threshold and belongs to a high power consumption category, it is determined that there is an optimization direction for the software corresponding to the system unit.
6. A Linux system power consumption optimization positioning device, characterized in that: include: Partition module, used to divide the entire system into CPU, peripherals and screen subsystems; The system state change module is used to directly or indirectly change the system state formed by the energy-saving strategies of each subsystem, including: selecting and running a process set, service or application, standby state, character interface state, external display and turning off the notebook screen as each system state, wherein the state of running a process set, service or application is the target evaluation and analysis state; A calculation module is used to test the total power consumption under different system states using battery information or a power meter, including: using battery power change information, total battery capacity and test time to calculate the total power consumption under each system state: Ps2idle, Ptext, Pext_monitor; The first dynamic power consumption calculation module is used to determine the dynamic power consumption of the one subsystem according to the dynamic power consumption difference between the two system states when only one subsystem has a difference in energy-saving state between the two system states and the one subsystem is in a closed or idle state, and set the one subsystem to a known state, including: ; The second dynamic power consumption and static power consumption calculation module is used to determine the dynamic power consumption of the subsystem in the unknown state according to the difference between the two system states and other known states, based on the fact that there are differences in energy-saving states of multiple subsystems in the two system states, and the dynamic power consumption of only one subsystem is in an unknown state. ; And calculate the static power consumption of the entire system: ; A subdivision module is used to subdivide each subsystem into various system units, and generate an evaluation sequence of each system unit according to the dynamic power consumption of the subsystem to which each system unit belongs and the power consumption influencing factor of each system unit; A setting module, used to set the size of the membership matrix; An updating module, configured to iteratively update the membership matrix based on the evaluation sequence of each system unit until the membership matrix no longer changes significantly or a preset number of iterations is reached; A cluster determination module, used to determine the cluster to which each system unit belongs according to the updated membership matrix; An optimization direction determination module, used to determine the power consumption level according to the cluster to which it belongs, and determine the power consumption optimization direction according to the power consumption level and the power consumption influencing factor; The setting module includes: A column number determination unit, used to determine the number of columns of the membership matrix according to the number of classification clusters for power consumption optimization; The row number determination unit is used to determine the number of rows of the membership matrix according to the number of the system units.
7. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the Linux system power consumption optimization positioning method as described in any one of claims 1-5 when executed by a computer processor.
Citation Information
Patent Citations
Background application cleansing method and device, storage medium and electronic device
CN107643925A
Power monitoring apparatus
KR101324038B1
Electronic device and method of reducing power thereof
US20170235356A1