Computer method, system and program for calculating energy consumption and co2 emissions produced by running software in computing environments
The method calculates energy and CO2 emissions from software executions by identifying hardware components and using geolocation-specific data, addressing the lack of comprehensive calculation methods in existing technologies.
Patent Information
- Application Number
- PCT/ES2024/070317
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2025-11-27
AI Technical Summary
Existing technologies lack a comprehensive method to accurately calculate energy consumption and CO2 emissions produced by software executions in computer environments, particularly in distributed and non-distributed systems, without relying on specific infrastructure or hardware details.
A method that identifies hardware components during software execution, measures execution time, and calculates energy consumption using component-specific power values and geolocation-specific CO2 emissions, independent of the computing environment's infrastructure, using databases for component specifications and emissions data.
Provides accurate calculations of energy consumption and CO2 emissions by software executions, agnostic to the computing environment, enabling effective environmental impact assessment.
Smart Images

Figure ES2024070317_27112025_PF_FP_ABST
Abstract
Description
[0001]METHOD, SYSTEM, AND COMPUTER PROGRAM FOR CALCULATING ENERGY CONSUMPTION AND CO2 EMISSIONS PRODUCED BY SOFTWARE EXECUTIONS IN COMPUTER ENVIRONMENTS DESCRIPTION Field of the Art The present invention relates to a method, system, and computer program for calculating the energy consumption and CO2 emissions produced by software executions in computer environments. Background of the Invention The commitment to minimizing the negative impact on the environment and maximizing the positive impact derived from digitalization is becoming a fundamental business objective for many companies. Optimizing energy consumption and reducing greenhouse gas emissions are key priorities for achieving the goal of net-zero CO2 emissions. In the context of emissions calculation tools, there are some patents and patent applications. For example,US patent 7877235B2 discloses a network-based emissions and energy consumption management system associated with one or more pieces of equipment, assets, or an entire company. The tool includes a central processor, an asset database, and several software programs with various functionalities such as calculating and monitoring emissions, energy consumption, carbon credits, and financial costs. It also includes a software system that allows for comparing and analyzing operational adjustments to achieve optimal objectives based on the information obtained. US patent application 20220237472A1 proposes a system for automating the calculation of the carbon footprint of products or services. The methods and systems apply one or more of the following techniques, as described above. First, the calculation of each carbon footprint is obtained from a single, uniform database applied to all products and services. Where possible,This data is automatically fed from existing business data. Second, an uncertainty analysis identifies activity data or emission factors where adding more information or improving accuracy would impact the carbon emissions calculation, making manual data mapping more effective. Third, a model estimates emission factors, eliminating the need for manual data entry. Patent application US20170351978A1 describes a method and system that implements artificial intelligence to assess and estimate the carbon footprint generated by a trip by detecting, in real time, activities performed by a given user, such as location, lighting usage, and social media data. Furthermore, based on this data and pattern detection,A user profile is generated that allows for recommendations to be made to reduce their carbon footprint if a set threshold is exceeded. It is also possible to offset the impact generated through donations to organizations dedicated to mitigating adverse effects. US patent 9614743B2 describes a method for calculating the carbon footprint of a network service via a server. This method uses information on energy consumption, cooling requirements, and the distribution of these requirements among network devices based on their use of the network service. It also utilizes the virtualization of network functions.and the relocation of virtual machines to reduce environmental impact. Server memory stores the instructions necessary to carry out these operations and can function as network controllers defined and managed by software. Patent application US20180052431A1 describes a method for energy management in data centers using alternative and renewable energy sources, given the challenges these centers face in terms of energy consumption. It seeks to improve the energy efficiency and reliability of data centers. To achieve this and meet energy management objectives and entry criteria, it employs an optimization engine that returns a combination of variable and non-variable energies that dynamically adjust the energy distribution. Patent US8395621B2 proposes a system with memory, interface, and processor,which allows for improved data center efficiency. The memory stores historical data, initial center configurations, and a profile. Through an interface, the system communicates with a user, who selects a strategy to increase efficiency and a reduction level. Finally, the processor identifies the data collected in memory and, based on the initiative selected by the user, generates a recommended configuration to achieve the selected energy consumption reduction. The present invention proposes a new tool for measuring the energy consumption and CO2 emissions of software executions in both Big Data environments (distributed environments) and non-Big Data environments (non-distributed or machine / computer executions). The present invention is agnostic to the characteristics of the computing environment, cloud or on-premises infrastructure providers, and hardware device manufacturers.focusing solely and exclusively on the hardware characteristics on which the software runs and the geolocation of the machine(s). To this end, the energy consumed during software execution is calculated by monitoring the time and usage of the different hardware elements (CPU, GPU, RAM, etc.) on which the software runs. The energy consumed, along with the hardware geolocation and its energy mix, allows for the calculation of emissions produced during execution. In a first aspect, the present invention provides a computer-implemented method comprising running software on a computer / terminal / machine for a specific period or time interval; identifying the hardware components available on the computer during execution, for example, by calling an operating system that runs the software or by calling at least the computer itself; obtaining information on the computer's geolocation; and measuring,Upon completion of software execution, the software execution time is measured; the energy consumed by one of the identified hardware components is calculated using the measured execution time and information relating to the hardware component, including power consumption values for the hardware component or a total number of gigabytes used during execution along with a power factor; and the CO2 emissions produced by the software execution are calculated using the calculated energy consumption and information relating to the amount of CO2 emitted by a given geolocation. According to the present invention, the hardware components may comprise at least a CPU, GPU, or RAM. In some embodiments, the energy consumption calculation comprises calculating, separately,The energy consumed by each identified hardware component is calculated, and a total energy consumption is calculated by summing the energy consumed by each hardware component. In some implementations, information regarding the amount of CO2 emitted by a given geolocation is obtained by estimating how many grams of CO2 per kWh would be emitted at the time of execution. The estimate may involve calculating the average CO2 emissions produced at the same point in time during the previous day's execution, along with CO2 emissions from the last few moments that coincide with the same day of the week as the current execution date. In some implementations, information regarding power consumption and CO2 emissions for a given geolocation is stored in different databases. In some implementations,The geolocation information comprises an IP address. In other embodiments, the geolocation information comprises the geolocation position of the computer. In some embodiments, the software execution time is measured by considering the time difference between the start and end of execution. In some embodiments, the software execution time is measured by considering a request to an operating system of a cluster of nodes, where the cluster operating system obtains computation time from each of the cluster nodes. Other embodiments of the invention disclosed herein also include a system and computer programs for performing the steps and operations of the method proposed in the first aspect of the invention. More particularly,A computer program product is an embodiment having a computer-readable medium that includes computer program instructions encoded therein, which, when executed on at least one processor of a computer system, cause the processor to perform the operations described herein as embodiments of the invention. The present invention is completely agnostic to the infrastructure used for software execution (company, cloud provider, infrastructure provider, etc.), relying solely on monitoring the basic hardware components that make up a machine on which the software is executed. No additional component or device is required to measure the energy consumed during the execution process. Brief description of the drawings: The foregoing and other features and advantages will be more fully understood from the following detailed description of exemplary embodiments.merely illustrative and not limiting, with reference to the accompanying drawings, in which: Fig. 1 is a flowchart of the proposed method, according to an example of an embodiment of the present invention. detailed description of the invention and of some, The present invention provides a method and system for calculating the energy consumption and CO2 emissions produced by software execution in computing environments. Specifically, the proposed system consists of the software to be executed and one or more computers, or machines, depending on whether it is a distributed (Big Data) or non-distributed (non-Big Data) environment. Figure 1 illustrates an example of the proposed method.In this example, to calculate the energy consumed by running software and subsequently calculate CO2 emissions, a series of databases containing the following information are used: − CPU Technical Specifications (DB1): Data source containing information on CPU models, their TDP or Thermal Design Power (a value provided by the CPU and GPU manufacturer indicating the watts consumed by these components when operating at 100%), and the number of cores (provided by the CPU manufacturers). − GPU Technical Specifications (DB2): Data source containing information on GPU models and their TDP. − CO2 Emissions per kWh and Country (DB3): Data source with daily or hourly information on CO2 emissions per kWh emitted by each country (provided by the different energy providers in each country).In step 101, the method involves running the software on a computer, or machine, for a specific period of time. Then, upon startup, the hardware components available for execution are identified (step 102). For example, in non-Big Data environments, the following information can be obtained through operating system calls: CPU model, GPU model, and RAM allocated to the process. In Big Data environments, the following information can be obtained for the driver machine and for each node in the Big Data cluster: CPU model (driver and nodes), number of cores allocated to each CPU for execution, GPU model (driver and nodes), and RAM allocated to the process (driver and nodes). Additionally, at startup or immediately after execution, the computer's geolocation information is obtained (step 103).This can be done using the computer's IP address or by directly indicating the computer's geolocation. At the end of the software execution, the execution time is measured (step 104). Specifically, in non-Big Data environments, the execution time is obtained as the time difference between the start and end of the software execution. In Big Data environments, execution times can be measured as follows: − Driver execution time: During the execution of a software process in a Big Data environment, the driver machine is always active, performing calculations and scheduling the tasks it has to send to the nodes; therefore, its execution time is calculated as the time difference between the start and end of the software execution.- Node execution time: Nodes are machines that receive a task (a fragment of the total software execution), execute the task, and return the execution result to the driver. The execution time of each node in a Big Data cluster is variable, and therefore these execution times are calculated by the Big Data cluster's operating system (for example, Yarn in a Hadoop cluster). After the software execution finishes, a request is made to the cluster's operating system to obtain the computation time of each node in the cluster (for example, in a Hadoop cluster, by making a request to the Yarn API, which reads this data from the history server). Then, in stage 105, the energy consumed by one or all of the previously identified hardware components is calculated. The TDP value and the number of CPU cores used in the software execution are obtained from the BD1 database.With this value(s) and together with the calculated execution time, the energy consumed by the CPU(s) can be calculated as follows: − Non-Big Data Environment: Energy is calculated by multiplying the time by the TDP value. ^^^^^^^^^^ ^ ^^^^^^^ ^ ^^^^^^^^^− Big Data Environment: Energy is calculated by multiplying the execution time of the machine (driver or node) by the CPU's TDP value and by the proportional part of the number of cores used in the CPU (e.g., if the CPU has 10 cores and only 6 cores have been allocated for execution, multiply by 0.6) ^^^^^^^^^^^^^^^^^^^^^^ ^ ^^^^^^ ^^^^^^^^^^^^^^^^ ^ ^^^^^^^^^With the database (BD2), the TDP value is obtained and the energy consumed by the GPU(s) is calculated by multiplying the computation time by the TDP value.On the other hand, the energy consumed by RAM is calculated by multiplying the execution time by the number of total gigabytes used in execution by a power factor (preferably equal to 0.38 w / Gb, which is a factor obtained from the study). +^^^^^^^ !"^ ^ ^#^^^^^^^^$%^ ^ ^&'() *$%, - ^^^^^^^^^Finally, in the case that the energy for all software components has been calculated, the total energy consumed in the process is obtained by adding the energies consumed by the CPU / s, the GPU / s and the RAM memory: ^^^^^^^^^^^^^^ ^ ^^^^^^^^^^^ . ^^^^^^^^^^ . ^^^^^^^ !"Lastly, in stage 106, the method calculates the CO2 emissions produced by the execution of the software. This is done using previously calculated energy consumption and information on the amount of CO2 emitted by a given geolocation:^^^^^^^^^^^ / 0 ^ ^1^^^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^+^^In this sense, the database (BD3) provides the amount of CO2 (for example, grams) emitted by a given geolocation per kWh consumed. The database includes a historical record of grams of CO2 per kWh for each geolocation, and estimates are made of how many grams of CO2 per kWh would be emitted at the time of execution.Specifically, this estimate is calculated as the average of CO2 emissions produced at the same time of the previous day's execution, along with the CO2 emissions produced during the last 'N' times that coincide with the same day of the week as the current execution day. Depending on the time granularity of the database, these times can be 15-minute, 30-minute, hourly, or daily periods. Below are some real-world examples obtained using the proposed method: 1. DB1: CPU database. 2. BD2: GPU Database 3. BD3: Database with the amount of CO2 emitted by each country per watt consumed Example of non-Big Data software (on a single machine) Software is executed starting on Thursday, April 4, 2024 at 9:00:00 and finishing the same day at 11:00:00 (2-hour execution time) a. Hardware components: • CPU: Model_CPU_CA • GPU: Model_GPU_G2 • RAM: 16Gb b. Geolocation: Spain c. Execution time: 2 hours d. Energy consumed by the CPU: Model_CPU_CA 100 W * 2 hours = 200 Wh e. Energy consumed by the GPU: Model_GPU_G2 400 W * 2 hours = 800 Wh f. Energy consumed by the RAM: 16Gb * 0.38 W / Gb * 2 hours = 12.2 Wh g. Total energy consumed: 200 Wh + 800 Wh + 12.2 Wh = 1012.2 Wh. Calculation of the emissions ratio: • Geolocation: Spain • Date of execution: Thursday, April 4, 2024 • Dates for obtaining the ratio: Wednesday, April 3, 2024, Thursday, March 28, 2024, and Thursday, March 21, 2024. • Average ratio: (0.140 + 0.160 + 0.150) / 3 = 0.150 grams CO2 / Wh. Calculation of CO2 emissions: 1012.2 Wh * 0.150 grams CO2 / Wh = 151.9 grams CO2 For this example, a cluster with 3 machines (1 driver and 2 nodes) is available, whose characteristics and execution times are described in points 1 and 3 above. The software starts execution on Thursday, April 4, 2024, at 9:00:00 and finishes execution the same day at 11:00:00 (2-hour execution time). The steps to calculate energy and CO2 emissions are as follows: a. Hardware components: b. Geolocation: Spain c. Execution time: d. Energy consumed by the CPUs: e. Energy consumed by GPUs: Total Energy 600 Wh f. Energy consumed by the RAM: g. Total energy consumed: 185 Wh + 600 Wh + 27 Wh = 812 Wh h. Calculation of the emissions ratio: a. Geolocation: Spain b. Date of execution: Thursday, April 4, 2024 c. Dates for obtaining the ratio: Wednesday, April 3, 2024, Thursday, March 28, 2024, and Thursday, March 21, 2024. d. Average of the ratio: (0.140 + 0.160 + 0.150) / 3 = 0.150 grams CO2 / Wh i. Calculation of CO2 emissions: 812 Wh * 0.150 grams CO2 / Wh = 121.8 grams CO2 Some hardware component manufacturers provide information on the energy consumed by these devices as if it were an energy meter. Therefore, in some implementation examples, where energy consumption can be monitored from these meters, the energy consumed could be calculated by monitoring these meters. The computer-readable medium includes computer storage media. The storage medium can be any available medium that can be accessed by a computer.By way of example, and not as a limitation, such computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic or solid-state disk storage, or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. "Disk" and "disc," as used herein, include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while discs reproduce data optically using lasers. Combinations of the foregoing should also be included within the scope of computer-readable medium. Any processor and storage medium may reside in an ASIC.The ASIC may reside in a user terminal. Alternatively, the processor and storage medium may reside as discrete components in a user terminal. As used herein, computer program products comprising computer-readable media include all forms of computer-readable media except, to the extent that such media is deemed not to be unestablished transient propagation signals. The scope of the present invention is defined in the appended claims.
Claims
CLAIMS 1. A computer-implemented method for calculating the energy consumption and CO2 emissions produced by software executions in distributed and non-distributed computing environments, the method comprising: executing software on a computer for a specified period of time; identifying the hardware components available on the computer during execution; obtaining geolocation information of the computer; measuring, at the end of the software execution, a software execution time; calculating the energy consumed by one of the identified hardware components using the measured execution time and information relating to the hardware component,including such information, values for power consumed by the hardware component or a total number of gigabytes used in execution along with a power factor; calculating the CO2 emissions produced by the execution of the software using the calculated energy consumed and information relating to an amount of CO2 emitted by a given geolocation.
2. The method of claim 1, wherein the hardware components comprise at least one CPU, GPU, or RAM.
3. The method of claim 1 or 2, wherein the calculation of energy consumed comprises independently calculating the energy consumed by each identified hardware component and calculating a total energy consumed by summing the energy consumed by each hardware component.
4. The method according to any one of the preceding claims,wherein the information relating to the amount of CO2 emitted by a given geolocation is obtained by estimating how many grams of CO2 per kWh would be emitted at the time of execution, wherein the estimate comprises calculating an average value of the CO2 emissions produced at the same instant of execution on the previous day together with CO2 emission values produced at the last moments that coincide with the same day of the week as the day of execution.
5. The method according to any one of the preceding claims, wherein the information relating to the values of power consumed and the information relating to the amount of CO2 emitted by a given geolocation are stored in different databases.
6. The method according to any one of the preceding claims, wherein the geolocation information comprises an IP address.
7. The method according to any one of claims 1 to 6, wherein the geolocation information comprises a geolocation position where the computer is located.
8. The method according to any one of the preceding claims, wherein the measurement of the software execution time is performed by taking into account a time difference between the start and end of execution.
9. The method according to any one of claims 1 to 7, wherein the measurement of the software execution time is performed by taking into account a request to an operating system of a node cluster.where said cluster operating system obtains a computation time from each of the cluster nodes.
10. A system for calculating the energy consumption and CO2 emissions produced by software executions in distributed and non-distributed computing environments comprises: at least one computer; and software; wherein said computer, which is at least one, includes at least one memory and one or more processors, configured to: execute the software for a specified period of time; identify the hardware components available in the computer during execution; obtain geolocation information of the computer; measure, upon completion of the software execution, a software execution time; calculate the energy consumed by one of the identified hardware components using the measured execution time and information relating to the hardware component,including such information, values of power consumed by the hardware component or a total number of gigabytes used in execution together with a power factor; calculating the CO2 emissions produced by the execution of the software using the calculated energy consumed and information relating to an amount of CO2 emitted by a given geolocation.
11. Computer program product comprising code instructions that, when executed on a computing system, implement a method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Night light data-assisted regional land utilization carbon emission calculation method and device
CN117150170A
Method and System to Measure and Report Scope-2 Indirect Emissions Caused by Equipment Operating in a Datacenter
US20240127260A1