Energy consumption calculation method
By obtaining the configuration information of the computing device and utilizing the energy consumption data in compatible devices, the problems of poor flexibility and insufficient compatibility testing in the energy consumption calculation of computing devices are solved, achieving wider energy consumption calculation coverage and higher flexibility .
Patent Information
- Application Number
- CN202411526506.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-21
AI Technical Summary
The prior art has poor flexibility in computing power consumption calculations, and cannot effectively deal with components that have not undergone compatibility testing with computing devices, resulting in strong limitations in energy consumption calculations.
By obtaining configuration information of the computing device, including compatible and incompatible components, the total energy consumption data of the incompatible first component is used to replace the energy consumption data of the incompatible first component with the energy consumption data of the compatible second target computing device, thereby calculating the total energy consumption of the computing device. .
Improves the flexibility of computing power consumption calculations in computing devices, covers more computing devices in different configurations, and avoids the situation where components that have not undergone compatibility testing cannot calculate energy consumption.
Smart Images

Figure CN119493706A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an energy consumption calculation method. Background Art
[0002] Before delivery of computing equipment (such as servers, etc.), the energy consumption of the computing equipment needs to be estimated according to the configuration required by the customer. The energy consumption estimation result can be used as a reference for the power distribution of the computing equipment or the power supply of the computer room, so that the appropriate power supply can be selected for the computing equipment. At present, when selecting the configuration for computing equipment, it is usually selected by converging configuration options or by drop-down search options to select components compatible with the computing equipment. There are many restrictions on energy consumption calculation and poor flexibility. Summary of the invention
[0003] An embodiment of the present application discloses an energy consumption calculation method, which can reduce the limitations of energy consumption calculation of computing devices and avoid the situation where energy consumption cannot be calculated for components that have not been tested for compatibility with computing devices. This can cover energy consumption calculation of more computing devices with different configurations and improve the flexibility of energy consumption calculation.
[0004] The present application discloses an energy consumption calculation method, including:
[0005] Acquire configuration information corresponding to a first target computing device, the configuration information including component identifiers and component quantities corresponding to one or more components; the multiple components include a first component that has not been tested for compatibility with the first target computing device, and a second component that is compatible with the first target computing device;
[0006] acquiring, according to the component identifier corresponding to the first component, energy consumption data of the first component in a compatible second target computing device; the device model of the second target computing device is different from the device model of the first target computing device;
[0007] The energy consumption of the first target computing device is calculated based on the energy consumption data and the number of components corresponding to the first component and the energy consumption data and the number of components of the second component in the first target computing device.
[0008] In an embodiment of the present application, by obtaining configuration information corresponding to the first target computing device, the configuration information may include component identifiers and component quantities corresponding to multiple components, the multiple components include a first component that has not been tested for compatibility with the first target computing device, and a second component that is compatible with the first target computing device. According to the component identifier corresponding to the first component, the energy consumption data of the first component in the compatible second target computing device can be obtained, so that the energy consumption of the first target computing device can be calculated according to the energy consumption data and component quantity corresponding to the first component, and the energy consumption data and component quantity of the second component in the first target computing device. By implementing this embodiment, in the case where the first target computing device includes the first component that has not been tested for compatibility, the energy consumption data of the first component in the second target computing device can also be obtained as the energy consumption data corresponding to the first component, so as to calculate the energy consumption of the first target computing device, reduce the limitations of the energy consumption calculation of the computing device, avoid the situation where the energy consumption of the component that has not been tested for compatibility with the computing device cannot be calculated, so that the energy consumption calculation of more computing devices with different configurations can be covered, and the flexibility of the energy consumption calculation is improved.
[0009] In one embodiment, acquiring energy consumption data of the first component in a compatible second target computing device according to the component identifier corresponding to the first component includes:
[0010] If the first component belongs to the target energy consumption type, obtaining a motherboard identifier corresponding to a motherboard included in the first target computing device; wherein the target energy consumption type is used to indicate that the difference in energy consumption data of the first component in computing devices of different device models is greater than a difference threshold;
[0011] According to the component identification corresponding to the first component and the mainboard identification, energy consumption data of the first component in a compatible second target computing device is queried; the second target computing device includes the first component and the mainboard.
[0012] By implementing this embodiment, when the first component belongs to the target energy consumption type, such as CPU, memory and other components, the electronic device can determine the motherboard identifier corresponding to the motherboard included in the first target computing device to select the computing device including the first component and the motherboard as the second target computing device, and use the energy consumption data of the first component in the second target computing device as the energy consumption data corresponding to the first component, thereby improving the accuracy of the energy consumption data corresponding to the first component.
[0013] In one embodiment, acquiring energy consumption data of the first component in a compatible second target computing device according to the component identifier corresponding to the first component includes:
[0014] If the first component does not belong to the target energy consumption type, then according to the component identifier corresponding to the first component, the energy consumption data of the first component in a compatible second target computing device is queried; the second target computing device includes the first component; the target energy consumption type is used to indicate that the difference in energy consumption data of the first component in computing devices of different device models is greater than a difference threshold.
[0015] By implementing this embodiment, for a first component that does not belong to the target energy consumption type, the energy consumption data of the first component in any second target computing device that includes the first component can be queried, which can improve the efficiency of obtaining the energy consumption data corresponding to the first component.
[0016] In one embodiment, after acquiring the configuration information corresponding to the first target computing device, the method further includes:
[0017] According to the component identifier corresponding to each of the components, it is determined that each of the components is the first component or the second component.
[0018] By implementing this embodiment, the electronic device can also determine whether each component is the first component or the second component based on the component identifier corresponding to each component, and then use different energy consumption acquisition strategies to respectively obtain energy consumption data corresponding to the first component that has not been tested for compatibility with the first target computing device and energy consumption data corresponding to the second component that is compatible with the first target computing device, thereby improving the accuracy of energy consumption calculation of the first target computing device.
[0019] In one embodiment, determining whether each of the components is the first component or the second component according to the component identifier corresponding to each of the components includes:
[0020] According to the component identifier corresponding to the third component, acquiring the component type of the third component; the third component is any component among the multiple components;
[0021] In a compatible file corresponding to the component type of the third component, querying whether the third component is the first component or the second component according to the component identifier corresponding to the third component and the device model of the first target computing device;
[0022] Among them, the compatibility file includes one or more groups of compatibility information, each group of compatibility information includes a component identification, a device model and a compatibility result corresponding to the component type, and the compatibility result is used to indicate whether the component corresponding to the component identification is compatible in the computing device corresponding to the device model.
[0023] By implementing this embodiment, the complexity of compatible files can be reduced and the query speed of compatible types can be accelerated.
[0024] In one embodiment, the component identification includes a component code; and determining, according to the component identification corresponding to each of the components, whether each of the components is the first component or the second component includes:
[0025] Decoding a component code corresponding to a third component according to a first decoding rule to obtain a first decoding result corresponding to the third component; the third component is any one of the multiple components;
[0026] querying, according to the first decoding result corresponding to the third component, whether the third component is the first component or the second component;
[0027] If the query fails, the component code corresponding to the third component is decoded according to a second decoding rule to obtain a second decoding result corresponding to the third component; the complexity of the second decoding rule is lower than the complexity of the first decoding rule;
[0028] According to the second decoding result corresponding to the third component, it is queried whether the third component is the first component or the second component.
[0029] By implementing this embodiment, the electronic device can decode the component code corresponding to the third component according to the first decoding rule to obtain the first decoding result corresponding to the third component, thereby querying whether the third component is the first component or the second component based on the first decoding result of the third component. If the query fails, the component code corresponding to the third component is decoded according to the second decoding rule to obtain the second decoding result corresponding to the third component, thereby querying whether the third component is the first component or the second component based on the second decoding result corresponding to the third component. By first using a decoding rule with high complexity for decoding, the accuracy and credibility of the decoding result can be improved, and the multiple decoding method also increases the probability of successfully decoding the component code, thereby avoiding the electronic device from being unable to recognize the component code input by the user, and improving the convenience of energy consumption calculation.
[0030] In one embodiment, the first decoding rule includes a decoding rule corresponding to an extended code, the second decoding rule includes a decoding rule corresponding to an original code, and the extended code is obtained by expanding the original code.
[0031] In one embodiment, the method further comprises:
[0032] In a case where a component included in the first target computing device needs to be compatible with the first target computing device, acquiring energy consumption data corresponding to a second component compatible with the first target computing device;
[0033] The energy consumption of the first target computing device is calculated according to the energy consumption data corresponding to the second component and the corresponding number of components.
[0034] By implementing this embodiment, the first component that has not been tested for compatibility with the first target computing device may not be included in the energy consumption calculation process of the first target computing device, thereby improving the efficiency of energy consumption calculation.
[0035] In one embodiment, the method further comprises:
[0036] Displaying an energy consumption calculation interface, wherein the energy consumption calculation interface includes compatible controls and incompatible controls;
[0037] In response to a trigger operation on the compatible control, it is determined that components included in the first target computing device need to satisfy compatibility with the first target computing device; or, in response to a trigger operation on the incompatible control, it is determined that components included in the first target computing device do not need to satisfy compatibility with the first target computing device.
[0038] By implementing this embodiment, it is flexibly determined according to user needs whether the components included in the first target computing device need to be compatible with the first target computing device, thereby improving the flexibility of calculating the energy consumption of the first target computing device.
[0039] In one embodiment, obtaining configuration information corresponding to the first target computing device includes:
[0040] Display the energy consumption calculation interface;
[0041] In response to a device configuration input operation for the energy consumption calculation interface, receiving an imported configuration file corresponding to a first target computing device, or receiving an input configuration text corresponding to the first target computing device;
[0042] The configuration file or the configuration text is parsed according to a preset rule to obtain component identifiers and component quantities corresponding to the multiple components.
[0043] When this embodiment is implemented, when the same component identifier exists in the configuration file and the configuration text, data fusion can be performed through the first fusion rule and / or the second fusion rule; when different component identifiers exist in the configuration file and the configuration text, data fusion can be performed through the third fusion rule, thereby improving the accuracy of the configuration information corresponding to the first target computing device, and the user can input the configuration information in multiple ways at the same time, further improving the efficiency of inputting the configuration information.
[0044] The embodiment of the present application discloses an energy consumption calculation device, including:
[0045] a configuration information acquisition module, configured to acquire configuration information corresponding to a first target computing device, the configuration information including component identifiers and component quantities corresponding to a plurality of components; the plurality of components including a first component that has not been tested for compatibility with the first target computing device, and a second component that is compatible with the first target computing device;
[0046] an energy consumption data acquisition module, configured to acquire energy consumption data of the first component in a compatible second target computing device according to a component identifier corresponding to the first component; the device model of the second target computing device is different from the device model of the first target computing device;
[0047] The device energy consumption calculation module is used to calculate the energy consumption of the first target computing device based on the energy consumption data and the number of components corresponding to the first component, and the energy consumption data and the number of components of the second component in the first target computing device.
[0048] The present application discloses an electronic device, including:
[0049] A memory storing executable program code;
[0050] a processor coupled to the memory;
[0051] The processor calls the executable program code stored in the memory to execute the method described in any one of the above embodiments.
[0052] An embodiment of the present application discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the method described in any one of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1-A It is a schematic diagram of an application scenario of an energy consumption calculation method disclosed in an embodiment of the present application;
[0055] Figure 1-B It is a schematic diagram of an application scenario of another energy consumption calculation method disclosed in an embodiment of the present application;
[0056] Figure 2 It is a structural diagram of a server disclosed in an embodiment of the present application;
[0057] Figure 3 It is a flow chart of an energy consumption calculation method disclosed in an embodiment of the present application;
[0058] Figure 4-A It is a flowchart of another energy consumption calculation method disclosed in an embodiment of the present application;
[0059] Figure 4-B It is a flowchart of a method for an electronic device to obtain energy consumption data of a first component in a compatible second target device disclosed in an embodiment of the present application;
[0060] Figure 5-A It is a schematic diagram of an energy consumption calculation interface disclosed in an embodiment of the present application;
[0061] Figure 5-B It is a schematic diagram of another energy consumption calculation interface disclosed in an embodiment of the present application;
[0062] Figure 5-C This is a schematic diagram of another energy consumption calculation interface disclosed in an embodiment of the present application;
[0063] Figure 5-D It is a schematic diagram of another energy consumption calculation interface disclosed in the embodiment of the present application;
[0064] Figure 6 It is a flowchart of a method for an electronic device to determine whether each component is connected to a first target computing device disclosed in an embodiment of the present application;
[0065] Figure 7-A It is a flowchart of another energy consumption calculation method disclosed in the embodiment of the present application;
[0066] Figure 7-B It is a schematic diagram of another energy consumption calculation interface disclosed in an embodiment of the present application;
[0067] Figure 8-A It is a flow chart of a method for calculating energy consumption of a server disclosed in an embodiment of the present application;
[0068] Figure 8-B It is a schematic diagram of an interface for an energy consumption calculation interface for a server disclosed in an embodiment of the present application;
[0069] Fig. 9 It is a modular schematic diagram of an energy consumption calculation device disclosed in an embodiment of the present application;
[0070] Fig.10 It is a structural block diagram of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0071] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0072] It should be noted that the terms "including" and "having" in the embodiments of the present application and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0073] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first target computing device may be referred to as a second target computing device, and similarly, a second target computing device may be referred to as a first target computing device. Both the first target computing device and the second target computing device are target computing devices, but they are not the same target computing device.
[0074] An embodiment of the present application discloses an energy consumption calculation method, which can reduce the limitations of energy consumption calculation of computing devices and avoid the situation where energy consumption cannot be calculated for components that have not been tested for compatibility with computing devices. This can cover energy consumption calculation of more computing devices with different configurations and improve the flexibility of energy consumption calculation.
[0075] like Figure 1-A As shown, Figure 1-A This is a schematic diagram of an application scenario of an energy consumption calculation method disclosed in an embodiment of the present application. The application scenario may include an electronic device 210, which may include but is not limited to mobile phones, tablet computers, wearable devices, laptops, PCs (Personal Computers), and other terminal devices.
[0076] The electronic device 210 may be used to provide selection or configuration input of a computing device and an energy consumption calculation function. The computing device may include but is not limited to a server, etc.
[0077] In one embodiment, the electronic device 210 can obtain configuration information corresponding to the first target computing device, the configuration information including component identifiers and component quantities corresponding to multiple components. When the components included in the first target computing device do not need to be compatible with the first target computing device, the electronic device 210 can obtain energy consumption data of the first component in a compatible second target computing device based on the component identifier corresponding to the first component. The device model of the second target computing device is different from the device model of the first target computing device. The electronic device 210 can then calculate the energy consumption of the first target computing device based on the energy consumption data and component quantity corresponding to the first component, and the energy consumption data and component quantity of the second component in the first target computing device.
[0078] Since the second component is compatible with the first target computing device, the electronic device 210 can query the energy consumption data of the second component in the first target computing device from the energy consumption database, but the first component and the first target computing device have not been tested for compatibility, and the electronic device 210 cannot query the energy consumption data of the first component in the first target computing device from the energy consumption database, so it is necessary to obtain the energy consumption data of the first component in the compatible second target computing device.
[0079] It should be understood that the energy consumption database only stores the energy consumption data of the component in the compatible computing device, and no compatibility test has been performed between the first component and the first target computing device, that is, the energy consumption database does not include the energy consumption data of the first component in the first target computing device. In actual scenarios, the compatibility test between the first component and the first target computing device may not have been performed due to factors such as time, manpower, and resources, resulting in the energy consumption database not including the energy consumption data of the first component in the first target computing device. In order to calculate the energy consumption of the first target computing device containing the first component, the embodiment of the present application can obtain the energy consumption data of the first component in the compatible second target computing device, thereby replacing the energy consumption data of the first component in the first target computing device to calculate the energy consumption of the first target computing device.
[0080] like Figure 1-B As shown, Figure 1-B It is a schematic diagram of an application scenario of another energy consumption calculation method disclosed in an embodiment of the present application. The application scenario may include an electronic device 210 and a server 220 that is communicatively connected to the electronic device 210. The server 220 may store component information of each component in a database. The component information may include but is not limited to basic information, energy consumption information, compatibility information, etc. The electronic device 210 may obtain the component information of each component from the server 220 based on the configuration information corresponding to the first target computing device.
[0081] For example, Figure 2 As shown, Figure 2It is a structural diagram of a server disclosed in an embodiment of the present application. The energy consumption calculation method provided in the embodiment of the present application can be applied to the energy consumption calculation scenario of the server 230. The components that need to be configured in the server 230 may include but are not limited to BIOS (Basic Input Output System) chips, CPU (Central Processing Unit), memory cards, hard disks, graphics cards, RAID (Redundant Array of Independent Disks) cards and other types of components.
[0082] Among them, the BIOS chip is used to perform hardware initialization and operating system booting at startup; the CPU is the core computing unit that executes instructions and processes data; the memory card is used to temporarily store data and instructions in use; the hard disk is used to store infrequently used data and applications; the graphics card is responsible for graphics processing and image rendering; the RAID card is used to manage the RAID array of the hard disk to provide data redundancy and performance improvement.
[0083] like Figure 3 As shown, Figure 3 : is a flow chart of an energy consumption calculation method disclosed in an embodiment of the present application. The energy consumption calculation method can be applied to the electronic device in the above embodiment. The energy consumption calculation method may include the following steps:
[0084] Step 310: Obtain configuration information corresponding to the first target computing device, where the configuration information includes component identifiers and component quantities corresponding to a plurality of components.
[0085] The first target computing device may refer to a target computing device that needs to perform energy consumption calculation, such as a device configured by a customer according to his or her own needs, or a device configured by a developer during the development process. Figure 2 As shown in , the first target computing device is composed of multiple components, and the components are components in the first target computing device, which refer to the basic components that constitute the first target computing device. The energy consumption data of each component together constitute the energy consumption data of the first target computing device. Therefore, when it is necessary to calculate the energy consumption of the first target computing device, it is necessary to first obtain the configuration information corresponding to the first target computing device, and then estimate the energy consumption data of the first target computing device through the configuration information of the first target computing device and the energy consumption data of each component in the configuration information.
[0086] In some embodiments, the electronic device may obtain the device model of the first target computing device input by the user and the configuration information corresponding to the first target computing device. The device model may refer to a character or name that identifies the specifications and functions of the computing device. For example, if the first target computing device is a server, the server model may refer to an identifier that describes the specifications and technical characteristics of the server. The device model may also refer only to the name of the target computing device, without limitation. The configuration information corresponding to the first target computing device may refer to information used to describe the specific configuration of the first target computing device. The user may input the configuration information corresponding to the first target computing device according to the configuration actually required.
[0087] Optionally, the electronic device may detect the configuration information corresponding to the first target computing device input by the user, or may receive the configuration information corresponding to the first target computing device sent by other devices connected to the electronic device. The embodiment of the present application does not limit the manner in which the electronic device obtains the configuration information corresponding to the first target computing device, and does not limit the content contained in the configuration information, that is, it does not limit whether the various components included in the configuration information are compatible with the first target computing device.
[0088] The configuration information corresponding to the first target computing device may include component identifications and component quantities corresponding to multiple components. The component identification may refer to a specific identifier of a component, which is used to identify a specific component. The component identification may include but is not limited to a component code, a character string, a number, etc. In the case where the component information of the component is different, different component identifications may correspond. Optionally, the component information may include one or more of component model, component specification, manufacturer, production batch, etc. The number of components may refer to the number of components in the first target computing device. The number of components corresponding to the components with the same component identification in the first target computing device is not limited, and may be 1, or 2 or more.
[0089] Among them, the multiple components include a first component that has not been tested for compatibility with the first target computing device and a second component that is compatible with the first target computing device. In one embodiment, the electronic device can first determine whether each component is the first component or the second component based on the component identifier corresponding to each component.
[0090] It is understandable that, although the first target computing device is newly developed, the various components are actually existing components, and the device model of the first target computing device is also an actually existing device model. Before the computing device is developed, the component testing engineer will test whether the computing devices of various device models are compatible with the various components, and sort out the data to obtain a compatible file. Therefore, the electronic device can determine whether each component is the first component or the second component based on the compatible file and the component identifier corresponding to each component included in the configuration information corresponding to the first target computing device.
[0091] Step 320: Obtain energy consumption data of the first component in a compatible second target computing device according to the component identifier corresponding to the first component.
[0092] When the component test engineer determines that a component is compatible with a computing device, that is, the component can be used normally on the computing device, the component test engineer will continue to measure the energy consumption data of the component in the compatible computing device and save it in the energy consumption database corresponding to the computing device. When the component test engineer determines that another component is incompatible with the computing device, that is, the component cannot be used normally on the computing device, the component test engineer will not or cannot continue to measure the energy consumption data of the other component in the incompatible computing device, so the energy consumption data of the component incompatible with the first target computing device is missing in the energy consumption database corresponding to the computing device. It is understandable that when the component test engineer does not perform compatibility testing of the component with the computing device, the energy consumption data of the component that has not been tested for compatibility with the first target computing device will also be missing in the energy consumption database corresponding to the computing device.
[0093] Therefore, whether the component has been tested for compatibility with the first target computing device and whether it is compatible with the first target computing device determines whether the component can obtain energy consumption data in the energy consumption database corresponding to the first target computing device. When the component is a first component that has not been tested for compatibility with the first target computing device, the electronic device can obtain energy consumption data of the first component in a compatible second target computing device. That is, the electronic device needs to use different energy consumption acquisition strategies to respectively obtain energy consumption data corresponding to the first component and the second component.
[0094] For a first component that has not been tested for compatibility with a first target computing device, the energy consumption database corresponding to the first target computing device does not contain the energy consumption data of the first component in the first target computing device, and the electronic device needs to obtain the energy consumption data of the first component in the second target computing device as the energy consumption data corresponding to the first component. For a second component that is compatible with the first target device, the energy consumption database corresponding to the first target computing device contains the energy consumption data corresponding to the second component, and the electronic device can obtain the energy consumption data corresponding to the second component from the energy consumption database.
[0095] Step 330, calculating the energy consumption of the first target computing device according to the energy consumption data and the number of components corresponding to the first components, and the energy consumption data and the number of components of the second component in the first target computing device.
[0096] Optionally, the electronic device may calculate the energy consumption corresponding to each component based on the energy consumption data corresponding to each component and the number of components, and then add up the energy consumption corresponding to each component to obtain the energy consumption of the first target computing device.
[0097] The energy consumption of the first target computing device may include multiple energy consumption information. Exemplarily, when the first target computing device is a server, the multiple energy consumption information of the server may include but is not limited to input current, input voltage, input power, load power, idle input power, typical power, maximum input power, limit input power, system heat consumption, carbon dioxide emissions, etc.
[0098] Among them, input current refers to the current input by the power supply to the first target computing device, input voltage refers to the voltage supplied by the power supply to the first target computing device, input power refers to the power absorbed by the server, Idle input power refers to the power consumed by the server when the server is idle and the CPU enters deep sleep state, Max input power refers to the power consumed by the server when all components of the server are under full load pressure, limit input power refers to the power consumed by the server when all components of the server are under full load pressure and the fan is running at full speed, system heat consumption refers to the energy consumed in the energy conversion process due to the existence of temperature difference, and carbon dioxide emissions refer to the carbon dioxide emissions caused by energy consumption of the server.
[0099] In an embodiment of the present application, by obtaining configuration information corresponding to the first target computing device, the configuration information may include component identifiers and component quantities corresponding to multiple components, and the multiple components include a first component that has not been tested for compatibility with the first target computing device and a second component that is compatible with the first target computing device. According to the component identifier corresponding to the first component, the energy consumption data of the first component in the compatible second target computing device can be obtained, so that the energy consumption of the first target computing device can be calculated according to the energy consumption data and component quantity corresponding to the first component, and the energy consumption data and component quantity of the second component in the first target computing device. By implementing this embodiment, in the case where the first target computing device includes the first component that has not been tested for compatibility, the energy consumption data of the first component in the second target computing device can also be obtained as the energy consumption data corresponding to the first component, so as to calculate the energy consumption of the first target computing device, reduce the limitations of the energy consumption calculation of the computing device, avoid the situation where the energy consumption of the component that has not been tested for compatibility with the computing device cannot be calculated, so that the energy consumption calculation of more computing devices with different configurations can be covered, and the flexibility of the energy consumption calculation is improved.
[0100] like Figure 4-A As shown, Figure 4-A : is a flow chart of another energy consumption calculation method disclosed in an embodiment of the present application. The energy consumption calculation method can be applied to the electronic device in the above embodiment. The energy consumption calculation method may include the following steps:
[0101] Step 410: Obtain configuration information corresponding to the first target computing device, where the configuration information includes component identifiers and component quantities corresponding to a plurality of components.
[0102] Since there is no method for estimating energy consumption of components that have not been tested for compatibility in the relevant technology, the relevant technology needs to restrict users when inputting configuration information, so that users can only select device configurations within a specific framework. For example, when selecting configuration information for a server, only chips that are compatible with the server can be selected, and chips that have not been tested for compatibility with the server cannot be selected. This may result in users being unable to obtain the desired device or the energy consumption data corresponding to the device.
[0103] In the case of device development and response to customer needs, the configuration information of the newly developed computing device may contain components that have not been tested for compatibility. For example, the compatibility test engineer may not promptly perform compatibility testing on the component in the computing device. If there are components that have not been tested for compatibility, it will lead to the inability to estimate the energy consumption of the computing device. Therefore, the configuration information corresponding to the first target computing device obtained in the embodiment of the present application may include the first component of the first target computing device that has not been tested for compatibility, and may also include the second component that is compatible with the first target computing device, without limitation, thereby helping users to quickly and accurately estimate the energy consumption of devices corresponding to various configuration information.
[0104] In one embodiment, the electronic device may include a display device, which may display an energy consumption calculation interface through the display device, and in response to a device configuration input operation for the energy consumption calculation interface, receive an imported configuration file corresponding to a first target computing device, or receive an input configuration text corresponding to the first target computing device, and then parse the configuration file or configuration text according to preset rules to obtain component identifiers and component quantities corresponding to multiple components.
[0105] The energy consumption calculation interface may refer to an interface for providing a user with input of configuration information of a first target computing device and performing energy consumption calculation on the first target computing device, which may help the user to more quickly and accurately perform energy consumption evaluation calculations on target computing devices under various configurations.
[0106] In some embodiments, the energy consumption calculation interface may include a configuration input control, which may include but is not limited to an input box, a selection box, an input button, etc., and the user may perform a configuration input operation on the configuration input control. Optionally, the configuration input control in the energy consumption calculation interface may be controlled by touch, voice, gesture, etc., without limitation.
[0107] As an implementation, the configuration input operation may include a file import operation. The user may store the configuration information corresponding to the first target computing device in a configuration file in advance, and the configuration file may include a configuration list, a configuration table, etc. The configuration input control may also include a file import control, and the user may trigger the file import control in the energy consumption calculation interface to upload and import the configuration file. The electronic device receives the imported configuration file corresponding to the first target computing device in response to the file import operation on the file import control.
[0108] When a file import operation is detected for a file import control, the electronic device may display a file selection interface, which may include multiple files, and when a selection operation is detected for a target file, the target file may be received as a configuration file corresponding to the first target computing device.
[0109] As another implementation, the configuration input operation may include a text input operation, and the configuration input control may also include a text input box. The user may input configuration information corresponding to the first target computing device into the text input box in advance, and the electronic device receives the input configuration text corresponding to the first target computing device in response to the text input operation on the text input box.
[0110] For example, Figure 5-A As shown, Figure 5-A 5 is a schematic diagram of an energy consumption calculation interface disclosed in an embodiment of the present application. The energy consumption calculation interface may include a model selection control 501, a file import control 502, and a text input box 503. The file import control 502 is the file import control in the above embodiment, and the text input box 503 is the text input box in the above embodiment.
[0111] Before acquiring the configuration information corresponding to the first target computing device, the electronic device may detect a selection operation on the model selection control 501, and in response to the selection operation, determine the device model corresponding to the first target computing device, such as Figure 5-A Taking the energy consumption calculation interface of the server as an example, the device model corresponding to the server is V100.
[0112] For the received configuration file or configuration text, the electronic device can parse the configuration file or configuration text according to the preset rules to obtain the component identification and component quantity corresponding to the multiple components. Among them, the preset rules may refer to the processing rules followed by the electronic device when parsing the configuration file or configuration text corresponding to the first target computing device. In the case where the received configuration file is a form file, the preset rules may be to extract the data of the target row and / or target column in the form file. In the case of receiving a configuration text, the preset rules may be to divide the text and determine that each divided character string is the component identification or component quantity corresponding to each component. It can be understood that the configuration files or configuration texts input by the user are arranged according to the preset rules.
[0113] In this embodiment, compared with the method in the related art that is unable to select components that have not been tested for compatibility with the first target computing device, the embodiment of the present application does not restrict user input. Users can make faster and freer component selections on the energy consumption calculation interface, thereby improving the efficiency of configuration information input and expanding the range of calculable configurations.
[0114] As an optional implementation, the electronic device can simultaneously receive a configuration file and a corresponding configuration text corresponding to the first target computing device, and parse them to obtain a first parsing result corresponding to the configuration file and a second parsing result corresponding to the configuration text, respectively, the first parsing result includes component identifiers and component quantities corresponding to multiple components in the configuration file, the second parsing result includes component identifiers and component quantities corresponding to multiple components in the configuration text, and the first parsing result and the second parsing result are fused according to a preset fusion rule to obtain configuration information corresponding to the first target computing device. Optionally, the configuration file can include files such as Excel spreadsheets, and the configuration text refers to text entered by the user.
[0115] Optionally, the preset fusion rule may include one or more of the first fusion rule, the second fusion rule and the third fusion rule. It should be understood that the preset fusion rule may be preset by the user according to habit. For example, the user may find it too troublesome to modify the configuration file, so after importing the configuration file, the user enters the configuration text to modify the number of components of a certain component.
[0116] The first fusion rule is fused in the order of priority of the first parsing result and the second parsing result. If there is a first component identifier, both the first parsing result and the second parsing result include the first component identifier, and the number of components corresponding to the first component identifier in the first parsing result and the second parsing result are different, for example, after the user imports the configuration file, he wants to enter the configuration text again to modify the number of components corresponding to the first component identifier, then the electronic device can determine the priority of the first parsing result and the priority of the second parsing result, and extract the number of components corresponding to the first component identifier from the parsing result with a higher priority, add it to the configuration information corresponding to the first target device target computing device, and ignore the number of components corresponding to the first component identifier in the parsing result with a lower priority. The second fusion rule is fused according to the upper limit of the configuration quantity of the first target computing device, and the upper limit of the configuration quantity refers to the maximum number of components that can be assembled on the first target computing device. If there is a second component identifier, both the first parsing result and the second parsing result include the second component identifier. For example, after importing the configuration file, the user wants to enter the configuration text again to increase the number of components corresponding to the first component identifier. The electronic device can obtain the upper limit of the configuration quantity of the components corresponding to the second component identifier of the first target computing device. If the sum of the number of components corresponding to the second component identifier in the first parsing result and the second parsing result is less than the upper limit of the configuration quantity, the sum of the number of components corresponding to the component identifier is added to the configuration information corresponding to the first target computing device. If the sum of the number of components corresponding to the second component identifier in the first parsing result and the second parsing result is not less than the upper limit of the configuration quantity, the number of components corresponding to the component identifier in any parsing result is added to the configuration information corresponding to the first target computing device.
[0117] The third fusion rule is a rule that adds different components in the first parsing result and the second parsing result to the configuration information corresponding to the first target computing device according to the user's confirmation information. If there is a third component identifier, one parsing result includes the third component identifier, and the other parsing result does not include the third component identifier. For example, after the user imports the configuration file, he wants to enter the configuration text again to add a new third component identifier. Then the electronic device can output a prompt message, which is used to prompt the user to determine whether the component corresponding to the third component identifier belongs to the first target computing device. If it is confirmed that the component corresponding to the third component identifier belongs to the first target computing device, the third component identifier and the number of components corresponding to the third component identifier are added to the configuration information corresponding to the first target computing device. If it is confirmed that the component corresponding to the third component identifier does not belong to the first target computing device, the third component identifier and the number of components corresponding to the third component identifier are ignored.
[0118] When this embodiment is implemented, when the same component identifier exists in the configuration file and the configuration text, data fusion can be performed through the first fusion rule and / or the second fusion rule; when different component identifiers exist in the configuration file and the configuration text, data fusion can be performed through the third fusion rule, thereby improving the accuracy of the configuration information corresponding to the first target computing device, and the user can input the configuration information in multiple ways at the same time, further improving the efficiency of inputting the configuration information.
[0119] As an optional implementation, the embodiment of the present application can also display component options containing component keywords by pulling down the search option, but compared with the related art, the embodiment of the present application does not limit whether the component corresponding to the component option is compatible with the first target computing device. Even if the component has not been tested for compatibility with the first target computing device, it can also be displayed as a component option in the display box. That is, the energy consumption calculation interface can also include a search box, and the electronic device can detect the keyword of the component entered in the search box and display multiple third component options containing the keyword of the component. When a selection operation for the target component option is detected, a quantity selection control for the target component option is displayed, so that the user can enter the number of components of the target component option through the quantity selection control, thereby adding the component identification and the number of components corresponding to the target component option to the configuration information corresponding to the first target computing device. By implementing this implementation, even if the user is not familiar with the full name of the component, it can be retrieved by the keyword of the component, which reduces the difficulty of inputting configuration information and improves efficiency.
[0120] For example, Figure 5-B As shown, Figure 5-B This is a schematic diagram of another energy consumption calculation interface disclosed in an embodiment of the present application. The energy consumption calculation interface also includes a first input control 504 and a second input control 505 corresponding to the component input method. The first input control 504 and the second input control 505 are mutually exclusive controls, that is, the user cannot perform selection operations on the first input control 504 and the second input control at the same time. When a selection operation is detected for the first input control 504, the electronic device can implement user input by means of a drop-down search option, that is, the electronic device can display a search box in the energy consumption calculation interface for the user to enter a keyword for the component. Figure 5-B As shown in , when a selection operation on the second input control 505 is detected, the electronic device can display a file import control 502 and a text input box 503 on the energy consumption calculation interface for the user to import a configuration file or input a configuration text.
[0121] Step 420: Determine whether each component is a first component or a second component according to the component identifier corresponding to each component.
[0122] It is understandable that in order to avoid the compatibility file being too large and to avoid the slow speed of querying whether a component is compatible with the computing device in the compatibility file, the compatibility file can be classified and multiple components can be saved separately in multiple compatibility files. Therefore, the electronic device can first determine the compatible file corresponding to each component, and then determine whether each component is the first component or the second component in the corresponding compatible file according to the component identifier corresponding to each component.
[0123] Taking the third component as an example, the third component is any one of the multiple components. In one embodiment, the electronic device can obtain the component type of the third component according to the component identifier corresponding to the third component, and in the compatible file corresponding to the component type of the third component, query whether the third component is the first component or the second component according to the component identifier corresponding to the third component and the device model of the first target computing device.
[0124] Among them, the component type refers to the type to which the component belongs. The compatibility file corresponding to the component type includes one or more groups of compatibility information, and each group of compatibility information includes the component identifier, device model and compatibility result of the corresponding component type. The component identifier of the corresponding component type refers to the component identifier corresponding to the component belonging to the component type. For example, if the component type is a memory card, the component identifier corresponding to the memory card refers to the component identifier corresponding to a certain memory card. The device model refers to the model of the computing device that has been tested for compatibility with the component. The compatibility result is used to indicate whether the component corresponding to the component identifier has been tested for compatibility with the computing device of the corresponding model, and whether it is compatible in the computing device of the corresponding model.
[0125] For example, a group of compatibility information includes a component identifier corresponding to a certain memory card, a server model, and a compatibility result. The compatibility result is used to indicate whether the memory card is compatible with the server of this model. If the compatibility result is 0, it indicates that the memory card has been tested for compatibility with the server of this model and is incompatible with the server of this model. If the compatibility result is 1, it indicates that the memory card has been tested for compatibility with the server of this model and is compatible with the server of this model, that is, the memory card is the second component. If the compatibility result is empty, it can be indicated that the memory card has not been tested for compatibility with the server of this model, that is, the memory card is the first component.
[0126] Continuing to use the example that the component type of the third component is a memory card to explain the entire query process, the electronic device can, after obtaining that the component type of the third component is a memory card based on the component identifier corresponding to the third component, determine the component identifier corresponding to the third component and the target compatibility information corresponding to the device model of the first target computing device from one or more sets of compatibility information in the compatibility file corresponding to the memory card, and determine whether the third component is the first component or the second component based on the compatibility result included in the target compatibility information.
[0127] By implementing this embodiment, the complexity of the compatible file can be reduced, and the speed of querying whether a component is compatible with a computing device can be accelerated.
[0128] As an optional implementation, compatible files may also be classified according to device types. The electronic device may determine the compatible files corresponding to the device model according to the device model of the first target computing device. The compatible files corresponding to the device model may include multiple component identifiers and compatibility results of whether the components corresponding to each component identifier are compatible with the first target computing device. The component identifiers may correspond to any component type. The electronic device may query whether the third component is the first component or the second component in the compatible file corresponding to the device model according to the component identifier corresponding to the third component. Implementing this implementation may improve the diversity of compatible file classification.
[0129] Step 430: Obtain energy consumption data of the second component in the first target device.
[0130] It should be understood that, regardless of whether the components included in the first target computing device need to be compatible with the first target computing device, when calculating the energy consumption of the first target device, the energy consumption data of the second component in the first target device must always be included in the calculation, wherein the second component is compatible with the first target device. The electronic device can determine the energy consumption database corresponding to the first target computing device according to the device model corresponding to the first target computing device, and then query the energy consumption data of the second component in the first target computing device according to the component identifier corresponding to the second component in the energy consumption database corresponding to the first target computing device as the energy consumption data corresponding to the second component. Among them, the energy consumption database corresponding to the first target computing device includes the component identifiers corresponding to the components compatible with the first target computing device and the energy consumption data in the first target computing device. When the second component is compatible with the first target computing device, the energy consumption data corresponding to the second component can be directly obtained, which improves the efficiency of obtaining energy consumption data.
[0131] In one embodiment, when the components included in the first target computing device need to meet the compatibility requirements with the first target computing device, that is, the user does not need the energy consumption data of the first component in the first target computing device, the electronic device can obtain the energy consumption data corresponding to the second component compatible with the first target computing device, and calculate the energy consumption of the first target computing device according to the energy consumption data corresponding to the second component and the corresponding number of components. By implementing this embodiment, the first component that has not been tested for compatibility with the first target computing device can be excluded from the energy consumption calculation process of the first target computing device, thereby improving the efficiency of energy consumption calculation.
[0132] Step 440 , when the components included in the first target computing device do not need to be compatible with the first target computing device, energy consumption data of the first component in the compatible second target computing device is obtained according to the component identifier corresponding to the first component.
[0133] In the case where the components included in the first target computing device do not need to meet the compatibility requirements with the first target computing device, it means that when calculating the energy consumption of the first target computing device, it is necessary to include the energy consumption data corresponding to the first component that has not been tested for compatibility with the first target computing device in the calculation, but the component identifier corresponding to the first component does not exist in the energy consumption database corresponding to the first target computing device. Therefore, the electronic device can, based on the component identifier corresponding to the first component, query the energy consumption database containing the component identifier corresponding to the first component in energy consumption databases corresponding to other computing devices that are compatible with the first component, that is, the energy consumption database corresponding to the second target computing device that contains the first component and has a different device model from the first target device, so that the energy consumption data of the first component in the second target computing device can be queried in the energy consumption database corresponding to the second target computing device as the energy consumption data corresponding to the first component.
[0134] It is understandable that for a first component that has not been tested for compatibility with a first target computing device, if the accuracy of the energy consumption data corresponding to the first component needs to be ensured, a suitable second target computing device needs to be selected. The degree of correlation between the energy consumption data of the first component and the device model can determine the selection method of the second target computing device. If the energy consumption data of the first component has a high degree of correlation with the computing device model, it means that the energy consumption data of the first component in the first target computing device may differ greatly from the energy consumption data in computing devices of other device models. If the energy consumption data of the first component has a low degree of correlation with the device model, it means that the energy consumption data of the first component in the first target computing device may differ less from the energy consumption data in computing devices of other models.
[0135] Therefore, in one embodiment, for a first component that has not been tested for compatibility with a first target computing device, if the first component belongs to a target energy consumption type, the electronic device can obtain a motherboard identifier corresponding to a motherboard included in the first target computing device, and query the energy consumption data of the first component in a compatible second target computing device based on the component identifier and the motherboard identifier of the first component; the second target computing device includes the first component and the motherboard.
[0136] Among them, the electronic device can determine whether the first component belongs to the target energy consumption type, and the target energy consumption type is used to indicate that the difference in energy consumption data of the first component in devices of different device models is greater than a difference threshold. When the first component belongs to the target energy consumption type, the energy consumption data of the first component is highly correlated with the device model, and the electronic device cannot use any device containing the first component as the second target computing device. The electronic device can obtain the motherboard identifier corresponding to the motherboard included in the first target computing device and use the computing device containing the first component and the motherboard as the second target computing device.
[0137] It should be understood that the motherboard is the core component of the computing device, and generally speaking, the energy consumption data of a component in the computing device with the same motherboard is similar. As described in the above embodiment, the first component and the first target computing device have not been tested for compatibility, but the energy consumption of the first target computing device needs to be estimated first. At this time, the motherboard containing the first target computing device and the second target computing device of the first component can be found, and the energy consumption data of the first component in the compatible second target computing device can be obtained to realize the reuse of energy consumption data, avoid the inability to estimate the energy consumption data of the first component that can actually run in the first target computing device due to untimely compatibility testing, and increase the scope of application of the energy consumption calculation method.
[0138] As an example, when the first target computing device includes a server, the energy consumption of each component of the server is associated with the motherboard. That is to say, even if the server models of two servers are different, as long as the motherboards of the two servers are the same, it can be considered that the energy consumption data of the first component in one server is the same as the energy consumption data in another server, thereby improving the accuracy of the energy consumption calculation of the server.
[0139] It is understandable that whether each component belongs to the target energy consumption type can be determined in advance by an electronic device or other device, and the information can be saved as basic information of the component.
[0140] Taking the first component as an example, based on the energy consumption database corresponding to the computing devices of multiple different device models including the first component, the energy consumption data of the first component in multiple computing devices can be obtained, and based on the energy consumption data of the first component in different computing devices, the energy consumption data differences of each energy consumption data can be calculated. The energy consumption data differences may include but are not limited to the variance of each energy consumption data, the standard deviation of each energy consumption data, the difference between the maximum and minimum values of each energy consumption data, etc. If the energy consumption data difference is greater than the preset difference threshold, it can be determined that the first component belongs to the target energy consumption type.
[0141] By implementing this embodiment, when the first component belongs to the target energy consumption type, such as CPU, memory and other components, the electronic device can determine the motherboard identifier corresponding to the motherboard included in the first target computing device to select the computing device including the first component and the motherboard as the second target computing device, and use the energy consumption data of the first component in the second target computing device as the energy consumption data corresponding to the first component, thereby improving the accuracy of the energy consumption data corresponding to the first component.
[0142] In one embodiment, if the first component does not belong to the target energy consumption type, energy consumption data of the first component in a compatible second target computing device is queried according to a component identifier corresponding to the first component; the second target computing device includes the first component.
[0143] Since the first component does not belong to the target energy consumption type, the energy consumption data of the first component has a low correlation with the device model, and the energy consumption data of the first component in the first target computing device may be less different from the energy consumption data in other computing devices. Therefore, the electronic device can sequentially query whether the energy consumption database corresponding to each device with a different device model from the first target computing device contains the component identification of the first component, and take the device corresponding to the energy consumption database containing the component identification of the first component as the second target computing device, and query the energy consumption data of the first component in the second target computing device in the energy consumption database corresponding to the second target computing device.
[0144] Optionally, the electronic device may traverse the energy consumption databases corresponding to each device with a different device model from the first target computing device, determine one or more second target computing devices, and query the energy consumption data of the first component in the one or more second target computing devices, and then calculate the average of the one or more energy consumption data as the energy consumption data corresponding to the first component, thereby improving the accuracy of the energy consumption data corresponding to the first component. Optionally, the electronic device may also stop querying the energy consumption databases corresponding to each device with a different device model from the first target computing device when the first second target computing device is found, and use the energy consumption data of the first component in the first second target computing device as the energy consumption data corresponding to the first component, thereby improving the efficiency of querying the energy consumption data corresponding to the first component.
[0145] By implementing this embodiment, for a first component that does not belong to the target energy consumption type, the energy consumption data of the first component in any second target computing device that includes the first component can be queried, which can improve the efficiency of obtaining the energy consumption data corresponding to the first component.
[0146] In order to explain the above two embodiments more clearly, Figure 4-B As shown, Figure 4-BThis is a flow chart of a method disclosed in an embodiment of the present application for an electronic device to obtain energy consumption data of a first component in a compatible second target device. The electronic device can determine whether the first component belongs to the target energy consumption type, and execute steps 441 and 442 in sequence, or execute steps 441, 443, and 444 in sequence.
[0147] The electronic device can determine whether the first component belongs to the target energy consumption type. If the first component does not belong to the target energy consumption type, the energy consumption data of the first component in a compatible second target computing device can be queried based on the component identifier corresponding to the first component. If the first component belongs to the target energy consumption type, the motherboard identifier corresponding to the motherboard included in the first target computing device can be obtained, and the energy consumption data of the first component in the compatible second target computing device can be queried based on the component identifier corresponding to the first component and the motherboard identifier.
[0148] Step 450, calculating the energy consumption of the first target computing device according to the energy consumption data and the number of components corresponding to the first component, and the energy consumption data and the number of components of the second component in the first target computing device.
[0149] In one embodiment, the electronic device can also obtain voltage information and load information corresponding to the first target computing device, and correct the energy consumption data corresponding to each component based on the voltage information and load information of the first target computing device to obtain the corrected energy consumption data corresponding to each component, and then calculate the energy consumption of the target computing device based on the corrected energy consumption data corresponding to multiple components and the number of components.
[0150] like Figure 5-C As shown, Figure 5-C This is a schematic diagram of another energy consumption calculation interface disclosed in an embodiment of the present application. The energy consumption calculation interface includes a voltage control 508 and a load control 509. The electronic device can detect the voltage input operation for the voltage control 508 and the load control operation for the load control 509, thereby obtaining the voltage information and load information corresponding to the first target computing device. The voltage information refers to the input voltage value corresponding to the voltage input operation, and the load information refers to the load percentage corresponding to the load control operation. Figure 5-C The voltage value input is 115V / AC, that is, 115 volts of alternating current (AC, Alternating Current), and the load information input is 25% load.
[0151] Among them, the electronic device can determine the correction weight corresponding to each component according to the voltage information and load information corresponding to the first target computing device, thereby multiplying the energy consumption data corresponding to each component by the corresponding correction weight to obtain the corrected energy consumption data corresponding to each component. The embodiment of the present application does not limit the method for determining the correction weight. The electronic device can be pre-set with the corresponding relationship between voltage information, load information and correction weight, and determine the correction weight corresponding to each component according to the corresponding relationship. The electronic device can also predict the correction weight corresponding to each component through a neural network model according to the voltage information and load information corresponding to the first target computing device.
[0152] In this embodiment, the electronic device corrects the energy consumption data through voltage information and load information, thereby further improving the accuracy of energy consumption calculation.
[0153] The electronic device can display various energy consumption information of the first target computing device on the energy consumption calculation interface. Figure 5-D As shown, Figure 5-D It is an interface diagram of another energy consumption calculation interface disclosed in an embodiment of the present application. The energy consumption calculation interface may further include an energy consumption calculation control 510 , an energy consumption export control 511 , and an energy consumption display box 512 .
[0154] In the case of detecting a trigger operation for the energy consumption calculation control 510, the electronic device can execute step 350 and display multiple energy consumption information of the server in the above embodiment, including input current, input voltage, input power, load power, idle input power, typical power, max input power, limit input power, system heat consumption, and carbon dioxide emission, through the energy consumption display box 512. In the case of detecting a trigger operation for the energy consumption export control 511, the electronic device can also execute step 450 and export the energy consumption of the calculated first target computing device as an energy consumption file.
[0155] Optional, such as Figure 5-D As shown, Figure 5-D It may also include a configuration reset control 513. When a trigger operation for the configuration reset control 513 is detected, the electronic device may reset each control in the energy consumption calculation interface to a null value or a default value. The each control refers to all controls in the above-mentioned embodiment, thereby reducing user operations and improving the convenience of configuration input.
[0156] In an embodiment of the present application, the electronic device can also determine whether each component is a first component or a second component based on the component identifier corresponding to each component, and then use different energy consumption acquisition strategies to respectively obtain energy consumption data corresponding to the first component that has not been tested for compatibility with the first target computing device and energy consumption data corresponding to the second component that is compatible with the first target computing device, thereby improving the accuracy of energy consumption calculation of the first target computing device.
[0157] like Figure 6 As shown, Figure 6 1 is a flow chart of a method for an electronic device to determine whether each component is a first component or a second component disclosed in an embodiment of the present application. The method can be applied to the electronic device in the above embodiment. The method may include the following steps:
[0158] Step 610: decode the component code corresponding to the third component according to the first decoding rule to obtain a first decoding result corresponding to the third component.
[0159] Step 620: Query whether the third component is the first component or the second component according to the first decoding result corresponding to the third component.
[0160] Step 630: If the query fails, the component code corresponding to the third component is decoded according to the second decoding rule to obtain a second decoding result corresponding to the third component; the complexity of the second decoding rule is lower than the complexity of the first decoding rule.
[0161] Step 640: query whether the third component is the first component or the second component according to the second decoding result corresponding to the third component.
[0162] The third component is any one of the multiple components included in the configuration information corresponding to the first target computing device. In order to protect information security, the component identification corresponding to the third component may include a component code, which may be obtained by encoding the basic information of the third component according to a preset encoding rule.
[0163] The encoding rule corresponding to the first decoding rule is different from the encoding rule corresponding to the second decoding rule, and the complexity of the decoding rule is proportional to the complexity of the corresponding encoding rule, which may include time complexity and / or space complexity. The complexity of the second decoding rule is lower than the complexity of the first decoding rule, and the complexity of the encoding rule corresponding to the second decoding rule is also lower than the complexity of the encoding rule corresponding to the first decoding rule.
[0164] The query failure means that the electronic device fails to query the third component according to the first decoding result corresponding to the third component.
[0165] Optionally, the first decoding rule includes a decoding rule corresponding to the extended coding, and the second decoding rule includes a decoding rule corresponding to the original coding, and the extended coding is obtained by expanding the original coding. That is, the coding rule corresponding to the first decoding rule is the extended coding, and the coding rule corresponding to the second decoding rule is the original coding. Since the extended coding is obtained by expanding the original coding, the second decoding rule is related to the first decoding rule to a certain extent, and there may be repeated decoding processes, thereby reducing the time required for two decodings, and the decoding result is more accurate.
[0166] In an embodiment of the present application, the electronic device can decode the component code corresponding to the third component according to the first decoding rule to obtain the first decoding result corresponding to the third component, and then query whether the third component is the first component or the second component based on the first decoding result of the third component. If the query fails, the component code corresponding to the third component is decoded according to the second decoding rule to obtain the second decoding result corresponding to the third component, and then query whether the third component is the first component or the second component based on the second decoding result corresponding to the third component. By first using a decoding rule with high complexity for decoding, the accuracy and credibility of the decoding result can be improved, and the multiple decoding method also increases the probability of successful decoding of the component code, avoids the electronic device from being unable to recognize the component code input by the user, and improves the convenience of energy consumption calculation.
[0167] Based on the embodiment of steps 610-640, in one embodiment, the electronic device can obtain the component type of the third component according to the decoding result corresponding to the third component, and query whether the third component is the first component or the second component in the compatible file corresponding to the component type of the third component according to the decoding result corresponding to the third component and the device model of the first target computing device. The specific explanation of this embodiment can refer to the content of the aforementioned embodiment, which will not be repeated here.
[0168] Based on the embodiment of steps 610-640, in one embodiment, the electronic device can obtain basic information corresponding to the third component based on the decoding result corresponding to the third component, and the basic information may include the component type. After querying whether the third component is the first component or the second component, the basic information and compatible types corresponding to multiple components included in the configuration information corresponding to the first target computing device can be displayed through the information display interface for user confirmation.
[0169] To further illustrate whether the components included in the first target computing device need to meet the compatibility of the first target computing device, it will affect the energy consumption calculation of the first target computing device, such as Figure 7-A As shown, Figure 7-A: is a flow chart of another energy consumption calculation method disclosed in an embodiment of the present application. The energy consumption calculation method can be applied to the electronic device in the above embodiment. The energy consumption calculation method may include the following steps:
[0170] Step 702, obtaining configuration information corresponding to the first target computing device; the configuration information includes component identifiers and component quantities corresponding to a plurality of components.
[0171] Step 704: determine whether each component is a first component or a second component according to the component identifier corresponding to each component.
[0172] Step 706 , determining whether the components included in the first target computing device need to meet the compatibility requirements with the first target computing device. If yes, proceed to step 708 , if no, proceed to step 712 .
[0173] In one embodiment, when the components included in the first target computing device need to satisfy compatibility with the first target computing device, only the second component is included in the energy consumption calculation of the first target computing device; when the components included in the first target computing device do not need to satisfy compatibility with the first target computing device, both the first component and the second component can be included in the energy consumption calculation of the first target computing device.
[0174] Optionally, the electronic device may determine whether the first target computing device is compatible with the first target computing device by detecting a user operation.
[0175] Optionally, the electronic device may also use the device model of the first target computing device to compare a first frequency that does not need to satisfy compatibility with the first target computing device with a second frequency that needs to satisfy compatibility with the first target computing device during the historical calculation of energy consumption of the computing device of the device model; if the first frequency is greater than the second frequency, it is determined that components included in the first target computing device do not need to satisfy compatibility with the first target computing device; if the first frequency is not greater than the second frequency, it is determined that components included in the first target computing device need to satisfy compatibility with the first target computing device.
[0176] Optionally, the electronic device may also obtain the user identity and determine, based on the default settings corresponding to the user identity, whether the components included in the first target computing device need to be compatible with the first target computing device.
[0177] By implementing this embodiment, it is possible to determine whether the components included in the first target computing device need to be compatible with the first target computing device, so as to determine the components among the multiple components included in the configuration information that need to be included in the energy consumption calculation process of the first target computing device, thereby improving the flexibility of the energy consumption calculation of the first target computing device.
[0178] As an optional implementation, the electronic device may also display an energy consumption calculation interface, which includes compatible controls and incompatible controls. In response to a trigger operation on a compatible control, it is determined that the components included in the first target computing device need to be compatible with the first target computing device; or, in response to a trigger operation on an incompatible control, it is determined that the components included in the first target computing device do not need to be compatible with the first target computing device.
[0179] like Figure 7-B As shown, Figure 7-B This is an interface diagram of another energy consumption calculation interface disclosed in an embodiment of the present application. The energy consumption calculation interface also includes a compatible control 7100 and an incompatible control 7200. The compatible control 7100 and the incompatible control 7200 are mutually exclusive controls, that is, the user cannot perform trigger operations on the compatible control 7100 and the incompatible control 7200 at the same time.
[0180] By implementing this embodiment, it is flexibly determined according to user needs whether the components included in the first target computing device need to be compatible with the first target computing device, thereby improving the flexibility of calculating the energy consumption of the first target computing device.
[0181] Step 708: Obtain a component identifier corresponding to a second component that is compatible with the first target computing device.
[0182] Step 710: Obtain energy consumption data corresponding to the second component according to the component identification of the second component.
[0183] Step 712: Obtain a component identifier corresponding to a first component that has not been tested for compatibility with the first target computing device, and a component identifier corresponding to a second component that is compatible with the first target computing device.
[0184] Step 714: Obtain energy consumption data corresponding to the second component according to the component identification of the second component.
[0185] Step 716, determining whether the first component belongs to the target energy consumption type. If not, executing step 718, and if so, executing step 720.
[0186] Step 718: query the energy consumption data of the first component in the compatible second target computing device according to the component identifier corresponding to the first component.
[0187] Step 720: Obtain a motherboard identifier corresponding to a motherboard included in the first target computing device.
[0188] Step 722: query the energy consumption data of the first component in the compatible second target computing device according to the component identification and the motherboard identification corresponding to the first component.
[0189] Step 724, calculating the energy consumption of the first target computing device according to the energy consumption data and the number of components corresponding to the first component, and the energy consumption data and the number of components corresponding to the second component.
[0190] The methods of steps 702-724 may refer to the methods in the above embodiment and will not be described in detail here.
[0191] The energy consumption calculation method provided in the embodiment of the present application can be applied to energy consumption calculation scenarios of servers, such as Figure 8-A As shown, Figure 8-A This is a flow chart of a method for calculating energy consumption of a server disclosed in an embodiment of the present application, wherein:
[0192] Step 810, determine whether the components included in the server need to be compatible with the server. If yes, execute step 820, if not, execute steps 840 and 850.
[0193] Step 820, delete the components that have not been tested for compatibility with the server.
[0194] It can be understood that the deletion here does not mean that the component needs to be deleted from the configuration information corresponding to the server, but that the energy consumption data of the components that have not been tested for compatibility with the server will not be included in the calculation of the server's energy consumption, and only the energy consumption data of the components that are compatible with the server will be included in the calculation of the server's energy consumption.
[0195] Step 830, obtaining energy consumption data corresponding to components compatible with the server.
[0196] Step 840, obtaining energy consumption data corresponding to components compatible with the server.
[0197] Step 850 , determining whether the component that has not been tested for compatibility with the server belongs to the target energy consumption type. If yes, executing step 860 , if no, executing step 870 .
[0198] Step 860, traverse the energy consumption data of the component in other servers that have the same motherboard and are compatible.
[0199] Step 870, traverse the energy consumption data of the component in other compatible servers.
[0200] Step 880, calculating the energy consumption of the server.
[0201] The method of steps 810 - 880 may refer to the method for calculating the energy consumption of the first target computing device in the above embodiment, which will not be described in detail here.
[0202] In the energy consumption calculation scenario of the server, the energy consumption calculation interface displayed by the electronic device may also include various controls in the above embodiments, such as Figure 8-B As shown, Figure 8-B This is an interface diagram of an energy consumption calculation interface for a server disclosed in an embodiment of the present application. The various elements in the interface can refer to the contents in the above embodiment and will not be repeated here.
[0203] like Fig. 9 As shown, Fig. 9 9 is a modular schematic diagram of an energy consumption calculation device disclosed in an embodiment of the present application. The energy consumption calculation device 900 can be applied to the electronic device in the above embodiment. The energy consumption calculation device 900 may include a configuration information acquisition module 910, an energy consumption data acquisition module 920 and an equipment energy consumption calculation module 940, wherein:
[0204] A configuration information acquisition module 910 is used to acquire configuration information corresponding to the first target computing device, the configuration information including component identifiers and component quantities corresponding to a plurality of components; the plurality of components include a first component that has not been tested for compatibility with the first target computing device, and a second component that is compatible with the first target computing device;
[0205] The energy consumption data acquisition module 920 is used to acquire energy consumption data of the first component in a compatible second target computing device according to the component identifier corresponding to the first component; the device model of the second target computing device is different from the device model of the first target computing device;
[0206] The device energy consumption calculation module 930 is used to calculate the energy consumption of the first target computing device based on the energy consumption data and the number of components corresponding to the first component, and the energy consumption data and the number of components of the second component in the first target computing device.
[0207] In one embodiment, the energy consumption data acquisition module 920 is also used to obtain the motherboard identifier corresponding to the motherboard included in the first target computing device if the first component belongs to the target energy consumption type; wherein the target energy consumption type is used to indicate that the difference in energy consumption data of the first component in computing devices of different device models is greater than a difference threshold; based on the component identifier and the motherboard identifier corresponding to the first component, query the energy consumption data of the first component in a compatible second target computing device; the second target computing device includes the first component and the motherboard.
[0208] In one embodiment, the energy consumption data acquisition module 920 is also used to query the energy consumption data of the first component in a compatible second target computing device according to the component identifier corresponding to the first component if the first component does not belong to the target energy consumption type; the second target computing device includes the first component; the target energy consumption type is used to indicate that the difference in energy consumption data of the first component in computing devices of different device models is greater than a difference threshold.
[0209] In one embodiment, the energy consumption calculation device 900 may further include a component compatibility determination module, which is used to determine whether each component is a first component or a second component according to a component identifier corresponding to each component.
[0210] In one embodiment, the component compatibility judgment module is further used to obtain the component type of the third component according to the component identifier corresponding to the third component; the third component is any one of the multiple components; in the compatibility file corresponding to the component type of the third component, according to the component identifier corresponding to the third component and the device model of the first target computing device, query whether the third component is the first component or the second component; wherein the compatibility file includes one or more groups of compatibility information, each group of compatibility information includes the component identifier, device model and compatibility result of the corresponding component type, and the compatibility result is used to characterize whether the component corresponding to the component identifier is compatible in the computing device corresponding to the device model.
[0211] In one embodiment, the component identification includes a component code; the component compatibility judgment module is further used to decode the component code corresponding to the third component according to the first decoding rule to obtain a first decoding result corresponding to the third component; the third component is any one of the multiple components; according to the first decoding result corresponding to the third component, query whether the third component is the first component or the second component; if the query fails, decode the component code corresponding to the third component according to the second decoding rule to obtain a second decoding result corresponding to the third component; the complexity of the second decoding rule is lower than the complexity of the first decoding rule; according to the second decoding result corresponding to the third component, query whether the third component is the first component or the second component.
[0212] In one embodiment, the first decoding rule includes a decoding rule corresponding to the extended coding, and the second decoding rule includes a decoding rule corresponding to the original coding, and the extended coding is obtained by expanding the original coding.
[0213] In one embodiment, the energy consumption data acquisition module 920 is also used to obtain energy consumption data corresponding to a second component that is compatible with the first target computing device when the components included in the first target computing device need to meet the compatibility requirements with the first target computing device; the device energy consumption calculation module 930 is also used to calculate the energy consumption of the first target computing device based on the energy consumption data corresponding to the second component and the corresponding number of components.
[0214] In one embodiment, the energy consumption calculation device 900 also includes an interface operation response module, which is used to display an energy consumption calculation interface, and the energy consumption calculation interface includes compatible controls and incompatible controls; in response to a trigger operation on a compatible control, it is determined that the components included in the first target computing device need to meet the requirements of being compatible with the first target computing device; or, in response to a trigger operation on an incompatible control, it is determined that the components included in the first target computing device do not need to meet the requirements of being compatible with the first target computing device.
[0215] In one embodiment, the interface operation response module is also used to display the energy consumption calculation interface; in response to the device configuration input operation for the energy consumption calculation interface, receive the imported configuration file corresponding to the first target computing device, or receive the input configuration text corresponding to the first target computing device; parse the configuration file or configuration text according to preset rules to obtain the component identifiers and component quantities corresponding to multiple components.
[0216] In an embodiment of the present application, by obtaining configuration information corresponding to the first target computing device, the configuration information may include component identifiers and component quantities corresponding to multiple components, the multiple components include a first component that has not been tested for compatibility with the first target computing device, and a second component that is compatible with the first target computing device. According to the component identifier corresponding to the first component, the energy consumption data of the first component in the compatible second target computing device can be obtained, so that the energy consumption of the first target computing device can be calculated according to the energy consumption data and component quantity corresponding to the first component, and the energy consumption data and component quantity of the second component in the first target computing device. By implementing this embodiment, in the case where the first target computing device includes the first component that has not been tested for compatibility, the energy consumption data of the first component in the second target computing device can also be obtained as the energy consumption data corresponding to the first component, so as to calculate the energy consumption of the first target computing device, reduce the limitations of the energy consumption calculation of the computing device, avoid the situation where the energy consumption of the component that has not been tested for compatibility with the computing device cannot be calculated, so that the energy consumption calculation of more computing devices with different configurations can be covered, and the flexibility of the energy consumption calculation is improved.
[0217] like Fig.10 As shown, in one embodiment, an electronic device is provided, which may include:
[0218] A memory 1010 storing executable program codes;
[0219] a processor 1020 coupled to the memory 1010;
[0220] The processor 1020 calls the executable program code stored in the memory 1010 to implement the energy consumption calculation method provided in the above embodiments.
[0221] The memory 1010 may include a random access memory (RAM) or a read-only memory (ROM). The memory 1010 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 1010 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing one or more functions (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may also store data created by the electronic device during use, etc.
[0222] The processor 1020 may include one or more processing cores. The processor 1020 uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 1010, and calling data stored in the memory 1010. Optionally, the processor 1020 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 1020 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1020, but may be implemented separately through a communication chip.
[0223] It is understandable that the electronic device may include more or fewer structural elements than those in the above structural block diagram, for example, a power module, physical buttons, a WiFi (Wireless Fidelity) module, a speaker, a Bluetooth module, a sensor, etc., and no limitation is made here.
[0224] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the methods described in the above embodiments.
[0225] In addition, an embodiment of the present application further discloses a computer program product. When the computer program product is run on a computer, the computer can execute all or part of the steps in any one of the energy consumption calculation methods described in the above embodiments.
[0226] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0227] The above is a detailed introduction to an energy consumption calculation method disclosed in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for calculating energy consumption, characterized in that: include: Acquire configuration information corresponding to a first target computing device, the configuration information including component identifiers and component quantities corresponding to a plurality of components; the plurality of components including a first component that has not been tested for compatibility with the first target computing device, and a second component that is compatible with the first target computing device; According to the component identifier corresponding to the first component, acquiring energy consumption data of the first component in a compatible second target computing device; The device model of the second target computing device is different from the device model of the first target computing device; The energy consumption of the first target computing device is calculated based on the energy consumption data and the number of components corresponding to the first component and the energy consumption data and the number of components of the second component in the first target computing device.
2. The method according to claim 1, characterized in that The acquiring, according to the component identifier corresponding to the first component, energy consumption data of the first component in a compatible second target computing device includes: If the first component belongs to the target energy consumption type, obtaining a motherboard identifier corresponding to a motherboard included in the first target computing device; wherein the target energy consumption type is used to indicate that the difference in energy consumption data of the first component in computing devices of different device models is greater than a difference threshold; According to the component identification corresponding to the first component and the mainboard identification, energy consumption data of the first component in a compatible second target computing device is queried; the second target computing device includes the first component and the mainboard.
3. The method according to claim 1, characterized in that The acquiring, according to the component identifier corresponding to the first component, energy consumption data of the first component in a compatible second target computing device includes: If the first component does not belong to the target energy consumption type, then according to the component identifier corresponding to the first component, the energy consumption data of the first component in a compatible second target computing device is queried; the second target computing device includes the first component; the target energy consumption type is used to indicate that the difference in energy consumption data of the first component in computing devices of different device models is greater than a difference threshold.
4. The method according to claim 1, characterized in that: After acquiring the configuration information corresponding to the first target computing device, the method further includes: According to the component identifier corresponding to each of the components, it is determined that each of the components is the first component or the second component.
5. The method according to claim 4, characterized in that The step of determining, according to component identifiers corresponding to the components, that each component is the first component or the second component includes: According to the component identifier corresponding to the third component, acquiring the component type of the third component; the third component is any component among the multiple components; In a compatible file corresponding to the component type of the third component, querying whether the third component is the first component or the second component according to the component identifier corresponding to the third component and the device model of the first target computing device; Among them, the compatibility file includes one or more groups of compatibility information, each group of compatibility information includes a component identification, a device model and a compatibility result corresponding to the component type, and the compatibility result is used to indicate whether the component corresponding to the component identification is compatible in the computing device corresponding to the device model.
6. The method according to claim 4, characterized in that The component identification includes a component code; and determining that each component is the first component or the second component according to the component identification corresponding to each component includes: Decoding a component code corresponding to a third component according to a first decoding rule to obtain a first decoding result corresponding to the third component; the third component is any one of the multiple components; querying, according to the first decoding result corresponding to the third component, whether the third component is the first component or the second component; If the query fails, the component code corresponding to the third component is decoded according to a second decoding rule to obtain a second decoding result corresponding to the third component; the complexity of the second decoding rule is lower than the complexity of the first decoding rule; According to the second decoding result corresponding to the third component, it is queried whether the third component is the first component or the second component.
7. The method according to claim 6, characterized in that The first decoding rule includes a decoding rule corresponding to the extended coding, the second decoding rule includes a decoding rule corresponding to the original coding, and the extended coding is obtained by expanding the original coding.
8. The method according to claim 1, characterized in that The method further comprises: In a case where a component included in the first target computing device needs to be compatible with the first target computing device, acquiring energy consumption data corresponding to a second component compatible with the first target computing device; The energy consumption of the first target computing device is calculated according to the energy consumption data corresponding to the second component and the corresponding number of components.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: Displaying an energy consumption calculation interface, wherein the energy consumption calculation interface includes compatible controls and incompatible controls; In response to a trigger operation on the compatible control, it is determined that components included in the first target computing device need to satisfy compatibility with the first target computing device; or, in response to a trigger operation on the incompatible control, it is determined that components included in the first target computing device do not need to satisfy compatibility with the first target computing device.
10. The method according to any one of claims 1 to 8, characterized in that: The obtaining of configuration information corresponding to the first target computing device includes: Display the energy consumption calculation interface; In response to a device configuration input operation for the energy consumption calculation interface, receiving an imported configuration file corresponding to a first target computing device, or receiving an input configuration text corresponding to the first target computing device; The configuration file or the configuration text is parsed according to a preset rule to obtain component identifiers and component quantities corresponding to the multiple components.