Method and apparatus for obtaining power consumption information of network device, and electronic device

CN116974844BActive Publication Date: 2026-10-27DATANG MOBILE COMM EQUIP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210431358.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-22
Publication Date
2026-10-27
Estimated Expiration
2042-04-22

AI Technical Summary

Technical Problem

[0003]相关技术中,只能粗粒度地获取基站中的CPU在一段时间内的整体功耗,无法获取CPU内核级、任务级和函数级的细粒度功耗信息

Benefits of technology

[0029]本公开能够获取网络设备的CPU内核级功耗信息、任务级功耗信息和函数级功耗信息,从而细粒度地掌握网络设备的功耗情况。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116974844B_ABST
    Figure CN116974844B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method and device for obtaining power consumption information of a network device and an electronic device. The method comprises: collecting CPU basic power of a processor CPU in the network device; in response to an operating system OS of the network device being in an idle non-sleep mode, collecting first total power of the CPU and task running time of each system task; for each system task, obtaining task power consumption information of the system task based on the first total power, the CPU basic power and the task running time of the system task; for each system function, obtaining function power consumption information of the system function based on the task power consumption information of a first system task that calls the system function; and for each core of the CPU, obtaining core power consumption information of the core based on a second system task processed by the core. The present disclosure can obtain CPU core-level power consumption information, task-level power consumption information and function-level power consumption information of the network device, thereby finely grasping the power consumption of the network device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, and electronic device for obtaining power consumption information of a network device. Background Technology

[0002] Since the power consumption of base stations directly affects the operating costs of telecommunications operators, power reduction is crucial for base stations. Generally, power reduction is achieved by modifying hardware and controlling peripheral devices. When these power reduction methods are exhausted, it is necessary to optimize the operating power consumption of the base station's central processing unit (CPU). To optimize the CPU's operating power consumption, it is necessary to obtain fine-grained power consumption information of the CPU.

[0003] In related technologies, only the overall power consumption of the CPU in the base station over a period of time can be obtained in a coarse-grained manner, and fine-grained power consumption information at the CPU kernel level, task level, and function level cannot be obtained. Summary of the Invention

[0004] This disclosure provides a device, electronic device, and storage medium for acquiring power consumption information of a network device.

[0005] According to one aspect of this disclosure, a method for obtaining power consumption information of a network device is provided, comprising:

[0006] Collect the CPU base power of the processor CPU in the network device. The CPU base power is the power when all cores of the CPU are executing idle system tasks.

[0007] In response to the network device's operating system (OS) being in an idle, non-sleep mode, the first total power of the CPU and the task runtime of each system task are collected.

[0008] For each system task, the task power consumption information of the system task is obtained based on the first total power, the CPU base power, and the task runtime of the system task;

[0009] For each system function, based on the task power consumption information of the first system task that calls the system function, the function power consumption information of the system function is obtained;

[0010] For each core of the CPU, the core power consumption information of the core is obtained based on the second system task processed by the core.

[0011] According to another aspect of this disclosure, a power consumption information acquisition device for a network device is provided, comprising: a memory, a transceiver, and a processor.

[0012] A memory for storing computer programs; a transceiver for sending and receiving data under the control of the processor; and a processor for reading the computer programs from the memory and performing the following operations:

[0013] Collect the CPU base power of the processor CPU in the network device. The CPU base power is the power when all cores of the CPU are executing idle system tasks.

[0014] In response to the network device's operating system (OS) being in an idle, non-sleep mode, the first total power of the CPU and the task runtime of each system task are collected.

[0015] For each system task, the task power consumption information of the system task is obtained based on the first total power, the CPU base power, and the task runtime of the system task;

[0016] For each system function, based on the task power consumption information of the first system task that calls the system function, the function power consumption information of the system function is obtained;

[0017] For each core of the CPU, the core power consumption information of the core is obtained based on the second system task processed by the core.

[0018] According to another aspect of this disclosure, a power consumption information acquisition device for a network device is provided, comprising:

[0019] The first acquisition unit is used to acquire the CPU base power of the processor CPU in the network device. The CPU base power is the power when all cores of the CPU are executing idle system tasks.

[0020] The second acquisition unit is used to acquire the first total power of the CPU and the task runtime of each system task in response to the network device's operating system (OS) being in an idle non-sleep mode.

[0021] The task power consumption information acquisition unit is used to acquire the task power consumption information of each system task based on the first total power, the CPU base power and the task runtime of the system task.

[0022] The function power consumption information acquisition unit is used to acquire the function power consumption information of each system function based on the task power consumption information of the first system task that calls the system function.

[0023] The kernel power consumption information acquisition unit is used to acquire kernel power consumption information for each kernel of the CPU based on the second system task processed by the kernel.

[0024] According to another aspect of this disclosure, an electronic device is provided, comprising:

[0025] At least one processor; and

[0026] A memory that is communicatively connected to at least one processor; wherein,

[0027] The memory stores instructions that can be executed by at least one processor, which enables the at least one processor to perform a power consumption information acquisition method for a network device according to a first aspect of this disclosure.

[0028] According to another aspect of this disclosure, a processor-readable storage medium is provided, the processor-readable storage medium storing a computer program for causing the processor to execute a power consumption information acquisition method of a network device according to a first aspect embodiment of this disclosure.

[0029] This disclosure enables the acquisition of CPU kernel-level power consumption information, task-level power consumption information, and function-level power consumption information of network devices, thereby providing a fine-grained understanding of the power consumption of network devices.

[0030] Additional aspects and advantages of this disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this disclosure. Attached Figure Description

[0031] The above and / or additional aspects and advantages of this disclosure will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, in which:

[0032] Figure 1 This is a flowchart illustrating a method for obtaining power consumption information of a network device according to an embodiment of the present disclosure.

[0033] Figure 2 This is a schematic diagram illustrating the principle of obtaining the task runtime of a system task provided in an embodiment of this disclosure.

[0034] Figure 3 A block diagram illustrating the first total power of the CPU provided in an embodiment of this disclosure;

[0035] Figure 4 A block diagram illustrating the actual power of a system task provided in an embodiment of this disclosure;

[0036] Figure 5 This is a flowchart illustrating another method for obtaining power consumption information of a network device provided in an embodiment of this disclosure;

[0037] Figure 6 This is a flowchart illustrating another method for obtaining power consumption information of a network device provided in an embodiment of this disclosure;

[0038] Figure 7 This is a flowchart illustrating another method for obtaining power consumption information of a network device provided in an embodiment of this disclosure;

[0039] Figure 8 This is a flowchart illustrating another method for obtaining power consumption information of a network device provided in an embodiment of this disclosure;

[0040] Figure 9 This is a flowchart illustrating another method for obtaining power consumption information of a network device provided in an embodiment of this disclosure;

[0041] Figure 10 This is a flowchart illustrating another method for obtaining power consumption information of a network device provided in an embodiment of this disclosure;

[0042] Figure 11 This is a flowchart illustrating another method for obtaining power consumption information of a network device provided in an embodiment of this disclosure;

[0043] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;

[0044] Figure 13 This is a schematic diagram of the structure of a power consumption information acquisition device for a network device provided according to an embodiment of the present disclosure. Detailed Implementation

[0045] In this embodiment of the invention, the term "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the preceding and following associated objects have an "or" relationship.

[0046] In this disclosure, the term "multiple" refers to two or more, and other quantifiers are similar.

[0047] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this disclosure.

[0048] Figure 1 This is a schematic diagram illustrating a process for obtaining power consumption information of a network device according to an embodiment of this disclosure, as shown below. Figure 1 As shown, the method includes the following steps:

[0049] S101 collects the CPU base power of the processor CPU in the network device. The CPU base power is the power when all the CPU cores are executing idle system tasks.

[0050] It should be noted that the execution subject of the power consumption information acquisition method of the network device in this embodiment is the power consumption information acquisition method device of the network device. The device can be implemented by software and / or hardware. The device can be configured in an electronic device, which may include, but is not limited to, a terminal, a server, etc.

[0051] The network device in this disclosure can be an evolved NodeB (eNB), a transmission reception point (TRP), a next-generation NodeB (gNB) in an NR system, a base station in other future mobile communication systems, or an access node in a wireless fidelity (WiFi) system. This disclosure does not limit the specific technology or device form used in the network device. The network device provided in this disclosure can be composed of a central unit (CU) and a distributed unit (DU). The CU can also be called a control unit. Using a CU-DU structure allows the protocol layer of a network device, such as a base station, to be separated. Some protocol layer functions are centrally controlled by the CU, while the remaining partial or complete protocol layer functions are distributed in the DU, which is centrally controlled by the CU.

[0052] The network device may include multiple CPUs, and the CPU may include multiple cores.

[0053] After starting the network device, stop all non-idle system tasks in the network device's operating system (OS). After stopping all non-idle system tasks, obtain the power of all CPU cores executing idle system tasks, and use it as the CPU's base power.

[0054] In some implementations, the CPU has a power consumption statistics function, which can count its own power through internal registers. Therefore, the CPU's power can be obtained by reading the power consumption data counted by the CPU's internal registers. For example, for x86 chips, the power of the x86 chip can be obtained by reading the power consumption data counted by the x86 chip's Model Specific Register (MSR).

[0055] S102, in response to the network device's operating system (OS) being in idle-non-sleep mode, collects the first total CPU power and the task runtime of each system task.

[0056] When the operating system (OS) of a network device is in idle and non-sleep mode, it can intermittently send and receive signals. The power consumption information acquisition method of the network device provided in this disclosure is executed when the OS of the network device is in idle and non-sleep mode.

[0057] In some implementations, see Figure 2 One approach is to use interrupt sampling, which involves sampling the system task execution information of each CPU core at different times using non-maskable interrupts (NMI) or clock interrupts, and then obtaining the runtime of each system task in the corresponding core based on the system task execution information.

[0058] In some implementations, a code-based tracking method can be used. Hook functions are inserted into the system task scheduling code to count the start and end times of each system task in the corresponding kernel, thus obtaining the runtime of each system task in the kernel.

[0059] S103, for each system task, obtains the task power consumption information of the system task based on the first total power, the CPU base power and the task runtime of the system task.

[0060] The system task power consumption information includes the actual power of the system task, which comprises the base power and the optimized power. It should be noted that the actual power of the system task can be used to characterize the actual power consumption of the system task.

[0061] See Figure 3 The CPU's total power comprises CPU base power and CPU optimized power. CPU base power includes the base power of multiple cores, and CPU optimized power includes the optimized power of multiple cores. Each core's base power includes the base power of multiple system tasks, and each core's optimized power includes the optimized power of multiple tasks. Specifically, the base power of the cores is allocated from the CPU base power according to a certain ratio, and the base power of each system task is allocated from the corresponding base power of the cores according to a certain ratio.

[0062] For each system task, the CPU optimized power is obtained based on the first total power and the CPU base power. Based on the runtime of the system task, the ratio of the system task's optimized power to the CPU optimized power is determined. Based on the ratio of the system task's optimized power to the CPU optimized power, the optimized power of the system task is calculated. Based on the CPU base power, the base power of each system task is obtained. Finally, the actual power of the system task is obtained based on the system task's base power and the system task's optimized power.

[0063] S104: For each system function, obtain the function power consumption information of the system function based on the task power consumption information of the first system task that calls the system function.

[0064] The power consumption information includes the actual power of the system function. It should be noted that the actual power of the function can be used to characterize the actual power consumption of the system function.

[0065] See Figure 4 The actual power of a system task includes the base power and the optimized power of the system task. The base power of each system task includes the base power of multiple system functions, and the optimized power of each system task includes the optimized power of multiple functions. The base power of each system function is obtained by allocating the base power of the corresponding first system task according to a certain ratio.

[0066] For each system function, the actual power ratio of the system function in the corresponding first system task can be obtained, and the actual power of the system function can be obtained based on the actual power ratio and the actual power of the corresponding first system task.

[0067] For example, the system functions called by system task n_1 include: system function n_1_1, system function n_1_2, ..., n_1_n. For system function n_1_1, the runtime ratio of system function n_1_1 in system task n_1 can be obtained. The runtime ratio of system function n_1_1 is multiplied by the actual power of system task n_1 to obtain the actual power of system function n_1_1.

[0068] S105 obtains the core power consumption information for each CPU core based on the secondary system tasks processed by the core.

[0069] The kernel power consumption information includes the actual power consumption of the kernel. It should be noted that the actual power consumption of the kernel can be used to characterize the actual power consumption of the kernel.

[0070] The kernel's base power and optimized power can be obtained based on the base power and optimized power of the second system task processed by the kernel, and the actual power of the kernel can be obtained based on the base power and optimized power of the kernel, or the actual power of the kernel can be obtained directly based on the actual power of the second system task processed by the kernel.

[0071] It should be noted that, since optimizing CPU power consumption actually involves reducing CPU core power, system task power, and / or system function power, the theoretically reduceable power in this disclosure is referred to as optimized power. Because the actual power of the CPU core, system tasks, and system functions includes a proportionally allocated base power, the actual power in this disclosure can be referred to as proportionally consumed energy (PCE). Since the optimized power of the core, system tasks, and system functions does not include the base power, the optimized power in this disclosure can be referred to as uniquely consumed energy (UCE).

[0072] In this embodiment, the CPU base power of the processor CPU within the network device is collected. The CPU base power is the power consumed when all CPU cores are executing idle system tasks. Responding to the network device's operating system (OS) being in an idle-non-sleep mode, the first total CPU power and the task runtime of each system task are collected. For each system task, based on the first total power, CPU base power, and task runtime, task power consumption information is obtained. For each system function, based on the task power consumption information of the first system task calling the system function, function power consumption information is obtained. For each CPU core, based on the task power consumption information of the second system task processed by the core, kernel power consumption information is obtained. This embodiment can obtain CPU kernel-level power consumption information, task-level power consumption information, and function-level power consumption information of the network device, thereby providing a fine-grained understanding of the network device's power consumption.

[0073] Figure 5 This is a flowchart illustrating a method for obtaining power consumption information of a network device according to an embodiment of the present disclosure. Based on the above embodiment, it further incorporates... Figure 5 The process of obtaining task power consumption information for system tasks is explained, including the following steps:

[0074] S501, obtain the target optimized power of the system task. The target optimized power is the power reduction caused by the system task stopping operation.

[0075] The OS of a network device includes different types of system tasks. The CPU of the network device generates different power consumption when executing different types of system tasks, and the number of different types of system tasks also varies. Due to the different characteristics of different types of system tasks, it is necessary to determine the type of system task and obtain the target optimized power of the system task based on the task type.

[0076] S502 determines the task power consumption information of system tasks based on the target optimized power, CPU base power, and task runtime.

[0077] Based on the number of CPU cores and the CPU's base power, the average base power of each CPU core is calculated as the core base power of each core. Based on the task runtime, the proportion of the third runtime of the system task in the corresponding core is determined. Then, based on the core base power, the proportion of the third runtime, and the target optimized power, the task power consumption information of the system task is obtained.

[0078] Since each CPU core operates in parallel at the same level, the average base power of each core can be used as the core base power. The average base power of each core within the CPU can be calculated using the formula: Average base power = CPU base power / Number of CPU cores.

[0079] The specific process for obtaining the actual power of the system task in the task power consumption information is as follows:

[0080] 1. According to the formula: the percentage of the third runtime of a system task = the runtime of the system task / the total runtime of all system tasks in the corresponding kernel, calculate the percentage of the third runtime of the system task in the corresponding kernel.

[0081] 2. Calculate the actual power of the system task according to the formula: Actual power of system task = Kernel base power * System task's third runtime percentage + System task's target optimized power. Wherein, the base power of the system task = Kernel base power * System task's runtime percentage, meaning the base power of the system task is obtained by allocating the kernel base power according to the system task's runtime percentage.

[0082] In this embodiment of the disclosure, the target optimized power of the system task is obtained. The target optimized power is the power reduction that occurs when the system task stops running. Based on the target optimized power, the CPU base power, and the task runtime, the task power consumption information of the system task is determined. By obtaining the actual power of the system task, this embodiment of the disclosure can obtain the task-level power consumption information of the network device, thereby understanding the task-level power consumption flow of the network device.

[0083] Figure 6This is a flowchart illustrating a method for obtaining power consumption information of a network device according to an embodiment of the present disclosure. Based on the above embodiment, it further incorporates... Figure 6 The process of obtaining the target optimized power of the system task is explained, including the following steps:

[0084] S601, determine the task type of the system task.

[0085] The task types include Category I system tasks and Category II system tasks. Category I system tasks are ordinary system tasks, and Category II system tasks are special system tasks.

[0086] The power consumption of a network device's CPU varies depending on the type of system task it performs. Special system tasks include high-level instructions, which require the CPU to process and consume more power. Ordinary system tasks do not include high-level instructions, and therefore require less computation and consume less power. Typically, there are more ordinary system tasks and fewer special system tasks in a system.

[0087] It can determine whether a system task includes advanced instructions. If a system task does not include advanced instructions, it is classified as a first-class system task; if it does include advanced instructions, it is classified as a second-class system task.

[0088] S602 obtains the total runtime of all cores in the CPU and the CPU's optimized power, where optimized power is the power reduction caused by all system tasks processed by the CPU stopping.

[0089] Get the CPU runtime and the number of CPU cores, then multiply the CPU runtime by the number of cores to get the total runtime of all cores in the CPU.

[0090] Obtain the difference between the first total power and the CPU base power, and determine the difference as the CPU optimized power, that is, CPU optimized power = first total power - CPU base power.

[0091] S603 determines the target optimized power based on task type, total runtime, task runtime, and CPU optimized power.

[0092] Optionally, in response to the system task being a first type of system task, a first runtime percentage of the system task is determined based on the task runtime and the total runtime, and a first optimized power of the system task is determined based on the first runtime percentage and the CPU optimized power, which is used as the target optimized power.

[0093] The specific process for obtaining the first optimized power of the system task is as follows:

[0094] 1. Calculate the percentage of first runtime for the system task using the formula: First Runtime Percentage = System Task Runtime / Total Runtime of All Cores within the CPU. Here, the first runtime percentage represents the proportion of CPU optimized power allocated to that system task.

[0095] 2. Calculate the first optimized power of the system task according to the formula: First optimized power = CPU optimized power * First runtime percentage * 100.

[0096] Optionally, in response to the system task being a second type of system task, the second total power of the CPU when the system task stops running is obtained, and the second optimized power of the system task is determined based on the first total power and the second total power. Then, based on the first optimized power, the second optimized power and the first runtime ratio, the power weight of the system task is determined, and based on the power weight and the task runtime, the second runtime ratio of the system task is determined. Finally, based on the second runtime ratio and the CPU optimized power, the third optimized power of the system task is obtained as the target optimized power.

[0097] The specific process for obtaining the third optimized power is as follows:

[0098] 1. Calculate the second optimized power of the system task according to the formula: Second Optimized Power = First Total Power - Second Total Power.

[0099] 2. Calculate the power weight of the second type of system task according to the formula: Power weight of system task = (Second optimized power / (Percentage of first runtime of system task * 100)) / First optimized power.

[0100] 3. According to the formula: the percentage of the second runtime of system tasks = the runtime of system tasks * power weight / the sum of the runtime of all system tasks multiplied by their respective power weights, calculate the percentage of the second runtime of the second type of system tasks.

[0101] It should be noted that the power weight of the first type of system task is 1.

[0102] 4. Calculate the third optimized power of the second type of system task according to the formula: Third Optimized Power = CPU Optimized Power * Second Runtime Percentage of System Task.

[0103] In this embodiment, the first optimized power of a first type of system task (ordinary system task) is used as a baseline optimized power, and the value of the baseline optimized power is used as an indicator to measure the magnitude of the second optimized power of a second type of system task (special system task). Therefore, based on the first optimized power of the first type of system task, the second optimized power of the second type of system task is processed to obtain the third optimized power of the second type of system task. The third optimized power is closer to the power reduction that occurs when the second type of system task stops running; therefore, the third optimized power is used as the target optimized power.

[0104] In this embodiment of the disclosure, the task type of the system task is determined, the total runtime of all cores within the CPU and the CPU's optimized power are obtained, and a target optimized power is determined based on the task type, total runtime, task runtime, and CPU optimized power. This embodiment of the disclosure can distinguish the task type of the system task and can obtain the optimized power of different types of system tasks in different ways to ensure data reliability.

[0105] Figure 7 This is a flowchart illustrating a method for obtaining power consumption information of a network device according to an embodiment of the present disclosure. Based on the above embodiment, it further incorporates... Figure 7 The process of obtaining the power consumption information of the system function is explained, including the following steps:

[0106] S701, retrieves the runtime of a system function.

[0107] The method for obtaining the runtime of system functions is the same as that for obtaining the runtime of system tasks. For details of the process, please refer to the description of the process for obtaining the runtime of tasks in step S102. It will not be repeated here.

[0108] S702, based on the function runtime and the task runtime of the first system task, determine the proportion of the fourth runtime of the system function in the first system task.

[0109] S703 obtains the function power consumption information of the system function based on the task power consumption information of the first system task and the fourth runtime percentage.

[0110] Since the actual power of the first system task includes the actual power of multiple system functions, for each system function, the running proportion in the corresponding first system task can be determined based on its runtime in the corresponding first system task, and the actual power can be determined according to the running proportion. The specific process is as follows:

[0111] 1. According to the formula: Fourth runtime percentage = Function runtime / Task runtime of the first system task, calculate the percentage of the fourth runtime of the system function in the corresponding first system task.

[0112] The percentage of the fourth runtime can be used as the actual power ratio of the system function in the corresponding first system task to calculate the actual power of the system function.

[0113] 2. Calculate the actual power of the system function in the power consumption information according to the formula: Actual power of system function = Percentage of fourth running time * Actual power of system task.

[0114] In this embodiment of the disclosure, the function runtime of the system function is obtained. Based on the function runtime and the task runtime of the first system task, the proportion of the fourth runtime of the system function in the first system task is determined. Based on the task power consumption information of the first system task and the proportion of the fourth runtime, the function power consumption information of the system function is obtained. This embodiment of the disclosure can obtain the function-level power consumption information of the network device by obtaining the actual power of the system function, so as to understand the function power consumption flow of the network device.

[0115] Figure 8 This is a flowchart illustrating a method for obtaining power consumption information of a network device according to an embodiment of the present disclosure. Based on the above embodiment, further combining... Figure 8 The process of obtaining the optimized power of the function is explained, including the following steps:

[0116] S801, retrieves the runtime of a system function.

[0117] For details on the specific implementation of step S801, please refer to the relevant descriptions in the various embodiments of this disclosure, which will not be repeated here.

[0118] S802, based on the function runtime and the task runtime of the first system task, determine the proportion of the fourth runtime of the system function in the first system task.

[0119] For details on the specific implementation of step S802, please refer to the relevant descriptions in the various embodiments of this disclosure, which will not be repeated here.

[0120] S803, based on the fourth runtime percentage and the target optimization power of the first system task, determines the function optimization power of the system function, which is the power reduction when the system function stops running.

[0121] The percentage of the fourth runtime can be used as the proportion of the system function's optimized power in the corresponding first system task to calculate the system function's optimized power. Specifically, the optimized power of the system function can be calculated using the formula: Optimized Power = Percentage of Fourth Runtime * Target Optimized Power of the First System Task.

[0122] In this embodiment, the function runtime of the system function is obtained. Based on the function runtime and the task runtime of the first system task, the proportion of the system function's fourth runtime in the first system task is determined. Based on the proportion of the fourth runtime and the target optimization power of the first system task, the function optimization power of the system function is determined. The function optimization power is the power reduction achieved when the system function stops running. The function optimization power obtained in this embodiment can indicate the function-level power consumption flow of the network device, providing a reference for function-level power consumption optimization of the network device.

[0123] Figure 9 This is a flowchart illustrating a method for obtaining power consumption information of a network device according to an embodiment of the present disclosure. Based on the above embodiment, further combining... Figure 9 The process of obtaining kernel power consumption information is explained, including the following steps:

[0124] S901 determines the kernel optimization power based on the target optimization power of the second system task. The kernel optimization power is the power reduction caused by all system tasks of the kernel stopping running.

[0125] S902 obtains the kernel's base power and, based on the base power and optimized power, obtains the kernel's power consumption information.

[0126] For each kernel, the target optimized power of all the secondary system tasks processed by the kernel can be added together to obtain the kernel optimized power. The kernel optimized power is then added to the kernel base power to obtain the actual power of the kernel, i.e., the kernel power consumption information.

[0127] For example, the system tasks processed by kernel n include: system task n_1, system task n_2, ..., system task n_n. For kernel n, the sum of the basic power and the sum of the optimized power of system task n_1, system task n_2, ..., system task n_n can be calculated to obtain the kernel basic power and kernel optimized power of kernel n. The kernel basic power and kernel optimized power of kernel n are then added together to obtain the actual power of kernel n.

[0128] In this embodiment of the disclosure, the kernel's optimized power is determined based on the target optimized power of the second system task. The kernel optimized power is the power reduction due to all system tasks of the kernel ceasing operation. The kernel's base power is obtained, and based on the base power and the optimized power, the kernel's power consumption information is obtained. By obtaining the kernel's base power, optimized power, and actual power, this embodiment of the disclosure can obtain the CPU kernel-level power consumption information of the network device, thereby understanding the CPU kernel-level power consumption flow of the network device.

[0129] Figure 10This is a flowchart illustrating a method for obtaining power consumption information of a network device according to an embodiment of the present disclosure. Based on the above embodiment, further combining... Figure 10 The following steps explain another method for obtaining kernel power consumption information:

[0130] S1001 collects the base CPU power of the processor CPU within the network device.

[0131] For details on the specific implementation of step S1001, please refer to the relevant descriptions in the various embodiments of this disclosure, which will not be repeated here.

[0132] S1002, in response to the network device's operating system (OS) being in idle / non-sleep mode, collects the first total CPU power and the task runtime of each system task.

[0133] For details on the specific implementation of step S1002, please refer to the relevant descriptions in the various embodiments of this disclosure, which will not be repeated here.

[0134] S1003, for each system task, obtains the task power consumption information of the system task based on the first total power, the CPU base power and the task runtime of the system task.

[0135] For details on the specific implementation of step S1003, please refer to the relevant descriptions in the embodiments of this disclosure, which will not be repeated here.

[0136] S1004 obtains kernel power consumption information based on the task power consumption information of the second system task processed by the kernel.

[0137] Since the actual power of the kernel includes the actual power of multiple secondary system tasks, the sum of the actual power of the task power consumption information of all secondary system tasks processed by the kernel can be used as the actual power of the kernel, and the actual power of the kernel can be used as the kernel power consumption information of the kernel.

[0138] For example, the system tasks processed by kernel n include: system task n_1, system task n_2, ..., system task n_n. For kernel n, the actual power of kernel n can be obtained by adding the actual power of system task n_1, system task n_2, ..., system task n_n.

[0139] In this embodiment, the base CPU power of the processor (CPU) within the network device is collected. Responding to the network device's operating system (OS) being in an idle / non-sleep mode, the first total CPU power and the runtime of each system task are collected. For each system task, based on the first total power, the base CPU power, and the system task's runtime, task power consumption information is obtained. Based on the task power consumption information of a second system task processed by the kernel, kernel power consumption information is obtained. This embodiment directly obtains the actual kernel power consumption based on the actual power consumption of the system tasks, improving the efficiency of kernel power consumption information acquisition.

[0140] Figure 11 This is a flowchart illustrating a method for obtaining power consumption information of a network device according to an embodiment of the present disclosure. Based on the above embodiment, further combining... Figure 11 The process of displaying power consumption information for network devices is explained, including the following steps:

[0141] S1101 displays task power consumption information, function power consumption information, and kernel power consumption information.

[0142] It should be noted that task power consumption information includes not only the actual power of the system task, but also the base power and optimized power of the system task; function power consumption information includes not only the actual power of the system function, but also the base power and optimized power of the system function; kernel power consumption information includes not only the actual power of the kernel, but also the base power and optimized power of the kernel.

[0143] The acquired task power consumption information, function power consumption information, and kernel power consumption information can be displayed on the screen of the terminal device, allowing developers to intuitively see the power consumption of the network device at the kernel, task, and function levels under current service operation. Terminal devices include, but are not limited to, computers and mobile phones.

[0144] S1102, during the display of power consumption information of network devices, identifies whether there is any power consumption abnormality in the network devices.

[0145] During the display of power consumption information of network devices, it is possible to determine whether the network device has power consumption anomalies by identifying whether there are any abnormal information in the power consumption information. If there are abnormal information in the power consumption information, then the network device has power consumption anomalies; if there are no abnormal information in the power consumption information, then the network device does not have power consumption anomalies.

[0146] In some implementations, if the actual power of the system task in the task power consumption information is greater than the first power threshold, then the actual power of the system task is abnormal, and the network device has abnormal power consumption.

[0147] In some implementations, if the actual power of the system function in the power consumption information is greater than the second power threshold, then the actual power of the system function is abnormal, and the network device has abnormal power consumption.

[0148] In some implementations, if the actual power of the kernel in the kernel power consumption information is greater than the third power threshold, then the actual power of the kernel is abnormal, and the network device has abnormal power consumption.

[0149] It should be noted that the first power threshold, the second power threshold, and the third power threshold can be set according to the actual situation, and no restrictions are imposed here.

[0150] As a possible approach, it is also possible to determine whether a network device has abnormal power consumption by identifying whether there are anomalies in the base power of system tasks, the optimized power of system tasks, the base power of system functions, the optimized power of system functions, the base power of the kernel, and the optimized power of the kernel.

[0151] S1103, in response to abnormal power consumption of network devices, marks the abnormal power consumption information as abnormal information for display and / or generates corresponding warning information to provide abnormal reminders.

[0152] When abnormal power consumption is detected in a network device, the abnormal power consumption information can be marked as abnormal and displayed, and / or a corresponding warning message can be generated to remind the user of the abnormality. For example, the abnormal power consumption information can be highlighted in red or displayed, and / or a warning message such as "Network device has abnormal power consumption" can be generated to remind the user of the abnormality.

[0153] In this embodiment, task power consumption information, function power consumption information, and kernel power consumption information are displayed. During the display of network device power consumption information, it is determined whether the network device has any power consumption anomalies. In response to the presence of power consumption anomalies, the abnormal power consumption information is marked as abnormal information and displayed, and / or corresponding warning information is generated for anomaly alert. This embodiment can identify whether a network device has any power consumption anomalies and can provide an alert when such anomalies occur.

[0154] Figure 12 This is a schematic diagram of the structure of a power consumption information acquisition device for a network device provided in an embodiment of this disclosure, as shown below. Figure 12 As shown, the power consumption information acquisition device 1200 for network devices includes: a memory 1201, a transceiver 1202, and a processor 1203.

[0155] Memory 1201 is used to store computer programs; transceiver 1202 is used to send and receive data under the control of processor 1203; processor 1203 is used to read the computer program in memory 1201 and perform the following operations:

[0156] Collect the CPU base power of the processor CPU in the network device. The CPU base power is the power when all the CPU cores are executing idle system tasks.

[0157] In response to the network device's operating system (OS) being in idle, non-sleep mode, the first total CPU power and the task runtime of each system task are collected.

[0158] For each system task, the task power consumption information of the system task is obtained based on the first total power, the CPU base power, and the task runtime of the system task;

[0159] For each system function, the function power consumption information of the system function is obtained based on the task power consumption information of the first system task that calls the system function;

[0160] For each CPU core, obtain the core power consumption information based on the secondary system tasks processed by the core.

[0161] Optionally, the processor 1203 is also configured to read the computer program in the memory 1201 and perform the following operations:

[0162] Obtain the target optimized power of the system task, which is the power reduction achieved when the system task stops running;

[0163] Based on the target optimized power, CPU base power, and task runtime, obtain the task power consumption information of the system tasks.

[0164] Optionally, the processor 1203 is also configured to read the computer program in the memory 1201 and perform the following operations:

[0165] Determine the task type of the system task;

[0166] Get the total runtime of all cores in the CPU and the CPU's optimized power, where optimized power is the power reduction caused by all system tasks being stopped during CPU operation;

[0167] The target optimization power is determined based on task type, total runtime, task runtime, and CPU optimization power.

[0168] Optionally, the processor 1203 is also configured to read the computer program in the memory 1201 and perform the following operations:

[0169] Responding to system tasks is classified as a first-class system task;

[0170] Based on the task runtime and total runtime, determine the percentage of the system task's runtime.

[0171] Based on the percentage of the first runtime and the CPU optimized power, the first optimized power of the system task is determined as the target optimized power.

[0172] Optionally, the processor 1203 is also configured to read the computer program in the memory 1201 and perform the following operations:

[0173] In response to the system task being a second type of system task, the second total power of the CPU when the system task stops running is obtained, and the second optimized power of the system task is obtained based on the first total power and the second total power;

[0174] The power weights of system tasks are determined based on the first optimized power, the second optimized power, and the proportion of the first runtime.

[0175] The proportion of the second runtime of system tasks is determined based on power weight and task runtime.

[0176] Based on the second runtime percentage and CPU optimized power, the third optimized power of the system task is obtained and used as the target optimized power.

[0177] Optionally, the processor 1203 is also configured to read the computer program in the memory 1201 and perform the following operations:

[0178] Obtain the difference between the initial total power and the CPU base power, and determine the difference as the CPU optimized power.

[0179] Optionally, the processor 1203 is also configured to read the computer program in the memory 1201 and perform the following operations:

[0180] Based on the number of CPU cores and the CPU's base power, calculate the average base power of each CPU core, which is then used as the core base power for each core.

[0181] Based on the task runtime, determine the proportion of the third runtime of the system task in the corresponding kernel;

[0182] Based on the kernel base power, the third runtime percentage, and the target optimized power, the system task power consumption information is obtained.

[0183] Optionally, the processor 1203 is also configured to read the computer program in the memory 1201 and perform the following operations:

[0184] Get the runtime of a system function;

[0185] Based on the function runtime and the task runtime of the first system task, determine the proportion of the fourth runtime of the system function in the first system task;

[0186] Based on the task power consumption information of the first system task and the percentage of the fourth runtime, the function power consumption information of the system function is obtained.

[0187] Optionally, the processor 1203 is also configured to read the computer program in the memory 1201 and perform the following operations:

[0188] Based on the fourth runtime percentage and the target optimization power of the first system task, the function optimization power of the system function is determined. The function optimization power is the power reduction when the system function stops running.

[0189] Optionally, the processor 1203 is also configured to read the computer program in the memory 1201 and perform the following operations:

[0190] Based on the target optimization power of the second system task, the kernel optimization power of the kernel is determined. The kernel optimization power is the power reduction caused by all system tasks of the kernel stopping running.

[0191] Obtain the kernel's base power, and based on the base power and optimized power, obtain the kernel's power consumption information; or

[0192] Based on the task power consumption information of the second system task processed by the kernel, obtain the kernel power consumption information.

[0193] Optionally, the processor 1203 is also configured to read the computer program in the memory 1201 and perform the following operations:

[0194] Display task power consumption information, function power consumption information, and kernel power consumption information;

[0195] During the display of power consumption information of network devices, identify whether there are any power consumption anomalies in the network devices;

[0196] In response to abnormal power consumption in network devices, the abnormal power consumption information is marked as abnormal information and displayed, and / or corresponding warning information is generated to provide an abnormal reminder.

[0197] This disclosure enables the acquisition of CPU kernel-level power consumption information, task-level power consumption information, and function-level power consumption information of network devices, thereby providing a fine-grained understanding of the power consumption of network devices.

[0198] It should be noted that the apparatus provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.

[0199] Among them, Figure 12In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 1203 and memory represented by memory 1201 together. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 1202 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium, including wireless channels, wired channels, optical fibers, etc. For different user equipment, the user interface 1204 can also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.

[0200] The processor 1203 is responsible for managing the bus architecture and general processing, while the memory 1201 can store the data used by the processor 1203 when performing operations.

[0201] Optionally, the processor 1203 can be a CPU (Central Processing Unit), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array), or CPLD (Complex Programmable Logic Device), and the processor can also adopt a multi-core architecture.

[0202] The processor 1203 executes any of the methods provided in the embodiments of this disclosure by calling a computer program stored in the memory 1201, according to the obtained executable instructions. The processor and the memory may also be physically separated.

[0203] Figure 13 This is a schematic diagram of a power consumption information acquisition device for a network device provided in an embodiment of this disclosure. Figure 13 As shown, the power consumption information acquisition device for the network device includes: a first acquisition unit 1310 and a second acquisition unit 1320, a task power consumption information acquisition unit 1330, a function power consumption information acquisition unit 1340 and a kernel power consumption information acquisition unit 1350.

[0204] The first acquisition unit 1310 is used to acquire the CPU base power of the CPU in the network device. The CPU base power is the power when all the CPU cores are executing idle system tasks.

[0205] The second acquisition unit 1320 is used to acquire the first total power of the CPU and the task runtime of each system task in response to the network device's operating system (OS) being in an idle non-sleep mode.

[0206] The task power consumption information acquisition unit 1330 is used to acquire the task power consumption information of each system task based on the first total power, the CPU base power and the task runtime of the system task.

[0207] The function power consumption information acquisition unit 1340 is used to acquire the function power consumption information of each system function based on the task power consumption information of the first system task that calls the system function.

[0208] The kernel power consumption information acquisition unit 1350 is used to acquire kernel power consumption information for each core of the CPU based on the second system task processed by the core.

[0209] Furthermore, in one possible implementation of this embodiment, the task power consumption information acquisition unit 1330 is further configured to: acquire the target optimized power of the system task, wherein the target optimized power is the power reduction when the system task stops running; and acquire the task power consumption information of the system task based on the target optimized power, the CPU base power, and the task runtime.

[0210] Furthermore, in one possible implementation of this disclosure embodiment, the task power consumption information acquisition unit 1330 is also used to: determine the task type of the system task; acquire the total runtime of all cores in the CPU and the CPU optimized power of the CPU, wherein the CPU optimized power is the power reduction caused by all system tasks processed by the CPU stopping running; and determine the target optimized power based on the task type, total runtime, task runtime and CPU optimized power.

[0211] Furthermore, in one possible implementation of this disclosure embodiment, the task power consumption information acquisition unit 1330 is further configured to: respond to the system task being a first type of system task; determine the first runtime percentage of the system task based on the task runtime and the total runtime; and determine the first optimized power of the system task based on the first runtime percentage and the CPU optimized power, as the target optimized power.

[0212] Furthermore, in one possible implementation of this disclosure embodiment, the task power consumption information acquisition unit 1330 is further configured to: in response to the system task being a second type of system task, acquire the second total power of the CPU when the system task stops running, and acquire the second optimized power of the system task based on the first total power and the second total power; determine the power weight of the system task based on the first optimized power, the second optimized power and the first running time ratio; determine the second running time ratio of the system task based on the power weight and the task running time; and obtain the third optimized power of the system task based on the second running time ratio and the CPU optimized power, as the target optimized power.

[0213] Furthermore, in one possible implementation of this embodiment, the task power consumption information acquisition unit 1330 is further configured to: acquire the difference between the first total power and the CPU base power, and determine the difference as the CPU optimized power.

[0214] Furthermore, in one possible implementation of this disclosure embodiment, the task power consumption information acquisition unit 1330 is further configured to: calculate the average base power of each CPU core based on the number of CPU cores and the CPU base power, and use it as the core base power of each core; determine the third runtime percentage of the system task in the corresponding core based on the task runtime; and acquire the task power consumption information of the system task based on the core base power, the third runtime percentage, and the target optimized power.

[0215] Furthermore, in one possible implementation of this disclosure embodiment, the function power consumption information acquisition unit 1340 is further configured to: acquire the function runtime of the system function; determine the fourth runtime percentage of the system function in the first system task based on the function runtime and the task runtime of the first system task; and acquire the function power consumption information of the system function based on the task power consumption information of the first system task and the fourth runtime percentage.

[0216] Furthermore, in one possible implementation of this disclosure, the power consumption information acquisition device for the network device further includes a function optimization power acquisition unit 1360, which is used to: determine the function optimization power of the system function based on the fourth runtime percentage and the target optimization power of the first system task, wherein the function optimization power is the power reduced when the system function stops running.

[0217] Furthermore, in one possible implementation of this disclosure embodiment, the kernel power consumption information acquisition unit 1350 is further configured to: determine the kernel optimized power of the kernel based on the target optimized power of the second system task, wherein the kernel optimized power is the power reduction caused by all system tasks of the kernel stopping operation; acquire the kernel base power of the kernel, and acquire the kernel power consumption information of the kernel based on the kernel base power and the kernel optimized power; or acquire the kernel power consumption information of the kernel based on the task power consumption information of the second system task processed by the kernel.

[0218] Furthermore, in one possible implementation of this embodiment, the power consumption information acquisition device for the network device further includes a display unit 1370, which is used to: display task power consumption information, function power consumption information and kernel power consumption information; identify whether there is a power consumption abnormality in the network device during the display of the power consumption information of the network device; and, in response to the presence of a power consumption abnormality in the network device, mark the abnormal power consumption information as abnormal information for display and / or generate corresponding warning information for abnormal reminder.

[0219] This disclosure enables the acquisition of CPU kernel-level power consumption information, task-level power consumption information, and function-level power consumption information of network devices, thereby providing a fine-grained understanding of the power consumption of network devices.

[0220] It should be noted that the apparatus provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.

[0221] It should be noted that the division of units in the embodiments of this disclosure is illustrative and only represents one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units.

[0222] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0223] This disclosure provides an electronic device, characterized in that it includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the methods provided in the above embodiments.

[0224] This disclosure provides a processor-readable storage medium, characterized in that the processor-readable storage medium stores a computer program for causing the processor to execute the methods provided in the above embodiments.

[0225] Processor-readable storage media can be any available medium or data storage device that the processor can access, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs)).

[0226] The technical solutions provided in this disclosure are applicable to a variety of systems, especially 5G systems. For example, applicable systems may include Global System for Mobile Communication (GSM), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA) General Packet Radio Service (GPRS), Long Term Evolution (LTE), LTE Frequency Division Duplex (FDD), LTE Time Division Duplex (TDD), Long Term Evolution Advanced (LTE-A), Universal Mobile Telecommunication System (UMTS), Worldwide Interoperability for Microwave Access (WiMAX), and 5G New Radio (NR). All of these systems include terminal equipment and network equipment. The systems may also include a core network component, such as Evolved Packet System (EPS) and 5G system (5GS).

[0227] The terminal devices involved in the embodiments of this disclosure can be devices that provide voice and / or data connectivity to users, handheld devices with wireless connectivity, or other processing devices connected to a wireless modem. The names of the terminal devices may differ in different systems; for example, in a 5G system, a terminal device can be called User Equipment (UE). Wireless terminal devices can communicate with one or more core networks (CNs) via a Radio Access Network (RAN). Wireless terminal devices can be mobile terminal devices, such as mobile phones (or "cellular" phones) and computers with mobile terminal devices, for example, portable, pocket-sized, handheld, computer-embedded, or vehicle-mounted mobile devices that exchange voice and / or data with the RAN. Examples include Personal Communication Service (PCS) phones, cordless phones, Session Initiated Protocol (SIP) phones, Wireless Local Loop (WLL) stations, and Personal Digital Assistants (PDAs). Wireless terminal equipment can also be referred to as a system, subscriber unit, subscriber station, mobile station, mobile station, remote station, access point, remote terminal, access terminal, user terminal, user agent, or user device, but is not limited to these terms in the embodiments disclosed herein.

[0228] The network device disclosed in this embodiment may be a base station, which may include multiple cells providing services to terminals. Depending on the specific application, the base station may also be called an access point, or a device in the access network that communicates with the wireless terminal device through one or more sectors on the air interface, or other names. The network device may be used to exchange received air frames with Internet Protocol (IP) packets, acting as a router between the wireless terminal device and the rest of the access network, where the rest of the access network may include an Internet Protocol (IP) communication network. The network device may also coordinate the attribute management of the air interface. For example, the network equipment involved in this disclosure can be a base transceiver station (BTS) in a Global System for Mobile communications (GSM) or Code Division Multiple Access (CDMA) system, a NodeB in a Wide-band Code Division Multiple Access (WCDMA) system, an evolved Node B (eNB or e-NodeB) in a long term evolution (LTE) system, a 5G base station (gNB) in a next generation system, a Home evolved Node B (HeNB), a relay node, a femto, a pico, etc., and is not limited in this disclosure. In some network structures, the network equipment may include centralized unit (CU) nodes and distributed unit (DU) nodes, and the centralized unit and distributed unit may be geographically separated.

[0229] Network devices and terminal devices can each use one or more antennas for multiple-input multiple-output (MIMO) transmission. MIMO transmission can be single-user MIMO (SU-MIMO) or multiple-user MIMO (MU-MIMO). Depending on the configuration and number of antenna combinations, MIMO transmission can be 2D-MIMO, 3D-MIMO, FD-MIMO, or massive-MIMO, and can also be diversity transmission, precoding transmission, or beamforming transmission, etc.

[0230] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0231] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-executable instructions. These computer-executable instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0232] These processor-executable instructions may also be stored in a processor-readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the processor-readable memory produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0233] These processors can execute instructions that can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0234] It should be understood that the various processes shown above can be used, with steps rearranged, added, or deleted. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure is achieved. This is not a limitation herein. Obviously, those skilled in the art can make various modifications and variations to this disclosure without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure also intends to include these modifications and variations.

Claims

1. A method for obtaining power consumption information of a network device, characterized in that, include: Collect the CPU base power of the processor CPU in the network device. The CPU base power is the power when all cores of the CPU are executing idle system tasks. In response to the network device's operating system (OS) being in an idle, non-sleep mode, the first total power of the CPU and the task runtime of each system task are collected. For each system task, the CPU optimized power is obtained based on the first total power and the CPU base power. Based on the runtime of the system task, the ratio of the optimized power of the system task to the CPU optimized power is determined. Based on the ratio of the optimized power of the system task to the CPU optimized power, the optimized power of the system task is calculated. Based on the CPU base power, the base power of the system task is obtained. Based on the base power of the system task and the optimized power of the system task, the task power consumption information of the system task is obtained. For each system function, based on the task power consumption information of the first system task that calls the system function, the function power consumption information of the system function is obtained; For each core of the CPU, the core power consumption information of the core is obtained based on the second system task processed by the core.

2. The method according to claim 1, characterized in that, The process of obtaining the task power consumption information of the system task also includes: Obtain the target optimized power of the system task, where the target optimized power is the power reduction achieved when the system task stops running; Based on the number of CPU cores and the CPU's base power, calculate the average base power of each CPU core, which is then used as the core base power of each core. Based on the task runtime, determine the percentage of the third runtime of the system task in the corresponding kernel; Based on the kernel base power, the third runtime percentage, and the target optimized power, the task power consumption information of the system task is obtained.

3. The method according to claim 2, characterized in that, The step of obtaining the target optimized power of the system task includes: Determine the task type of the system task; Obtain the total runtime of all cores within the CPU and the CPU optimized power of the CPU, wherein the CPU optimized power is the power reduction achieved when all system tasks processed by the CPU stop running; The target optimized power is determined based on the task type, the total runtime, the task runtime, and the CPU optimized power.

4. The method according to claim 3, characterized in that, Determining the target optimized power based on the task type, the total runtime, the task runtime, and the CPU optimized power includes: The system task is a first-class system task; Based on the task runtime and the total runtime, determine the first runtime percentage of the system task; Based on the first runtime percentage and the CPU optimized power, the first optimized power of the system task is determined as the target optimized power.

5. The method according to claim 3, characterized in that, The step of determining the target optimized power based on the task type, the total runtime, the task runtime, and the CPU optimized power further includes: In response to the system task being a second type of system task, the second total power of the CPU when the system task stops running is obtained, and the second optimized power of the system task is obtained based on the first total power and the second total power; The power weights of the system tasks are determined based on the first optimized power, the second optimized power, and the proportion of the first runtime. Based on the power weight and the task runtime, the second runtime percentage of the system task is determined; Based on the second runtime percentage and the CPU optimized power, the third optimized power of the system task is obtained and used as the target optimized power.

6. The method according to any one of claims 3-5, characterized in that, The process of obtaining the CPU optimized power includes: Obtain the difference between the first total power and the CPU base power, and determine the difference as the CPU optimized power.

7. The method according to claim 2, characterized in that, The process of obtaining the power consumption information of the system function includes: Obtain the function runtime of the system function; Based on the function runtime and the task runtime of the first system task, determine the fourth runtime percentage of the system function in the first system task; Based on the task power consumption information of the first system task and the fourth runtime percentage, the function power consumption information of the system function is obtained.

8. The method according to claim 7, further comprising: Based on the fourth runtime percentage and the target optimization power of the first system task, the function optimization power of the system function is determined, whereby the function optimization power is the power reduced when the system function stops running.

9. The method according to claim 1, characterized in that, The process of obtaining the kernel power consumption information of the kernel includes: Based on the target optimization power of the second system task, the kernel optimization power of the kernel is determined, wherein the kernel optimization power is the power reduction caused by all system tasks of the kernel stopping running; Obtain the kernel's base power, and based on the base power and the optimized power, obtain the kernel's power consumption information; or Based on the task power consumption information of the second system task processed by the kernel, the kernel power consumption information of the kernel is obtained.

10. The method according to claim 1, characterized in that, The method further includes: The task power consumption information, the function power consumption information, and the kernel power consumption information are displayed. During the display of the power consumption information of the network device, it is possible to identify whether the network device has any abnormal power consumption. In response to an abnormal power consumption in the network device, the abnormal power consumption information is marked as abnormal information and displayed, and / or a corresponding warning message is generated to provide an abnormal reminder.

11. A device for acquiring power consumption information of a network device, characterized in that, include: Memory, transceiver, processor: Memory, used to store computer programs; Transceiver, used to send and receive data under the control of the processor; Processor, configured to read the computer program in the memory and perform the following operations: Collect the CPU base power of the processor CPU in the network device. The CPU base power is the power when all cores of the CPU are executing idle system tasks. In response to the network device's operating system (OS) being in an idle, non-sleep mode, the first total power of the CPU and the task runtime of each system task are collected. For each system task, the CPU optimized power is obtained based on the first total power and the CPU base power. Based on the runtime of the system task, the ratio of the optimized power of the system task to the CPU optimized power is determined. Based on the ratio of the optimized power of the system task to the CPU optimized power, the optimized power of the system task is calculated. Based on the CPU base power, the base power of the system task is obtained. Based on the base power of the system task and the optimized power of the system task, the task power consumption information of the system task is obtained. For each system function, based on the task power consumption information of the first system task that calls the system function, the function power consumption information of the system function is obtained; For each core of the CPU, the core power consumption information of the core is obtained based on the second system task processed by the core.

12. A device for acquiring power consumption information of a network device, characterized in that, include: The first acquisition unit is used to acquire the CPU base power of the processor CPU in the network device. The CPU base power is the power when all cores of the CPU are executing idle system tasks. The second acquisition unit is used to acquire the first total power of the CPU and the task runtime of each system task in response to the network device's operating system (OS) being in an idle non-sleep mode. The task power consumption information acquisition unit is used to, for each system task, obtain the CPU optimized power based on the first total power and the CPU base power, determine the ratio of the system task's optimized power to the CPU optimized power based on the system task's runtime, calculate the system task's optimized power based on the ratio of the system task's optimized power to the CPU optimized power, obtain the system task's base power based on the CPU base power, and obtain the system task's task power consumption information based on the system task's base power and the system task's optimized power. The function power consumption information acquisition unit is used to acquire the function power consumption information of each system function based on the task power consumption information of the first system task that calls the system function. The kernel power consumption information acquisition unit is used to acquire kernel power consumption information for each kernel of the CPU based on the second system task processed by the kernel.

13. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.

14. A processor-readable storage medium, characterized in that, The processor-readable storage medium stores a processor-executable computer program that performs the method of any one of claims 1 to 10.

Citation Information

Patent Citations

  • Power consumption control method and device based on processor

    CN108664367A

  • Fine-grained cloud resource management and control system and method based on service component level

    CN111625347A