Instruction-level energy consumption estimation method, system and equipment of embedded program, medium and product

By building an embedded hardware simulation system and multi-frequency energy consumption model, the accuracy of embedded program energy consumption estimation is solved, and accurate energy consumption analysis and optimization of different hardware platforms are achieved.

CN120492267APending Publication Date: 2025-08-15TSINGHUA UNIVERSITY +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510599846.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The prior art is difficult to accurately estimate the instruction-level energy consumption on different embedded hardware, and cannot reflect the impact of hardware frequency on instruction energy consumption, resulting in insufficient performance in characterizing the energy consumption estimation result.

Method used

Build a simulation system architecture of the target embedded hardware, obtain execution logs and energy consumption data at different frequencies, and establish a multi-frequency instruction-level energy consumption estimation model through linear polynomial fitting for dynamic energy consumption estimation.

Benefits of technology

It improves the accuracy of energy consumption estimation of embedded programs on the hardware platform, simplifies the energy optimization process of program writing, and enhances the characterization ability of energy consumption estimation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492267A_ABST
    Figure CN120492267A_ABST
Patent Text Reader

Abstract

The invention discloses an embedded program instruction level energy consumption estimation method, system and device, a medium and a product, and the method comprises the steps: enabling a target program to run on a simulation system architecture of target embedded hardware at a plurality of preset frequencies through simulation software, and obtaining execution logs under different preset frequencies; the total dynamic energy consumption of the target program in the preset time period under different preset frequencies is obtained; and under different preset frequencies, performing linear fitting on the linear polynomial function by using the total dynamic energy consumption of the target program in a preset time period, the type of each instruction and the execution times of each instruction, and constructing an energy consumption estimation equation set under the preset frequencies, so as to construct a multi-frequency instruction-level energy consumption estimation model. And performing dynamic energy consumption estimation on each instruction of the to-be-estimated program. According to the method and the device, the accuracy of energy consumption estimation of different embedded programs on a hardware platform is improved, the energy optimization process of programming is simplified, and meanwhile, the characterization capability of an energy consumption estimation result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of embedded energy consumption estimation, and in particular to a method, system, device, medium and product for estimating instruction-level energy consumption of embedded programs. Background Art

[0002] With the rapid development of the Internet of Things (IoT) and smart devices, embedded systems are playing an increasingly important role in our daily lives. These systems are often used in portable devices, home appliances, automotive electronics, and other fields, making energy management particularly important. Embedded instruction-level energy estimation, a technique for evaluating the energy consumption of each instruction executed in an embedded system, helps designers make more informed decisions during system development. The characteristics of embedded systems make energy estimation a critical task. To achieve accurate energy estimation, developers typically employ a variety of methods. Model-based estimation methods utilize physical or empirical models to estimate instruction energy consumption, while simulation and emulation methods utilize circuit simulation tools or system-level simulation tools for analysis. Dynamic analysis methods utilize current probes or power analyzers to monitor the actual program execution in real time.

[0003] However, current approaches to computing energy consumption modeling focus less on specific instructions, making data difficult to transfer across different hardware. This makes it impossible to use a universal energy consumption model to estimate energy consumption across different embedded hardware. Furthermore, current approaches to computing energy consumption modeling lack a clear understanding of the relationship between specific instruction energy consumption models and hardware frequency, failing to reflect the impact of hardware frequency on instruction energy consumption. Consequently, energy consumption estimates lack robust characterization capabilities. Summary of the Invention

[0004] The purpose of this application is to provide an instruction-level energy consumption estimation method, system, device, medium and product for embedded programs, which can improve the accuracy of energy consumption estimation of different embedded programs on hardware platforms, simplify the energy optimization process of program writing, and improve the characterization ability of energy consumption estimation results.

[0005] To achieve the above objectives, this application provides the following solutions:

[0006] In the first aspect, the present application provides an instruction-level energy consumption estimation method for an embedded program, the method comprising: constructing a simulation system architecture for target embedded hardware; running the target program on the simulation system architecture at multiple preset frequencies, and obtaining execution logs at different preset frequencies; wherein the execution logs are the type of each instruction of the target program within a preset time period and the number of executions of each instruction; running the target program at different preset frequencies on the target embedded hardware, and obtaining the total dynamic energy consumption of the target program in the preset time period at different preset frequencies; at different preset frequencies, using the total dynamic energy consumption of the target program in the preset time period, the type of each instruction, and the number of executions of each instruction, linearly fitting a linear polynomial function, determining the coefficients of the linear polynomial function, and constructing a set of energy consumption estimation equations at the preset frequencies; using the set of energy consumption estimation equations at all preset frequencies to construct a multi-frequency instruction-level energy consumption estimation model; performing dynamic energy consumption estimation on each instruction of the program to be estimated through the multi-frequency instruction-level energy consumption estimation model, and summing up to obtain the dynamic energy consumption estimation result of the program to be estimated.

[0007] In the second aspect, the present application provides an instruction-level energy consumption estimation system for an embedded program, the instruction-level energy consumption estimation system for the embedded program comprising: a system construction module, a log generation module, a program running module, a fitting module, a model construction module and an energy consumption estimation module; a system construction module, the system construction module being used to construct a simulation system architecture for target embedded hardware; a log generation module, the log generation module being used to run the target program on the simulation system architecture at multiple preset frequencies, and obtain execution logs at different preset frequencies; wherein the execution log is the type of each instruction and the number of executions of each instruction of the target program within a preset time period; a program running module, the program running module being used to run the target program on the target embedded hardware at different preset frequencies, A target program is obtained to obtain the total dynamic energy consumption of the target program in a preset time period at different preset frequencies; a fitting module is used to perform linear fitting on a linear polynomial function at different preset frequencies using the total dynamic energy consumption of the target program in a preset time period, the type of each instruction and the number of executions of each instruction, determine the coefficients of the linear polynomial function, and construct an energy consumption estimation equation group at the preset frequency; a model construction module is used to construct a multi-frequency instruction-level energy consumption estimation model using the energy consumption estimation equation group at all preset frequencies; an energy consumption estimation module is used to perform dynamic energy consumption estimation on each instruction of the program to be estimated using the multi-frequency instruction-level energy consumption estimation model, and add up to obtain the dynamic energy consumption estimation result of the program to be estimated.

[0008] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned instruction-level energy consumption estimation method for embedded programs.

[0009] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned instruction-level energy consumption estimation method for embedded programs.

[0010] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the above-mentioned instruction-level energy consumption estimation method for embedded programs when executed by a processor.

[0011] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0012] This application constructs a simulation system architecture of the target embedded hardware and uses it to run the target program, obtains the type of each instruction and the number of executions of each instruction in the target program within a preset time period, and linearly fits the linear polynomial function in combination with the target program's running energy consumption on the actual target embedded hardware to obtain a set of energy consumption estimation equations at each preset frequency. In this way, a multi-frequency instruction-level energy consumption estimation model is constructed that contains the corresponding energy consumption of different instructions at different frequencies. This model is then used to estimate the energy consumption of each instruction of other programs at any frequency, thereby achieving accurate estimation of the dynamic energy consumption of the program to be estimated, thereby simplifying the energy optimization process of program writing. Since the estimation is performed according to different preset frequencies during the energy consumption estimation process, the influence of frequency on instruction energy consumption is taken into account, thereby improving the characterization ability of the energy consumption estimation results. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments. 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 creative work.

[0014] Figure 1 A flowchart of an instruction-level energy consumption estimation method for an embedded program provided in an embodiment of the present application.

[0015] Figure 2 A schematic diagram of the modeling process of the multi-frequency instruction-level energy consumption estimation model provided in an embodiment of the present application.

[0016] Figure 3A schematic diagram of the structure of an instruction-level energy consumption estimation system for an embedded program provided in an embodiment of the present application.

[0017] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0019] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0020] Example 1, as Figure 1-Figure 2 As shown, this embodiment provides an instruction-level energy consumption estimation method for an embedded program, comprising the following steps:

[0021] S1. Build the simulation system architecture of the target embedded hardware.

[0022] Optionally, the simulation software for building the simulation system architecture is Gem5.

[0023] S2. Run the target program at multiple preset frequencies on the simulation system architecture and obtain execution logs at different preset frequencies; wherein the execution log is the type of each instruction and the number of executions of each instruction in the target program within a preset time period (time slot).

[0024] Optionally, target programs include:

[0025] 1. Encryption algorithm: AES, RSA, etc.

[0026] 2. Signal processing algorithms: FFT, etc.

[0027] 3. Compression algorithm: Huffman coding, Lempel-Ziv-Welch (LZW) algorithm, etc.

[0028] Optional embedded hardware includes: Raspberry Pi, Arduino development board, STM32 series microcontroller development board, etc.

[0029] Optionally, the preset time period is 0-100ms.

[0030] Furthermore, before obtaining the execution logs at different preset frequencies, the method further includes: recording in real time the type of each instruction executed in the assembly language program converted by the target program during the running of the target program at multiple preset frequencies and the number of times each instruction is executed.

[0031] S3. Run the target program at different preset frequencies on the target embedded hardware to obtain the total dynamic energy consumption of the target program at different preset frequencies in a preset time period.

[0032] Furthermore, the target program is run on the target embedded hardware at different preset frequencies to obtain the total dynamic energy consumption of the target program at different preset frequencies in a preset time period, which specifically includes the following steps:

[0033] S31. Run the target program at different preset frequencies on the target embedded hardware.

[0034] S32. Obtain the power of the target program in a preset time period at different preset frequencies through high-frequency current sampling.

[0035] S33. Under different preset frequencies, the total dynamic energy consumption of the target program in the preset time period is obtained according to the power calculation of the target program in the preset time period.

[0036] Furthermore, the calculation formula for the total dynamic energy consumption of the target program in the preset time period is as follows:

[0037]

[0038] E(i,f)=P(i,f)×t.

[0039] Where, E total is the total dynamic energy consumption of the target program in the preset time period, N i is the number of instructions i, I is the total number of instructions, f is the preset frequency, E(i,f) is the dynamic energy consumption of instruction i when the target program runs at the preset frequency f within the preset time period t, and P(i,f) is the power of instruction i when the target program runs at the preset frequency f.

[0040] In actual application, embedded energy consumption can be divided into static power consumption and dynamic power consumption.

[0041] Static power consumption can be assumed to be a constant parameter, while dynamic power consumption can be expressed as:

[0042] P dynamic =ACV 2 f.

[0043] Where A represents the number of switches per clock cycle (switching activity), C is the capacitance, V is the supply voltage, and f is the preset frequency (clock frequency). The power consumption per time unit of a CMOS-based processor is highly correlated with the supported voltage and frequency. Increasing the frequency or number of cores can improve performance. Typically, a CPU can support multiple operating frequencies. The frequency f and voltage can be considered to have a linear relationship: V = βf.

[0044] Therefore, dynamic power consumption can be further simplified as follows:

[0045] P dynamic =E(i,f).

[0046] E(i,f)=ACβ 2 f 3 .

[0047] It can be seen that power consumption is proportional to the cube of the frequency.

[0048] S4. Under different preset frequencies, the total dynamic energy consumption of the target program within the preset time period, the type of each instruction, and the number of executions of each instruction are used to perform linear fitting on the linear polynomial function, determine the coefficients of the linear polynomial function, and construct a set of energy consumption estimation equations under the preset frequency.

[0049] Optionally, the linear fitting method is least squares fitting.

[0050] S5. Utilize the energy consumption estimation equation group under all preset frequencies to construct a multi-frequency instruction-level energy consumption estimation model.

[0051] S6. Perform dynamic energy consumption estimation on each instruction of the program to be estimated using a multi-frequency instruction-level energy consumption estimation model, and add up the dynamic energy consumption estimation results of the program to be estimated.

[0052] In actual application, the instruction-level energy consumption estimation method of embedded programs is as follows:

[0053] The first step is to obtain the simulation system architecture of the target embedded hardware through Gem5 simulation, and obtain the execution log of the target program at a certain frequency. According to the preset time period (given time slot), each log contains the specific execution instruction content.

[0054] The second step is to run the same target program on the hardware platform at the same fixed frequency as the Gem5 simulation, and obtain the power of each time slot through high-frequency current sampling.

[0055] The third step is to assume that the energy model is a linear polynomial function, and use the specific instructions running in each time slot and the corresponding energy consumption data to establish a set of equations to calculate the energy consumption of each instruction, thereby quantifying the energy consumption differences between different instructions.

[0056] Step 4: Repeat the above steps at different operating frequencies to obtain the instruction energy consumption set under different conditions, and establish a comprehensive multi-frequency instruction energy consumption model (multi-frequency instruction-level energy consumption estimation model).

[0057] Step 5: Based on the energy consumption of the instruction model obtained, it can be applied to other target programs. The instruction set is obtained through Gem5 simulation, and the energy consumption at a specific operating frequency is calculated without the need to repeatedly measure each program.

[0058] The following takes the Fast Fourier Transform (FFT) embedded program as an example for detailed explanation:

[0059] We selected a Raspberry Pi as the target hardware. We first configured Gem5 based on its hardware architecture. Within this architecture, we simulated the FFT algorithm at a specific frequency, generating a run log. We then ran the algorithm at the same frequency on the physical hardware platform, sampling high-frequency current and integrating the energy consumption over each set time period. We then conducted these experiments at different frequencies and, using the previously proposed instruction-level energy consumption estimation method, derived an instruction-level energy consumption model for the FFT algorithm on the Raspberry Pi.

[0060] Based on the instruction energy consumption characteristics of the target hardware, lower-energy instructions are selected to implement operations in the FFT algorithm to reduce energy consumption. For example, certain compound instructions may consume less energy than a combination of multiple simple instructions. By analyzing the instruction energy consumption model, alternative low-energy instruction sequences can be identified to achieve energy optimization. This instruction energy consumption model can be similarly applied to other algorithm optimizations on the same hardware platform, allowing the energy consumption of running at different frequencies to be inferred during the optimization process without the need for repeated measurements.

[0061] The technical effects of this application are as follows:

[0062] This application improves the accuracy of energy consumption estimation for different embedded programs on hardware platforms. Compared with directly measuring the total energy consumption of the embedded system, this application analyzes the fine-grained energy cost of the target program, thereby reducing repeated measurement operations. Based on this model, the energy consumption of the program can be quickly estimated when running at different frequencies of the hardware, thereby simplifying the energy optimization process of program writing; by taking into account the influence of hardware execution frequency, the characterization ability of the energy consumption estimation results is improved.

[0063] Example 2, as Figure 3 As shown, the present application also discloses an instruction-level energy consumption estimation system for embedded programs, the system comprising: a system construction module 101, a log generation module 102, a program running module 103, a fitting module 104, a model construction module 105 and an energy consumption estimation module 106;

[0064] System construction module 101, system construction module 101 is used to build a simulation system architecture of the target embedded hardware;

[0065] The log generation module 102 is used to run the target program at multiple preset frequencies on the simulation system architecture and obtain execution logs at different preset frequencies; wherein the execution log is the type of each instruction and the number of times each instruction is executed in the target program within a preset time period;

[0066] The program running module 103 is used to run the target program at different preset frequencies on the target embedded hardware, and obtain the total dynamic energy consumption of the target program at different preset frequencies in a preset time period;

[0067] The fitting module 104 is used to perform linear fitting on a linear polynomial function at different preset frequencies using the total dynamic energy consumption of the target program within a preset time period, the type of each instruction, and the number of executions of each instruction, determine the coefficients of the linear polynomial function, and construct a set of energy consumption estimation equations at the preset frequencies;

[0068] The model building module 105 is used to build a multi-frequency instruction-level energy consumption estimation model using the energy consumption estimation equation group under all preset frequencies;

[0069] The energy consumption estimation module 106 is used to perform dynamic energy consumption estimation on each instruction of the program to be estimated by using a multi-frequency instruction-level energy consumption estimation model, and add up the dynamic energy consumption estimation results of the program to be estimated.

[0070] Furthermore, before obtaining the execution logs at different preset frequencies, the method further includes: recording in real time the type of each instruction executed in the assembly language program converted by the target program during the running of the target program at multiple preset frequencies and the number of times each instruction is executed.

[0071] Furthermore, the total dynamic energy consumption of the target program in a preset time period is obtained, specifically including: running the target program at different preset frequencies on the target embedded hardware; obtaining the power of the target program in a preset time period at different preset frequencies through high-frequency current sampling; and obtaining the total dynamic energy consumption of the target program in the preset time period based on the power of the target program in the preset time period at different preset frequencies.

[0072] Furthermore, the calculation formula for the total dynamic energy consumption of the target program in the preset time period is as follows:

[0073]

[0074] E(i,f)=P(i,f)×t.

[0075] Where, E total is the total dynamic energy consumption of the target program in the preset time period, N i is the number of instructions i, I is the total number of instructions, f is the preset frequency, E(i,f) is the dynamic energy consumption of instruction i when the target program runs at the preset frequency f within the preset time period t, and P(i,f) is the power of instruction i when the target program runs at the preset frequency f.

[0076] Example 3, the present application also provides a computer device, which can be a server or a terminal, and its internal structure diagram can be as follows Figure 4 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store processing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an instruction-level energy consumption estimation method for an embedded program is implemented.

[0077] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0078] In embodiment 4, the present application further provides a computer-readable storage medium storing a computer program, which implements the above methods when executed by a processor.

[0079] Example 5: The present application also provides a computer program product, including a computer program, which implements the above methods when executed by a processor.

[0080] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0081] All actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.

[0082] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0083] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for estimating energy consumption at the instruction level of an embedded program, characterized in that: The method comprises: Build the simulation system architecture of the target embedded hardware; Running the target program on the simulation system architecture at multiple preset frequencies to obtain execution logs at different preset frequencies; wherein the execution logs include the type of each instruction and the number of times each instruction is executed in the target program within a preset time period; Running the target program at different preset frequencies on the target embedded hardware, and obtaining the total dynamic energy consumption of the target program at different preset frequencies in a preset time period; At different preset frequencies, using the total dynamic energy consumption of the target program in a preset time period, the type of each instruction, and the number of executions of each instruction, a linear polynomial function is linearly fitted to determine the coefficients of the linear polynomial function and to construct a set of energy consumption estimation equations at the preset frequencies; A multi-frequency instruction-level energy consumption estimation model is constructed using the energy consumption estimation equations at all preset frequencies; The dynamic energy consumption estimation is performed on each instruction of the program to be estimated by using a multi-frequency instruction-level energy consumption estimation model, and the dynamic energy consumption estimation result of the program to be estimated is obtained by summing up.

2. The method for estimating the energy consumption of an embedded program at the instruction level according to claim 1, wherein: Before obtaining execution logs at different preset frequencies, the following is also included: The type of each instruction executed in the assembly language program converted by the target program during the running process of multiple preset frequencies and the number of execution times of each instruction are recorded in real time.

3. The method for estimating the instruction-level energy consumption of an embedded program according to claim 1, wherein: Run the target program at different preset frequencies on the target embedded hardware, and obtain the total dynamic energy consumption of the target program at different preset frequencies in a preset time period, specifically including: Run the target program at different preset frequencies on the target embedded hardware; By sampling high-frequency current, the power of the target program in a preset time period at different preset frequencies is obtained; At different preset frequencies, the total dynamic energy consumption of the target program in the preset time period is obtained according to the power calculation of the target program in the preset time period.

4. The method for estimating the instruction-level energy consumption of an embedded program according to claim 1, wherein: The calculation formula for the total dynamic energy consumption of the target program in the preset time period is as follows: E(i,f)=P(i,f)×t; Where, E total is the total dynamic energy consumption of the target program in the preset time period, N i is the number of instructions i, I is the total number of instructions, f is the preset frequency, E(i,f) is the dynamic energy consumption of instruction i when the target program runs at the preset frequency f within the preset time period t, and P(i,f) is the power of instruction i when the target program runs at the preset frequency f.

5. An instruction-level energy consumption estimation system for embedded programs, characterized in that: The instruction-level energy consumption estimation system for embedded programs includes: a system construction module, a log generation module, a program running module, a fitting module, a model construction module and an energy consumption estimation module; A system building module, wherein the system building module is used to build a simulation system architecture of the target embedded hardware; A log generation module, the log generation module is used to run the target program on the simulation system architecture at multiple preset frequencies and obtain execution logs at different preset frequencies; wherein the execution log is the type of each instruction of the target program and the number of times each instruction is executed within a preset time period; A program running module, the program running module is used to run the target program at different preset frequencies on the target embedded hardware, and obtain the total dynamic energy consumption of the target program at different preset frequencies in a preset time period; A fitting module, the fitting module being configured to perform linear fitting on a linear polynomial function at different preset frequencies using the total dynamic energy consumption of the target program within a preset time period, the type of each instruction, and the number of executions of each instruction, thereby determining coefficients of the linear polynomial function and constructing a set of energy consumption estimation equations at the preset frequencies; A model building module, wherein the model building module is used to build a multi-frequency instruction-level energy consumption estimation model using a set of energy consumption estimation equations at all preset frequencies; The energy consumption estimation module is used to perform dynamic energy consumption estimation on each instruction of the program to be estimated by using a multi-frequency instruction-level energy consumption estimation model, and add up the dynamic energy consumption estimation results of the program to be estimated.

6. The system for estimating the energy consumption of an embedded program at the instruction level according to claim 5, wherein: Before obtaining execution logs at different preset frequencies, the following is also included: The type of each instruction executed in the assembly language program converted by the target program during the running process of multiple preset frequencies and the number of execution times of each instruction are recorded in real time.

7. The instruction-level energy consumption estimation system for embedded programs according to claim 5, characterized in that: Obtain the total dynamic energy consumption of the target program in a preset time period, including: Run the target program at different preset frequencies on the target embedded hardware; By sampling high-frequency current, the power of the target program in a preset time period at different preset frequencies is obtained; At different preset frequencies, the total dynamic energy consumption of the target program in the preset time period is obtained according to the power calculation of the target program in the preset time period.

8. The instruction-level energy consumption estimation system for embedded programs according to claim 5, characterized in that: The calculation formula for the total dynamic energy consumption of the target program in the preset time period is as follows: E(i,f)=P(i,f)×t; Where, E total is the total dynamic energy consumption of the target program in the preset time period, N i is the number of instructions i, I is the total number of instructions, f is the preset frequency, E(i,f) is the dynamic energy consumption of instruction i when the target program runs at the preset frequency f within the preset time period t, and P(i,f) is the power of instruction i when the target program runs at the preset frequency f.

9. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the instruction-level energy consumption estimation method for an embedded program according to any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for estimating the energy consumption of the embedded program at the instruction level according to any one of claims 1 to 4 is implemented.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for estimating the energy consumption of the embedded program at the instruction level according to any one of claims 1 to 4 is implemented.