Device power consumption determination method and apparatus, and device
By grouping and least squares fitting processing of computer room equipment, the problem of inaccurate power consumption information of computer room equipment is solved, and high-precision determination of equipment type power consumption information is achieved.
Patent Information
- Application Number
- PCT/IB2025/050135
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-17
- Filing Date
- 2025-01-07
- Publication Date
- 2025-07-24
AI Technical Summary
In the prior art, there is inaccuracy and incompleteness in the collection of power consumption information of computer room equipment, which makes it difficult to accurately determine the power consumption information of each device type.
By grouping the cabinet equipment in the computer room, the historical power consumption of each cabinet is obtained, and the least squares method is used for fitting processing. Combining the equipment group information and power consumption constraints, the equipment power consumption of each equipment type in the computer room is determined.
It improves the accuracy of equipment power consumption information, avoids the problems of inaccurate and incomplete collection, saves the abnormal filtering process, and enhances the determination accuracy of equipment type power consumption information.
Smart Images

Figure IB2025050135_24072025_PF_FP_ABST
Abstract
Description
[0001] This disclosure claims priority to Chinese patent application number 202410072610.6, filed with the Patent Office of China on January 17, 2024, entitled "Method, Apparatus, and Device for Determining Device Power Consumption," the entire contents of which are incorporated herein by reference. Technical Field This disclosure relates to the field of computers, and more particularly to a method, apparatus, and device for determining device power consumption. Background: A computer room may include multiple cabinets, each of which may contain multiple servers, network devices, and other devices. In practice, power consumption information for each device may be obtained to optimize power consumption in the computer room. In related art, the actual power consumption of each device may be collected for statistical analysis to obtain power consumption information for each device type. However, in actual data collection, the data collection is often inaccurate and incomplete, resulting in low accuracy in determining power consumption information for each device type. SUMMARY OF THE INVENTION Various aspects of this disclosure provide a method, apparatus, and device for determining device power consumption to improve the accuracy of power consumption information for each device type. In a first aspect, embodiments of the present disclosure provide a method for determining device power consumption, comprising: grouping devices in cabinets in a computer room to obtain at least one device group corresponding to each cabinet, wherein the devices in the device group are of the same device type; obtaining historical power consumption of each cabinet, wherein the historical power consumption is the sum of the power consumption of the devices in the cabinet; and determining the device power consumption corresponding to each device type in the computer room based on the historical power consumption of each cabinet and device group information of at least one device group corresponding to each cabinet, wherein the device group information includes the device type and the number of devices. In one possible implementation, determining the device power consumption corresponding to each device type in the computer room based on the historical power consumption of each cabinet and device group information of at least one device group corresponding to each cabinet includes: determining multiple device types and power consumption constraints corresponding to the multiple device types, where the power consumption constraints include at least one of the following: a power consumption range of the device type and a power consumption relationship between different device types; performing at least one fitting process on the historical power consumption of each cabinet, the device group information of at least one device group corresponding to each cabinet, and the power consumption constraints using a least squares method until the accuracy of the obtained fitting result is greater than or equal to a preset threshold, and determining the device power consumption corresponding to each device type based on the fitting result of the last fitting process; wherein the fitting result includes an estimated device power consumption corresponding to each device type.In a possible implementation, performing at least one fitting process on the historical power consumption of each cabinet, device group information of at least one device group corresponding to each cabinet, and the power consumption constraint using a least squares method until the accuracy of the obtained fitting result is greater than or equal to a preset threshold, and determining the device power consumption corresponding to each device type based on the fitting result of the last fitting process, includes: determining an i-th cabinet set from the multiple cabinets; performing an i-th fitting process on the historical power consumption of each cabinet in the i-th cabinet set, the device group information of at least one device group corresponding to each cabinet in the i-th cabinet set, and the power consumption constraint corresponding to the i-th cabinet set using a least squares method to obtain an i-th fitting result, and determining the accuracy of the i-th fitting result; wherein i is 1, 2, ..., until the accuracy of the i-th fitting result is greater than or equal to the preset threshold, and determining the device power consumption corresponding to each device type based on the i-th fitting result. In one possible implementation, determining an i-th cabinet set from the multiple cabinets includes: if i is 1, determining the multiple cabinets as the i-th cabinet set; and if i is greater than 1, determining the i-th cabinet set from the i-1-th cabinet set based on an i-1-th fitting result, where the cabinets in the i-1-th cabinet set are cabinets that participated in the i-1-th fitting process. In one possible implementation, determining the i-th cabinet set in the i-1th cabinet set based on the i-1th fitting result includes: determining, for any cabinet in the i-1th cabinet set, the estimated power consumption of the cabinet based on the estimated device power consumption corresponding to each device type in the i-1th fitting result and device group information of at least one device group corresponding to the cabinet, and determining the estimated deviation of the cabinet based on the estimated power consumption of the cabinet and the historical power consumption of the cabinet; and determining a cabinet in the i-1th cabinet set whose estimated deviation is less than or equal to a first threshold as a cabinet in the i-1th cabinet set.In one possible implementation, an i-th fitting process is performed on historical power consumption of each cabinet in the i-th cabinet set, device group information of at least one device group corresponding to each cabinet in the i-th cabinet set, and power consumption constraints corresponding to the i-th cabinet set using a least squares method to obtain an i-th fitting result, including: generating, for any cabinet in the i-th cabinet set, a cabinet vector corresponding to the cabinet based on the device group information of at least one device group corresponding to the cabinet, where the cabinet vector includes the number of devices corresponding to each device type included in the cabinet; concatenating the cabinet vectors corresponding to each cabinet in the i-th cabinet set to obtain an independent variable matrix; determining a dependent variable matrix based on the historical power consumption of each cabinet in the i-th cabinet set; and fitting the independent variable matrix, the dependent variable matrix, and the power consumption constraints corresponding to the i-th cabinet set using the least squares method to obtain the i-th fitting result. In one possible implementation, determining the accuracy of an i-th fitting result includes: determining, for any cabinet in an i-th cabinet set, an estimated power consumption of the cabinet based on estimated device power consumption corresponding to each device type in the i-th fitting result and device group information of at least one device group corresponding to the cabinet, and determining an estimated deviation corresponding to the cabinet as a ratio of an absolute value of a difference between the estimated power consumption of the cabinet and a historical power consumption of the cabinet to the historical power consumption of the cabinet; and determining the accuracy of the i-th fitting result based on the estimated deviation corresponding to each cabinet in the i-th cabinet set. In one possible embodiment, determining the accuracy of the i-th fitting result based on the estimated deviation corresponding to each cabinet in the i-th cabinet set includes: if the estimated deviation corresponding to each cabinet in the i-th cabinet set is respectively less than or equal to the first threshold, determining that the accuracy of the i-th fitting result is greater than or equal to the preset threshold; and if there is a cabinet in the i-th cabinet set whose estimated deviation corresponding to the cabinet is greater than the first threshold, determining that the accuracy of the i-th fitting result is less than the preset threshold. In another possible embodiment, determining the device power consumption corresponding to each device type based on the i-th fitting result includes: for any device type, obtaining the estimated device power consumption corresponding to the device type in the i-th fitting result, and determining the estimated device power consumption as the device power consumption corresponding to the device type.In one possible implementation, for any cabinet in the computer room, grouping devices in the cabinet in the computer room to obtain at least one device group corresponding to the cabinet includes: determining multiple preset device types and standard device information corresponding to each device type; obtaining device information of each device in the cabinet; for any device in the cabinet, matching the device information of the device with the standard device information corresponding to each device type to determine the device type corresponding to the device; and grouping devices of the same device type in the cabinet into one device group to obtain the at least one device group. In a second aspect, an embodiment of the present disclosure provides an apparatus for determining device power consumption, comprising: a grouping module, an acquisition module, and a determination module, wherein the grouping module is configured to group devices in each cabinet in a computer room to obtain at least one device group corresponding to each cabinet, wherein each device in the device group has the same device type; the acquisition module is configured to obtain historical power consumption of each cabinet, wherein the historical power consumption is the sum of the power consumption of each device in the cabinet; and the determination module is configured to determine the device power consumption corresponding to each device type in the computer room based on the historical power consumption of each cabinet and device group information of at least one device group corresponding to each cabinet, wherein the device group information includes the device type and the number of devices. In one possible implementation, the determination module is specifically configured to: determine multiple device types and power consumption constraints corresponding to the multiple device types, where the power consumption constraints include at least one of the following: a power consumption range of the device type and a power consumption relationship between different device types; perform at least one fitting process on the historical power consumption of each cabinet, device group information of at least one device group corresponding to each cabinet, and the power consumption constraints using a least squares method, until the accuracy of the obtained fitting result is greater than or equal to a preset threshold, and determine the device power consumption corresponding to each device type based on the fitting result of the last fitting process; wherein the fitting result includes the estimated device power consumption corresponding to each device type. In one possible implementation, the determination module is specifically configured to: determine an i-th cabinet set from the multiple cabinets; perform an i-th fitting process on the historical power consumption of each cabinet in the i-th cabinet set, device group information of at least one device group corresponding to each cabinet in the i-th cabinet set, and power consumption constraints corresponding to the i-th cabinet set using a least squares method to obtain an i-th fitting result, and determine the accuracy of the i-th fitting result; wherein i is 1, 2, ..., until the accuracy of the i-th fitting result is greater than or equal to the preset threshold, and determine the device power consumption corresponding to each device type according to the i-th fitting result.In one possible embodiment, the determination module is specifically configured to: if i is 1, determine the multiple cabinets as the i-th cabinet set; if i is greater than 1, determine the i-th cabinet set in the i-1th cabinet set based on the i-1th fitting result, with the cabinets in the i-1th cabinet set being the cabinets participating in the i-1th fitting process. In one possible embodiment, the determination module is specifically configured to: for any cabinet in the i-1th cabinet set, determine the estimated power consumption of the cabinet based on the estimated device power consumption corresponding to each device type in the i-1th fitting result and device group information of at least one device group corresponding to the cabinet; determine the estimated deviation of the cabinet based on the estimated power consumption of the cabinet and the historical power consumption of the cabinet; and determine the cabinet in the i-1th cabinet set whose estimated deviation is less than or equal to a first threshold as a cabinet in the i-1th cabinet set. In one possible implementation, the determination module is specifically configured to: generate, for any cabinet in the i-th cabinet set, a cabinet vector corresponding to the cabinet based on device group information of at least one device group corresponding to the cabinet, where the cabinet vector includes the number of devices corresponding to each device type included in the cabinet; concatenate the cabinet vectors corresponding to each cabinet in the i-th cabinet set to obtain an independent variable matrix; determine a dependent variable matrix based on the historical power consumption of each cabinet in the i-th cabinet set; and fit the independent variable matrix, the dependent variable matrix, and the power consumption constraint conditions corresponding to the i-th cabinet set using the least squares method to obtain the i-th fitting result. In one possible embodiment, the determination module is specifically configured to: determine, for any cabinet in the i-th cabinet set, the estimated power consumption of the cabinet based on the estimated device power consumption corresponding to each device type in the i-th fitting result and the device group information of at least one device group corresponding to the cabinet, and determine the estimated deviation corresponding to the cabinet as the ratio of the absolute value of the difference between the estimated power consumption of the cabinet and the historical power consumption of the cabinet to the historical power consumption of the cabinet; and determine the accuracy of the i-th fitting result based on the estimated deviation corresponding to each cabinet in the i-th cabinet set. In one possible embodiment, the determination module is specifically configured to: determine that the accuracy of the i-th fitting result is greater than or equal to the preset threshold if the estimated deviation corresponding to each cabinet in the i-th cabinet set is respectively less than or equal to the first threshold; and determine that the accuracy of the i-th fitting result is less than the preset threshold if there is a cabinet in the i-th cabinet set whose estimated deviation corresponding to the cabinet is greater than the first threshold.In one possible implementation, the determination module is specifically configured to: for any device type, obtain the estimated device power consumption corresponding to the device type in the i-th fitting result, and determine the estimated device power consumption as the device power consumption corresponding to the device type. In one possible implementation, for any cabinet in the computer room, the grouping module is specifically configured to: determine multiple preset device types and standard device information corresponding to each device type; obtain device information for each device in the cabinet; for any device in the cabinet, match the device information of the device with the standard device information corresponding to each device type to determine the device type corresponding to the device; and group devices of the same device type in the cabinet into a device group to obtain the at least one device group. In a third aspect, an embodiment of the present disclosure provides an electronic device comprising: a memory and a processor; the memory storing computer-executable instructions; and the processor executing the computer-executable instructions stored in the memory, causing the processor to perform any of the methods described in the first aspect. In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium storing computer-executable instructions. When executed by a processor, the computer-executable instructions are used to implement any of the methods described in the first aspect. In a fifth aspect, embodiments of the present disclosure provide a computer program product, including a computer program. When executed by a processor, the computer program implements any of the methods described in the first aspect. Embodiments of the present disclosure provide a method, apparatus, and device for determining device power consumption. An electronic device can group devices in cabinets in a computer room to obtain at least one device group corresponding to each cabinet. The electronic device can obtain historical power consumption of each cabinet and, based on the historical power consumption of each cabinet and device group information of at least one device group corresponding to each cabinet, determine the device power consumption corresponding to each device type in the computer room. The device group information includes the device type and number of devices. Because the power consumption of each device type in the computer room can be determined based on the historical power consumption of each cabinet and by device group, there is no need to collect the actual power consumption of each device, thus avoiding inaccurate and incomplete data collection. Furthermore, the least squares method is used for fitting, which effectively filters out noise and eliminates the complex anomaly filtering process, thus comprehensively improving the accuracy of power consumption information for each device type in the computer room. BRIEF DESCRIPTION OF THE DRAWINGS The drawings described herein are provided to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are provided to explain the present disclosure and are not intended to unduly limit the present disclosure.In the accompanying drawings: Figure 1 is a schematic diagram of a scenario provided by an exemplary embodiment of the present disclosure; Figure 2 is a flowchart of a method for determining device power consumption provided by an exemplary embodiment of the present disclosure; Figure 3 is a process diagram of another method for determining device power consumption provided by an exemplary embodiment of the present disclosure; Figure 4 is a process diagram of a method for determining device power consumption provided by an exemplary embodiment of the present disclosure; Figure 5 is a structural diagram of an apparatus for determining device power consumption provided by an exemplary embodiment of the present disclosure; and Figure 6 is a structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS: It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, and displayed data, etc.) involved in the present disclosure are all information and data authorized by the user or fully authorized by all parties. The collection, use, and processing of the relevant data must comply with relevant laws, regulations, and standards, and corresponding operation portals are provided for users to choose to authorize or reject. To make the objectives, technical solutions, and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below in conjunction with the specific embodiments of the present disclosure and the corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present disclosure, and are not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure. Figure 1 is a schematic diagram of a scenario provided by an exemplary embodiment of this disclosure. Referring to Figure 1 , a computer room may include multiple cabinets. For example, the multiple cabinets may be cabinet 1, cabinet 2, cabinet n, where n is an integer greater than or equal to 1. Each cabinet may include multiple device groups. Each device group may include multiple devices. For example, cabinet 1 may include five device groups, namely device group 1, device group 2, device group 3, device group 4, and device group 5. Device group 1 may include eight devices, namely device 1-1, device 1-2, ..., and device 1-8. Historical power consumption corresponding to each cabinet may be obtained. For example, historical power consumption 1 corresponding to cabinet 1, historical power consumption 2 corresponding to cabinet 2, and historical power consumption n corresponding to cabinet n may be obtained. The electronic device can determine the power consumption of each device in the computer room based on the n historical power consumptions and device type, thereby determining the power consumption of each device. In related technologies, the actual power consumption of each device can be collected for statistical analysis to obtain power consumption information for each device.However, in the actual data collection process, inaccurate and incomplete data collection often occurs, resulting in low accuracy in determining the power consumption information of each device. In an embodiment of the present disclosure, electronic equipment can group devices in each cabinet in the computer room to obtain at least one device group corresponding to each cabinet, and obtain the historical power consumption of each cabinet. Based on the historical power consumption of each cabinet and the device group information corresponding to each cabinet, the device power consumption corresponding to each device type in the computer room can be determined. Because the device power consumption corresponding to each device type in the computer room can be determined based on the historical power consumption of each cabinet and the device group information corresponding to each cabinet, there is no need to collect the actual power consumption of each device, thus avoiding inaccurate and incomplete data collection and improving the accuracy of determining the power consumption information of each device. The technical solutions of the present disclosure are described in detail below through specific embodiments. It should be noted that the following embodiments may exist independently or in combination with each other, and the same or similar content will not be repeated in different embodiments. Figure 2 is a flow chart of a method for determining device power consumption provided by an exemplary embodiment of the present disclosure. Referring to Figure 2, the method may include:
[0002] S201: Group devices in each cabinet in the computer room to obtain at least one device group corresponding to each cabinet. The execution subject of the embodiments of the present disclosure may be an electronic device or a device power consumption determination device provided in the electronic device. The device power consumption determination device may be implemented via software or a combination of software and hardware. The device power consumption determination device may be a processor in the electronic device. For ease of understanding, the following description uses the electronic device as an example. The devices in the device group have the same device type, meaning that the devices in the device group have the same device information across multiple preset dimensions. In an optional embodiment, for any cabinet in the computer room, the devices in the cabinet are grouped to obtain at least one device group corresponding to the cabinet: multiple preset device types and standard device information corresponding to each device type are determined; device information for each device in the cabinet is obtained; for any device in the cabinet, the device information of the device is matched with the standard device information corresponding to each device type to determine the device type corresponding to the device; and devices in the cabinet with the same device type are grouped together to obtain at least one device group. Standard device information may include device information corresponding to multiple preset dimensions. For example, the preset dimensions may include device model, bandwidth range, running task, and running status. For example, standard device information 1 corresponding to device type 1 may include: device model is model 1, bandwidth range is 1M (megabyte) to 5M, running task is computing, and running status is online. For example, if there are 15 preset device types, the standard device information corresponding to these 15 device types is shown in Table 1: Table 1 If there are 20 devices in cabinet 1, device information for these 20 devices can be obtained and matched with the standard device information corresponding to each device type to determine the device types corresponding to these 20 devices, as shown in Table 1. This allows the identification of five device groups corresponding to cabinet 1. Specifically, for example, if devices 1, 2, and 3 are all model 1, have bandwidths ranging from 1M to 5M, are all running computing tasks, and are all in online status, then these three devices can be determined to correspond to device type 1 and thus be grouped into device group 1. Similarly, devices 4, 5, 6, 7, 8, and 9 can be grouped into device group 2, and so on. Devices 19 and 20 can be grouped into device group 5. For example, if there are 10 cabinets, namely cabinet 1, cabinet 2, and cabinet 10, the above method can be used to determine that each of these 10 cabinets corresponds to at least one device group.
[0003] S202: Obtain historical power consumption for each cabinet. Historical power consumption is the sum of the power consumption of each device in the cabinet. Historical power consumption can be expressed in watts (W). Optionally, for any cabinet, the electronic device can obtain multiple initial historical power consumptions of the cabinet and perform outlier removal and statistical processing on the multiple initial historical power consumptions to obtain historical power consumption. The historical power consumption may include a historical power consumption mean and a historical power consumption variance. Optionally, the initial historical power consumption may be obtained from an Energy Management System (EMS). Obtaining the initial historical power consumption of each cabinet in the EMS can simplify the data collection process. For any cabinet, the multiple initial historical power consumptions may be collected at various historical moments within a preset time period according to a collection cycle. For example, if the preset time period is 24 hours and the collection cycle is 30 minutes, 48 initial historical power consumptions of cabinet 1 may be collected at 48 historical moments within 24 hours according to a 30-minute collection cycle. An outlier refers to a power consumption value that is clearly unreasonable. For example, if the power of each device in cabinet 1 is at least 100W, then when cabinet 1 is running, the initial historical power consumption of cabinet 1 is at least 100W. If the initial historical power consumption 1 is 5W, it can be determined that the initial historical power consumption 1 is an abnormal value. For example, if 48 initial historical power consumptions of cabinet 1 are collected, the abnormal values can be removed from the 48 initial historical power consumptions. Assuming that after removing the abnormal values, there are 45 initial historical power consumptions, the 45 initial historical power consumptions can be statistically processed to obtain the historical power consumption mean 1 and the historical power consumption variance 1 of cabinet 1. It can then be determined that the historical power consumption of cabinet 1 includes the historical power consumption mean 1 and the historical power consumption variance 1. For example, if there are 10 cabinets, the historical power consumption corresponding to the 10 cabinets can be obtained. Assume that the historical power consumption corresponding to the 10 cabinets can be shown in Table 2: Table 2
[0004] S203. Determine the device power consumption corresponding to each device type in the computer room based on the historical power consumption of each cabinet and the device group information of at least one device group corresponding to each cabinet. For any device group, the device group information of the device group may include the device type and the number of devices. The number of devices refers to the number of devices in the device group. For example, for device group 1 in Table 1, device group information 1 may include device type 1 and device number 3 (indicating that device group 1 includes 3 devices). For example, if there are 10 cabinets, assuming that the device group information of at least one device group corresponding to each of the 10 cabinets is as shown in Table 3: Table 3 As shown in Table 3, for cabinet 1, cabinet 1 can have five corresponding device groups: device group 1-1, device group 1-2, device group 1-3, device group 1-4, and device group 1-5. Device group information 1-1 for device group 1-1 includes device type 1 and a device quantity of 3; device group information 1-2 for device group 1-2 includes device type 2 and a device quantity of 6; ...; device group information 1-5 for device group 1-5 includes device type 5 and a device quantity of 2. For cabinet 2, cabinet 2 can have four corresponding device groups: device group 2-1, device group 2-2, device group 2-3, and device group 2-4. The device group information 2-1 of device group 2-1 may include device type 2 and device quantity 5; the device group information 2-2 of device group 2-2 may include device type 3 and device quantity 7; ...; and the device group information 2-4 of device group 2-4 may include device type 15 and device quantity 7. In an optional embodiment, the device power consumption corresponding to each device type in the computer room may be determined based on the historical power consumption of each cabinet and the device group information of at least one device group corresponding to each cabinet in the following manner: multiple device types and corresponding power consumption constraints are determined; and the historical power consumption of each cabinet, the device group information of at least one device group corresponding to each cabinet, and the power consumption constraints are fitted at least once using the least squares method until the accuracy of the fitting result is greater than or equal to a preset threshold. The device power consumption corresponding to each device type is then determined based on the fitting result of the last fitting process. Optionally, for any device type, the device power consumption corresponding to the device type may include: a mean device power consumption and a variance of the device power consumption. The power consumption constraints may be preset manually. Optionally, the power consumption constraint includes at least one of the following: a power consumption range of a device type, or a power consumption relationship between different device types. For example, the power consumption range of a device type may be: the power consumption range of device type 1 is greater than 100; and the power consumption relationship between different device types may be: the power consumption of devices corresponding to device type 2 is greater than the power consumption of devices corresponding to device type 3. The fitting result may include an estimated device power consumption corresponding to each device type. The estimated device power consumption may include an estimated mean device power consumption and an estimated variance of the device power consumption. For example, if there are 15 device types, power consumption constraints corresponding to each of the 15 device types may be determined.If there are 10 cabinets, the historical power consumption of these 10 cabinets is as shown in Table 2, and the device group information of at least one device group corresponding to these 10 cabinets is as shown in Table 3, then a least squares method can be used to perform at least one fitting process on the historical power consumption of each cabinet, the device group information of at least one device group corresponding to each cabinet, and the power consumption constraints. When the accuracy of the obtained fitting result is greater than or equal to a preset threshold, the device power consumption corresponding to each of the 15 device types is determined based on the fitting result of the last fitting process. For any device type, the device power consumption corresponding to the device type is the device power consumption of the device corresponding to that device type. For example, if it is determined that the device power consumption corresponding to device type 1 includes a mean power consumption of 200 W and a variance of 310 W, and if devices 1, 2, and 3 correspond to device type 1, then it can be determined that the device power consumption of devices 1, 2, and 3 each includes a mean power consumption of 200 W and a variance of 310 W. Optionally, after determining the device power consumption corresponding to each device type, the device power consumption of all devices can be output, or the device power consumption of some devices can be selectively output. For example, the device power consumption of devices with an "online" operating status can be output. In an embodiment of the present disclosure, the electronic device can group devices in each cabinet in the computer room to obtain at least one device group corresponding to each cabinet. The electronic device can obtain historical power consumption of each cabinet and, based on the historical power consumption of each cabinet and the device group information of the at least one device group corresponding to each cabinet, determine the device power consumption corresponding to each device type in the computer room. The device group information includes the device type and the number of devices. Because the power consumption of each device type in the computer room can be determined based on the historical power consumption of each cabinet and the device group, there is no need to collect the actual power consumption of each device, avoiding inaccurate and incomplete collection problems. In addition, the least squares method is used for fitting, which has the effect of filtering noise, eliminating the complex abnormality filtering process, and comprehensively improving the accuracy of the power consumption information determined for each device type in the computer room.In an optional embodiment, the device power consumption corresponding to each device type can be determined using the least squares method in the following manner: An i-th cabinet set is determined from multiple cabinets; Using the least squares method, an i-th fitting process is performed on the historical power consumption of each cabinet in the i-th cabinet set, the device group information of at least one device group corresponding to each cabinet in the i-th cabinet set, and the power consumption constraints corresponding to the i-th cabinet set to obtain an i-th fitting result, and the accuracy of the i-th fitting result is determined; wherein i is 1, 2, ..., until the accuracy of the i-th fitting result is greater than or equal to a preset threshold, the device power consumption corresponding to each device type is determined based on the i-th fitting result. The above process is described in detail below with reference to FIG3 . FIG3 is a schematic diagram of another method for determining device power consumption provided in an exemplary embodiment of the present disclosure. Referring to FIG3 , the method may include:
[0005] 5301. Initialize i to lo. i is an integer greater than or equal to 1, and can be 1, 2, ... Initializing i to 1 means starting from i=1.
[0006] S302. Determine an i-th cabinet set from multiple cabinets. Optionally, determining the i-th cabinet set from multiple cabinets includes the following two cases: Case 1: i is 1. In this case, multiple cabinets can be determined as the i-th cabinet set. For example, if there are 10 cabinets, these 10 cabinets can be determined as the first cabinet set. The first cabinet set includes 10 cabinets, namely cabinet 1, cabinet 2, and cabinet 10. Case 2: i is greater than 10. In this case, the i-th cabinet set can be determined from the i-1-th cabinet set based on the i-1-th fitting result. The cabinets in the i-1-th cabinet set are the cabinets that participated in the i-1-th fitting process. In an optional embodiment, the i-th cabinet set can be determined in the i-th cabinet set based on the i-1th fitting result in the following manner: for any cabinet in the i-1th cabinet set, the estimated power consumption of the cabinet is determined based on the estimated device power consumption corresponding to each device type in the i-1th fitting result and device group information of at least one device group corresponding to the cabinet; and the estimated deviation of the cabinet is determined based on the estimated power consumption of the cabinet and the cabinet's historical power consumption; and cabinets in the i-1th cabinet set whose estimated deviation is less than or equal to a first threshold are determined as cabinets in the i-1th cabinet set. The i-1th fitting result may include the estimated device power consumption corresponding to each device type. The estimated device power consumption may include an estimated mean power consumption and an estimated variance of the device power consumption. The estimated power consumption of the cabinet may include an estimated mean power consumption and an estimated variance of the power consumption. For any cabinet, the estimated deviation of the cabinet can be determined by the ratio of the absolute value of the difference between the estimated power consumption and the historical power consumption of the cabinet to the historical power consumption average. Since the estimated power consumption includes the estimated power consumption average and the estimated power consumption variance, and the historical power consumption includes the historical power consumption average and the historical power consumption variance, the estimated deviation of the cabinet can be determined by the ratio of the absolute value of the difference between the estimated power consumption average and the historical power consumption average to the historical power consumption average. The first threshold can be preset manually. For example, the first threshold can be 15%. For example, if there are 15 device types and i-1 is 1, the first fitting result can include the estimated device power consumption corresponding to the 15 device types, assuming that it is shown in Table 4: Table 4 For example, if the first cabinet set includes 10 cabinets, and the device group information of the 10 cabinets is shown in Table 3, if cabinet 1 corresponds to 5 device groups, then the estimated power consumption 1 of cabinet 1 can be determined based on the device group information of the 5 device groups and the estimated device power consumption corresponding to each device type in Table 4. The estimated power consumption mean 1 is 3*200+6*150+5*230+4*170+2*300+100=4030W, and the estimated power consumption variance 1 is 3*310+6*100+5*160+4*190+2*180+100=3550W. o If the historical power consumption of cabinet 1 includes the historical power consumption mean of 4500W and the historical power consumption variance of 3970W, then the estimated deviation degree 1 of cabinet 1 can be determined to be |4 ° 30 ~ 4500| =10%o Similar to 4500, the estimated deviations lo of cabinet 2, cabinet 10 can be determined respectively. Assume that the estimated deviations 1 of the 10 cabinets are as shown in Table 5: Table 5 If the first threshold is 15%, then the cabinets among the 10 cabinets whose estimated deviation 1 is less than or equal to 15% can be determined as cabinets in the second cabinet set. The second cabinet set can include cabinet 1, cabinet 2, cabinet 3, cabinet 5, cabinet 7, cabinet 8, cabinet 9, and cabinet 10.
[0007] S303. For any cabinet in the i-th cabinet set, generate a cabinet vector corresponding to the cabinet based on device group information of at least one device group corresponding to the cabinet. The cabinet vector may include the number of devices corresponding to each device type included in the cabinet. For example, if i is 2, the second cabinet set includes 8 cabinets, namely cabinet 1, cabinet 2, cabinet 3, cabinet 5, cabinet 7, cabinet 8, cabinet 9, and cabinet 10. If the device group information corresponding to each cabinet is as shown in Table 3, then for cabinet 1, since cabinet 1 corresponds to 5 device groups, the device group information 1-1 of device group 1-1 includes device type 1 and device quantity 3, the device group information 1-2 of device group 1-2 includes device type 2 and device quantity 6, ..., and the device group information 1-5 of device group 1-5 includes device type 5 and device quantity 2. Based on the five device group information, the cabinet vector 1 corresponding to cabinet 1 can be determined as (3, 6, 5, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0). In cabinet vector 1, "3" indicates the number of devices corresponding to device type 1 in device group 1, which is 3; "6" indicates the number of devices corresponding to device type 2 in device group 2, which is 6; ...; "2" indicates the number of devices corresponding to device type 5 in device group 5, which is 2. Since there are no devices corresponding to device types 6 to 15 in cabinet 1, bits 6 to 15 in cabinet vector 1 are 0. Similarly, cabinet vector 2 of cabinet 2 can be determined to be (0, 5, 7, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3); cabinet vector 3 of cabinet 3 is (2, 3, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ...; cabinet vector 10 of cabinet 10 is (5, 4, 6, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5).
[0008] S304: Concatenate the cabinet vectors corresponding to each cabinet in the i-th cabinet set to obtain an independent variable matrix. For example, if the second cabinet set includes eight cabinets, and the cabinet vectors corresponding to each cabinet are as shown in the above example, then these eight cabinet vectors can be concatenated to obtain an independent variable matrix corresponding to the second cabinet set, as shown in the following matrix X2: In the independent variable matrix X2, the jth row represents the cabinet vector corresponding to the jth cabinet. For example, the first row represents the cabinet vector 1 corresponding to the first cabinet (i.e., cabinet 1), the second row represents the cabinet vector 2 corresponding to the second cabinet (i.e., cabinet 2), and the eighth row represents the cabinet vector 10 corresponding to the eighth cabinet (i.e., cabinet 10).
[0009] S305. Determine a dependent variable matrix based on the historical power consumption of each cabinet in the i-th cabinet set. Optionally, the dependent variable matrix may include a historical power consumption mean matrix and a historical power consumption variance matrix. For example, if i is 2, the second cabinet set includes eight cabinets, namely cabinet 1, cabinet 2, cabinet 3, cabinet 5, cabinet 7, cabinet 8, cabinet 9, and cabinet 10. If the historical power consumption of each cabinet is as shown in Table 2, the historical power consumption mean and historical power consumption variance of the eight cabinets can be determined from Table 2. Furthermore, a historical power consumption mean matrix can be determined based on the eight historical power consumption mean values, as shown in Matrix Y:
[0010] -4500-
[0011] 5590
[0012] Y2-I= 2500
[0013] The jth element represents the historical average power consumption corresponding to the jth cabinet. For example, the first element represents the historical average power consumption of the first cabinet (i.e., cabinet 1), which is 4500 W; the second element represents the historical average power consumption of the second cabinet (i.e., cabinet 2), which is 5590 W; and the eighth element represents the historical average power consumption of the eighth cabinet (i.e., cabinet 10), which is 5810 W. Similarly, the historical power consumption variance matrix can be determined based on the eight historical power consumption variances, as shown in matrix Y2-2:
[0014] -3970-
[0015] 3900 2-2 = 2300
[0016] -5200- Where the jth element represents the historical power consumption variance corresponding to the jth cabinet. For example, the first element represents the historical power consumption variance of 3970W corresponding to the first cabinet (i.e., cabinet 1); the second element represents the historical power consumption variance of 3900W corresponding to the second cabinet (i.e., cabinet 2); and the eighth element represents the historical power consumption variance of 5200W corresponding to the eighth cabinet (i.e., cabinet 10).
[0017] S306. Fit the independent variable matrix, the dependent variable matrix, and the power consumption constraint corresponding to the i-th cabinet set using the least squares method to obtain an i-th fitting result. Optionally, in the least squares method, the fitting formula used is the following formula (1):
[0018] Yi = B * Xi + b (Formula (1)) where b can be a preset constant; Xi represents the independent variable matrix for the i-th fit; and Yi represents the dependent variable matrix for the i-th fit, including the historical power consumption mean matrix and the historical power consumption variance matrix. When the dependent variable matrix is the historical power consumption mean matrix, 8 can be 81; when the dependent variable matrix is the historical power consumption variance matrix, 8 can be 82. If the cabinets in the second cabinet set correspond to a total of 15 device types, then 81 can include 15 values, namely A1, Bl, C1, ., 01; 82 can include 15 values, namely A2, B2, C2, ., 02; since the i-th fitting result can include the estimated device power consumption mean and estimated device power consumption variance corresponding to each device type, when determining the estimated device power consumption mean corresponding to each device type, the independent variable matrix X2 and the historical power consumption mean matrix Y can be substituted into the fitting formula of the least squares method. If b is 100, the following formula (2) can be obtained:
[0019] ■3 6 5 4 2 -" 01 rAl -4500
[0020] 0 5 7 0 5 - 3 Bl 5590
[0021] 2 3 0 5 0 ■; 0 Cl + 100= 2500 Formula (2)
[0022] -5 4 6 3 0 - 5-1 LOP -5810 If i is 2, the power consumption constraint corresponding to the second cabinet set is: the power consumption range of device type 1 is greater than 100, and the power consumption of devices corresponding to device type 2 is greater than the power consumption of devices corresponding to device type 3. Then the constraint can be expressed as the following formula (3) and formula (4):
[0023] Al>100 Formula (3)
[0024] Al> Bl Formula (4) can be combined with formula (2), formula (3), and formula (4) for fitting to obtain A1, B1, C1, .,
[0025] Where A1 is the estimated mean power consumption of device type 1; B1 is the estimated mean power consumption of device type 2; ...; O1 is the estimated mean power consumption of device type 15. When determining the variance of the estimated power consumption of each device type, the independent variable matrix X2 and the historical power consumption variance matrix Y2-2 can be substituted into the fitting formula of the least squares method. If b is 100, the following formula (5) can be obtained:
[0026] 3 6 5 4 2 ■■- 01 rA2 -3970
[0027] 0 5 7 0 5 - 3 B2 3900
[0028] 2 3 0 5 0 0 C2 + 100= 2300 Formula (5)
[0029] -5 4 6 3 0 - 5-1 '-Ol) -5200- Then, we can fit formula (5) to obtain A2, B2, C2, ., 02. Among them, A2 is the estimated device power consumption variance corresponding to device type 1; B2 is the estimated device power consumption variance corresponding to device type 2; ...; 02 is the estimated device power consumption variance corresponding to device type 15. The second fitting result can include the estimated device power consumption mean and estimated device power consumption variance corresponding to each device type, as shown in Table 6: Table 6
[0030] -5110- Then it can be determined that the estimated power consumption variance 2 corresponding to the first cabinet (i.e. cabinet 1) is 338OW; the estimated power consumption variance 2 corresponding to the second cabinet (i.e. cabinet 2) is 3400W; the estimated power consumption variance 2 corresponding to the eighth cabinet (i.e. cabinet 10) is 5110Wo. Since the estimated power consumption includes the estimated power consumption mean and the estimated power consumption variance, and the historical power consumption includes the historical power consumption mean and the historical power consumption variance, if the estimated deviation of the cabinet is determined based on the estimated power consumption mean and the historical power consumption mean, then for the first cabinet (i.e. cabinet 1), it can be determined that the estimated deviation 2 corresponding to cabinet 1 is |418 °~ 4500| -7%; for the second 4500
[0031] For cabinet 14810-55901 (i.e., cabinet 2), it can be determined that the estimated deviation 2 corresponding to cabinet 2 is - = 14%; for the eighth cabinet (i.e., cabinet 10), it can be determined that the estimated deviation 2 corresponding to cabinet 10 is 15290-58101=9%.
[0032] 5810
[0033] S308. Determine the accuracy of the i-th fitting result based on the estimated deviations corresponding to each cabinet in the i-th cabinet set. In an optional embodiment, the accuracy of the i-th fitting result can be determined based on the estimated deviations corresponding to each cabinet in the i-th cabinet set in the following manner: if the estimated deviations corresponding to each cabinet in the i-th cabinet set are respectively less than a first threshold, determine that the accuracy of the i-th fitting result is greater than or equal to a preset threshold; if there is a cabinet in the i-th cabinet set whose estimated deviation is greater than or less than the first threshold, determine that the accuracy of the i-th fitting result is less than the preset threshold. The preset threshold may be manually preset. For example, the preset threshold may be 85%. For example, if i is 2, the second cabinet set includes 8 cabinets, and the estimated deviation 2 corresponding to each cabinet is as shown in the above example, if the first threshold is 15%, and the estimated deviation 2 corresponding to the 8 cabinets is less than 15%, then it can be determined that the accuracy of the second fitting result is greater than or equal to 15%. If, among the 8 cabinets included in the second cabinet set, there is a cabinet whose estimated deviation is greater than 15%, then it can be determined that the accuracy of the second fitting result is greater than 85%.
[0034] S309. When the accuracy of the i-th fitting result is less than a preset threshold, update i to i+1. For example, if i is 2 and the accuracy of the second fitting result is less than the preset threshold, update 2 to 3 and perform the third fitting.
[0035] S310. Until the accuracy of the i-th fitting result is greater than or equal to a preset threshold, determine the device power consumption corresponding to each device type based on the i-th fitting result. In an optional embodiment, the device power consumption corresponding to each device type can be determined based on the i-th fitting result in the following manner: for any device type, obtain an estimated device power consumption corresponding to the device type from the i-th fitting result, and determine the estimated device power consumption as the device power consumption corresponding to the device type. For example, if the accuracy of the second fitting result is greater than or equal to the preset threshold, the second fitting result is as shown in Table 6. Then, in Table 6, the estimated device power consumption mean of 200W and the estimated device power consumption variance of 310W corresponding to device type 1 can be determined as the device power consumption mean of 200W and the device power consumption variance of 310W corresponding to device type 1; the estimated device power consumption mean of 160W and the estimated device power consumption variance of 100W corresponding to device type 2 can be determined as the device power consumption mean of 160W and the device power consumption variance of 100W corresponding to device type 2; and the estimated device power consumption mean of 310W and the estimated device power consumption variance of 330W corresponding to device type 15 can be determined as the device power consumption mean of 310W and the device power consumption variance of 330W corresponding to device type 15. In an embodiment of the present disclosure, the electronic device can initialize i to 1 and determine the i-th cabinet set among multiple cabinets. For any cabinet in the i-th cabinet set, the electronic device may generate a cabinet vector corresponding to the cabinet based on the device group information of at least one device group corresponding to the cabinet. The electronic device may then concatenate the cabinet vectors corresponding to each cabinet in the i-th cabinet set to obtain an independent variable matrix. The electronic device may determine a dependent variable matrix based on the historical power consumption of each cabinet in the i-th cabinet set. The electronic device may perform a fitting process on the independent variable matrix, the dependent variable matrix, and the power consumption constraints corresponding to the i-th cabinet set using the least squares method to obtain an i-th fitting result. For any cabinet in the i-th cabinet set, the electronic device may determine the estimated power consumption of the cabinet based on the estimated device power consumption corresponding to each device type in the i-th fitting result and the device group information of at least one device group corresponding to the cabinet. The estimated deviation degree corresponding to the cabinet is determined as the ratio of the absolute value of the difference between the estimated power consumption of the cabinet and the historical power consumption of the cabinet to the historical power consumption of the cabinet. The electronic device may determine the accuracy of the i-th fitting result based on the estimated deviation corresponding to each cabinet in the i-th cabinet set, and update i to i+1 when the accuracy of the i-th fitting result is less than a preset threshold. When the accuracy of the i-th fitting result is greater than or equal to the preset threshold, the device power consumption corresponding to each device type may be determined based on the i-th fitting result.Because the device power consumption corresponding to each device type in the computer room can be determined based on the historical power consumption of each cabinet and device group, there is no need to collect the actual power consumption of each device, thus avoiding inaccurate or incomplete data collection. Furthermore, the least squares method is used for fitting, which effectively filters out noise, eliminating the complex anomaly filtering process and comprehensively improving the accuracy of determining the power consumption information of each device type in the computer room. The following further describes the device power consumption determination method based on any of the above embodiments and in conjunction with Figure 4. Figure 4 is a process diagram of a device power consumption determination method provided by an exemplary embodiment of the present disclosure. Referring to Figure 4, the method includes steps ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩, and ⑪. A computer room may include multiple cabinets, each of which may include multiple devices. For example, the computer room may include 10 cabinets, and cabinet 1 may include 20 devices. In step ①, the devices in each cabinet in the computer room may be grouped to obtain at least one device group corresponding to each cabinet. For example, the 20 devices in cabinet 1 may be grouped to obtain five device groups. Device group 1 may include device 1, device 2, and device 3; device group 2 may include device 4, device 5, device 6, device 7, device 8, and device 9; device group 3 may include device 10, device 11, device 12, device 13, and device 14; device group 5 may include device 15, device 16, device 17, and device 18; and device group 5 may include device 19 and device group 20. Similarly, cabinets 2, 10, and 11 may each include at least one device group. In step 2, multiple initial historical power consumptions corresponding to each cabinet may be obtained from the EMS system. For example, multiple initial historical power consumptions corresponding to cabinet 1, multiple initial historical power consumptions corresponding to cabinet 2, and multiple initial historical power consumptions corresponding to cabinet 10 may be obtained. In step 3, outlier removal and statistical processing may be performed on the multiple initial historical power consumptions corresponding to each cabinet to obtain the historical power consumption corresponding to each cabinet. The historical power consumption may include the historical power consumption mean and historical power consumption variance. For example, the historical power consumption mean 1 and historical power consumption variance 1 corresponding to cabinet 1, the historical power consumption mean 2 and historical power consumption variance 2 corresponding to cabinet 2, and the historical power consumption mean 10 and historical power consumption variance 10 corresponding to cabinet 10 can be obtained. When performing the i-th fitting process, the number of cabinets included in the i-th cabinet set can be determined. Each device group has corresponding device group information, which may include the device type and number of devices.For example, the device group information 1 of device group 1 in cabinet 1 may include device type 1 and device quantity 3. Therefore, in step 4, the device group information of at least one device group corresponding to each cabinet in the i-th cabinet set can be determined, as shown in Table 3. In step 5, an independent variable matrix can be determined based on the device group information of at least one device group corresponding to each cabinet. Specifically, for any cabinet in the i-th cabinet set, a cabinet vector corresponding to the cabinet can be generated based on the device group information of at least one device group corresponding to the cabinet. The cabinet vectors corresponding to each cabinet in the i-th cabinet set are then concatenated to obtain an independent variable matrix. For example, if i is 2, the independent variable matrix can be shown as the matrix X2 above. In step 6, a dependent variable matrix can be determined based on the historical power consumption of each cabinet in the i-th cabinet set. The dependent variable matrix can include a historical power consumption mean matrix and a historical power consumption variance matrix. For example, if i is 2, the historical power consumption mean matrix can be shown as the matrix Y-0, and the historical power consumption variance matrix can be shown as the matrix Y2-2 above. In step 7, the independent variable matrix can be input into the least squares model. In step 8, the dependent variable matrix can be input into the least squares model. In step 9, the power consumption constraints corresponding to the i-th cabinet set can be determined and input into the least squares model. In step 10, the independent variable matrix, the dependent variable matrix, and the power consumption constraints corresponding to the i-th cabinet set can be fitted using the least squares model to obtain an i-th fitting result. The i-th fitting result can include the estimated device power consumption i corresponding to each device type. The estimated device power consumption i can include the estimated device power consumption mean i and the estimated device power consumption variance io. For example, if i is 2, the second fitting result can be as shown in Table 6. In step 11, the estimated deviation corresponding to each cabinet in the i-th cabinet set can be determined, and the accuracy of the i-th fitting result can be determined based on the estimated deviation corresponding to each cabinet in the i-th cabinet set. When the accuracy of the i-th fitting result is less than a preset threshold, i is updated to i+1 to perform the i+1th fitting process. The device power consumption corresponding to each device type is determined based on the i-th fitting result until the accuracy of the i-th fitting result is greater than or equal to the preset threshold. For example, if i is 2 and the accuracy of the second fitting result is greater than or equal to the preset threshold, the estimated device power consumption corresponding to each device type in the second fitting result shown in Table 6 can be determined as the device power consumption corresponding to each device.Optionally, if the last fitting result still does not meet expectations, fine-tuning can be performed as follows: Method 1: If there are relatively few cabinets in the computer room, the power consumption data of each device in the cabinet can be used as reference information, and training can be performed at the device group level. The training weights of the power consumption data can be adjusted if necessary. Method 2: Adjustments can be made using a power consumption dictionary to improve the accuracy of the fitting result. Optionally, after determining the device power consumption corresponding to each device type, for any device in the cabinet, the maximum value of the 99.99% percentile under the normal distribution can be calculated based on the device power consumption mean + 3.719 * device power consumption variance. This can then be used to determine the maximum power consumption corresponding to that cabinet, thereby verifying whether the cabinet is at risk of overpowering under extreme conditions. In embodiments of the present disclosure, the electronic device can group the devices in each cabinet in the computer room to obtain at least one device group corresponding to each cabinet. The electronic device can obtain the historical power consumption of each cabinet, and when performing the i-th fitting process, the electronic device can determine the i-th cabinet set among the multiple cabinets. For any cabinet in the i-th cabinet set, the electronic device can generate a cabinet vector corresponding to the cabinet based on the device group information of at least one device group corresponding to the cabinet. The electronic device can then concatenate the cabinet vectors corresponding to each cabinet in the i-th cabinet set to obtain an independent variable matrix. The electronic device can determine a dependent variable matrix based on the historical power consumption of each cabinet in the i-th cabinet set. The electronic device can perform a fitting process on the independent variable matrix, the dependent variable matrix, and the power consumption constraints corresponding to the i-th cabinet set using the least squares method to obtain an i-th fitting result. For any cabinet in the i-th cabinet set, the electronic device can determine an estimated deviation corresponding to the cabinet based on the estimated device power consumption corresponding to each device type in the i-th fitting result and the device group information of at least one device group corresponding to the cabinet. The electronic device can determine the accuracy of the i-th fitting result based on the estimated deviation corresponding to each cabinet in the i-th cabinet set. If the accuracy of the i-th fitting result is less than a preset threshold, the device i is updated to i+lo. When the accuracy of the i-th fitting result is greater than or equal to the preset threshold, the device power consumption corresponding to each device type can be determined based on the i-th fitting result. Because the device power consumption corresponding to each device type in the computer room can be determined based on the historical power consumption of each cabinet and device group, there is no need to collect the actual power consumption of each device, thus avoiding inaccurate and incomplete collection. Furthermore, the fitting process using the least squares method effectively filters out noise, eliminating complex anomaly filtering processes and comprehensively improving the accuracy of determining power consumption information for each device type in the computer room. Figure 5 is a schematic structural diagram of a device power consumption determination apparatus provided by an exemplary embodiment of the present disclosure.Referring to FIG. 5 , the device power consumption determination apparatus 10 includes a grouping module 11, an acquisition module 12, and a determination module 13. The grouping module 11 is configured to group devices in each cabinet in a computer room to obtain at least one device group corresponding to each cabinet, wherein each device in the device group has the same device type. The acquisition module 12 is configured to obtain the historical power consumption of each cabinet, where the historical power consumption is the sum of the power consumption of each device in the cabinet. The determination module 13 is configured to determine the device power consumption corresponding to each device type in the computer room based on the historical power consumption of each cabinet and device group information of at least one device group corresponding to each cabinet, where the device group information includes the device type and number of devices. The device power consumption determination apparatus provided in the embodiments of the present disclosure can implement the technical solutions shown in the aforementioned method embodiments. Its implementation principles and beneficial effects are similar and are not further described here. In one possible implementation, the determination module 13 is specifically configured to: determine multiple device types and power consumption constraints corresponding to the multiple device types, where the power consumption constraints include at least one of the following: a power consumption range of the device type and a power consumption relationship between different device types; perform at least one fitting process on the historical power consumption of each cabinet, device group information of at least one device group corresponding to each cabinet, and the power consumption constraints using a least squares method, until the accuracy of the obtained fitting result is greater than or equal to a preset threshold, and determine the device power consumption corresponding to each device type based on the fitting result of the last fitting process; wherein the fitting result includes the estimated device power consumption corresponding to each device type. In one possible implementation, the determination module 13 is specifically configured to: determine an i-th cabinet set from the multiple cabinets; perform an i-th fitting process using a least squares method on the historical power consumption of each cabinet in the i-th cabinet set, device group information of at least one device group corresponding to each cabinet in the i-th cabinet set, and power consumption constraints corresponding to the i-th cabinet set to obtain an i-th fitting result, and determine the accuracy of the i-th fitting result; wherein i is 1, 2, ..., until the accuracy of the i-th fitting result is greater than or equal to a preset threshold, and then determine the device power consumption corresponding to each device type based on the i-th fitting result. In one possible implementation, the determination module 13 is specifically configured to: if i is 1, determine the multiple cabinets as the i-th cabinet set; if i is greater than 1, determine the i-th cabinet set from the i-1-th cabinet set based on the i-1-th fitting result, where the cabinets in the i-1-th cabinet set are the cabinets participating in the i-1-th fitting process.In one possible implementation, the determination module 13 is specifically used to: determine, for any cabinet in the i-1th cabinet set, the estimated power consumption of the cabinet based on the estimated device power consumption corresponding to each device type in the i-1th fitting result and the device group information of at least one device group corresponding to the cabinet, and determine the estimated deviation of the cabinet based on the estimated power consumption of the cabinet and the historical power consumption of the cabinet; and determine the cabinet in the i-1th cabinet set whose estimated deviation is less than or equal to the first threshold as a cabinet in the i-th cabinet set. In one possible implementation, the determination module 13 is specifically configured to: generate, for any cabinet in the i-th cabinet set, a cabinet vector corresponding to the cabinet based on device group information of at least one device group corresponding to the cabinet, where the cabinet vector includes the number of devices corresponding to each device type included in the cabinet; concatenate the cabinet vectors corresponding to each cabinet in the i-th cabinet set to obtain an independent variable matrix; determine a dependent variable matrix based on the historical power consumption of each cabinet in the i-th cabinet set; and fit the independent variable matrix, the dependent variable matrix, and the power consumption constraint conditions corresponding to the i-th cabinet set using the least squares method to obtain the i-th fitting result. In one possible embodiment, the determination module 13 is specifically configured to: determine, for any cabinet in the i-th cabinet set, the estimated power consumption of the cabinet based on the estimated device power consumption corresponding to each device type in the i-th fitting result and device group information of at least one device group corresponding to the cabinet, and determine the estimated deviation corresponding to the cabinet as the ratio of the absolute value of the difference between the estimated power consumption of the cabinet and the historical power consumption of the cabinet to the historical power consumption of the cabinet; and determine the accuracy of the i-th fitting result based on the estimated deviation corresponding to each cabinet in the i-th cabinet set. In one possible embodiment, the determination module 13 is specifically configured to: determine that the accuracy of the i-th fitting result is greater than or equal to the preset threshold if the estimated deviation corresponding to each cabinet in the i-th cabinet set is respectively less than or equal to the first threshold; and determine that the accuracy of the i-th fitting result is less than the preset threshold if there is a cabinet in the i-th cabinet set whose estimated deviation corresponding to the cabinet is greater than the first threshold. In a possible implementation, the determining module 13 is specifically configured to: for any device type, obtain an estimated device power consumption corresponding to the device type in the i-th fitting result, and determine the estimated device power consumption as the device power consumption corresponding to the device type.In one possible implementation, for any cabinet in the computer room, the grouping module 11 is specifically configured to: determine multiple preset device types and standard device information corresponding to each device type; obtain device information for each device in the cabinet; match the device information of any device in the cabinet with the standard device information corresponding to each device type to determine the device type corresponding to the device; and group devices of the same device type in the cabinet into a device group to obtain at least one device group. The device power consumption determination apparatus provided in the embodiments of the present disclosure can implement the technical solutions described in the above-mentioned method embodiments. The implementation principles and beneficial effects are similar and are not further described here. An exemplary embodiment of the present disclosure provides a schematic structural diagram of an electronic device, as shown in FIG6 . The electronic device 20 may include a processor 21 and a memory 22. Exemplarily, the processor 21 and the memory 22 are interconnected via a bus 23. The memory 22 stores computer-executable instructions; the processor 21 executes the computer-executable instructions stored in the memory 22, causing the processor 21 to perform the method described in the above-mentioned method embodiments. Accordingly, embodiments of the present disclosure provide a computer-readable storage medium storing computer-executable instructions. When executed by a processor, the computer-executable instructions are used to implement the methods described in the above method embodiments. Accordingly, embodiments of the present disclosure may also provide a computer program product, including a computer program. When executed by a processor, the computer program may implement the methods described in the above method embodiments. Those skilled in the art will appreciate that embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code. The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, may be implemented by computer program instructions.These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, such that the instructions, when executed by the processor of the computer or other programmable data processing device, produce means for implementing the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram. These computer program instructions can also be stored in a computer-readable memory capable of directing the computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means, which implement the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram. These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, such that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram. In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-volatile memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media. Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented using any method or technology for information storage. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.It should also be noted that the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, product, or apparatus comprising a list of elements may include not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, product, or apparatus. Without further limitation, the phrase "comprises a..." does not preclude the presence of additional identical elements in the process, method, product, or apparatus comprising the recited elements. The foregoing description is merely an example of the present disclosure and is not intended to limit the present disclosure. Those skilled in the art will readily appreciate that various modifications and variations of the present disclosure are possible. Any modifications, equivalent substitutions, improvements, and the like made within the spirit and principles of the present disclosure are intended to be encompassed by the claims of the present disclosure.
Claims
Claims 1. A method for determining device power consumption, comprising: Group the devices in each cabinet in the computer room to obtain at least one device group corresponding to each cabinet, where the device types of the devices in the device group are the same; obtain the historical power consumption of each cabinet, where the historical power consumption is the sum of the power consumptions of the devices in the cabinet; determine the device power consumption corresponding to each device type in the computer room according to the historical power consumption of each cabinet and the device group information of at least one device group corresponding to each cabinet, where the device group information includes the device type and the number of devices.
2. The method according to claim 1, determining the device power consumption corresponding to each device type in the computer room according to the historical power consumption of each cabinet and the device group information of at least one device group corresponding to each cabinet, includes: Determine a plurality of device types and the power consumption constraint conditions corresponding to the plurality of device types, where the power consumption constraint conditions include at least one of the following: the power consumption range of the device type, the power consumption relationship between different device types; perform at least one fitting process on the historical power consumption of each cabinet, the device group information of at least one device group corresponding to each cabinet, and the power consumption constraint conditions by the least squares method until the accuracy of the obtained fitting result is greater than or equal to a preset threshold, and determine the device power consumption corresponding to each device type according to the fitting result of the last fitting process. Wherein, the fitting result includes the estimated device power consumption corresponding to each device type.
3. The method according to claim 2, performing at least one fitting process on the historical power consumption of each cabinet, the device group information of at least one device group corresponding to each cabinet, and the power consumption constraint condition by the least squares method until the accuracy of the obtained fitting result is greater than or equal to a preset threshold, and determining the device power consumption corresponding to each device type according to the fitting result of the last fitting process, including: Determine the i-th cabinet set among the plurality of cabinets. Perform the i-th fitting process on the historical power consumption of each cabinet in the i-th cabinet set, the device group information of at least one device group corresponding to each cabinet in the i-th cabinet set, and the power consumption constraint conditions corresponding to the i-th cabinet set by the least squares method to obtain the i-th fitting result, and determine the accuracy of the i-th fitting result. Wherein, i takes 1, 2,..., until the accuracy of the i-th fitting result is greater than or equal to the preset threshold, and determine the device power consumption corresponding to each device type according to the i-th fitting result.
4. The method according to claim 3, determining the i-th cabinet set among the multiple cabinets includes: If i is 1, then determine the plurality of cabinets as the i-th cabinet set. If i is greater than 1, then determine the i-th cabinet set from the (i-1)-th cabinet set according to the (i-1)-th fitting result, where the cabinets in the (i-1)-th cabinet set are the cabinets participating in the (i-1)-th fitting process.
5. The method according to claim 4, wherein determining the i-th cabinet set in the (i - 1)-th cabinet set according to the (i - 1)-th fitting result comprises: For any cabinet in the (i-1)-th cabinet set, determine the estimated power consumption of the cabinet according to the estimated device power consumption corresponding to each device type in the (i-1)-th fitting result and the device group information of at least one device group corresponding to the cabinet, and determine the estimated deviation degree of the cabinet according to the estimated power consumption of the cabinet and the historical power consumption of the cabinet; determine the cabinets in the (i-1)-th cabinet set with an estimated deviation degree less than or equal to the first threshold as the cabinets in the i-th cabinet set.
6. According to the method described in any one of claims 3-5, perform the i-th fitting process on the historical power consumption of each cabinet in the i-th cabinet set, the device group information of at least one device group corresponding to each cabinet in the i-th cabinet set, and the power consumption constraint condition corresponding to the i-th cabinet set by the least square method to obtain the i-th fitting result, including: For any cabinet in the i-th cabinet set, generate a cabinet vector corresponding to the cabinet according to the device group information of at least one device group corresponding to the cabinet, where the cabinet vector includes the device types included in the cabinet. The corresponding number of devices; splicing the cabinet vectors corresponding to each cabinet in the i-th cabinet set to obtain an independent variable matrix; determining a dependent variable matrix according to the historical power consumption of each cabinet in the i-th cabinet set; and performing fitting processing on the independent variable matrix, the dependent variable matrix, and the power consumption constraint condition corresponding to the i-th cabinet set through the least squares method to obtain the i-th fitting result.
7. Determining the accuracy of the i-th fitting result according to the method described in any one of claims 3-6, comprising: For any cabinet in the i-th cabinet set, determine the estimated power consumption of the cabinet according to the estimated device power consumption corresponding to each device type in the i-th fitting result and the device group information of at least one device group corresponding to the cabinet, and determine the ratio of the absolute value of the difference between the estimated power consumption of the cabinet and the historical power consumption of the cabinet to the historical power consumption of the cabinet as the estimated deviation degree corresponding to the cabinet; determine the accuracy of the i-th fitting result according to the estimated deviation degrees corresponding to each cabinet in the i-th cabinet set.
8. The method according to claim 7, determining the accuracy of the i-th fitting result according to the estimated deviation degrees corresponding to the cabinets in the i-th cabinet set, includes: If the estimated deviation degrees corresponding to each cabinet in the i-th cabinet set are respectively less than or equal to the first threshold, it is determined that the accuracy of the i-th fitting result is greater than or equal to the preset threshold; If there is a cabinet in the i-th cabinet set whose estimated deviation degree is greater than the first threshold, it is determined that the accuracy of the i-th fitting result is less than the preset threshold.
9. The method according to any one of claims 3-8, determining the device power consumption corresponding to each device type according to the i-th fitting result, including: For any one device type, obtain the estimated device power consumption corresponding to the device type in the i-th fitting result, and determine the estimated device power consumption as the device power consumption corresponding to the device type.
10. The method according to any one of claims 1-9, for any one of the cabinets in the computer room; performing grouping processing on the devices in the cabinet in the computer room to obtain at least one device group corresponding to the cabinet, including: Determine a plurality of preset device types and the standard device information corresponding to each device type; Obtain the device information of each device in the cabinet; For any one device in the cabinet, match the device information of the device with the standard device information corresponding to each device type to determine the device type corresponding to the device; Divide the devices with the same device type in the cabinet into one device group to obtain the at least one device group.
11. A device power consumption determination device, comprising: A grouping module, an obtaining module, and a determining module, wherein the grouping module is used to group the devices in each cabinet in the computer room to obtain at least one device group corresponding to each cabinet, and the device types of the devices in the device group are the same; the obtaining module is used to obtain the historical power consumption of each cabinet, and the historical power consumption is the sum of the power consumptions of the devices in the cabinet; the determining module is used to determine the device power consumption corresponding to each device type in the computer room according to the historical power consumption of each cabinet and the device group information of at least one device group corresponding to each cabinet, and the device group information includes device type and device quantity.
12. An electronic device, comprising: 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, and the instructions are executed by the at least one processor to cause the electronic device to perform the method according to any one of claims 1-10.
13. A computer-readable storage medium storing computer-executable instructions, when the processor executes the computer-executable instructions, implementing the method according to any one of claims 1-10.
14. A computer program product comprising a computer program, which when executed by a processor implements the method according to any one of claims 1-10.
Citation Information
Patent Citations
Method, device and equipment for predicting power consumption of equipment cluster
CN114238060A
Non-intrusive fine-grained power monitoring of datacenters
US20170322241A1