Power consumption detection method and device, storage medium and electronic device
By acquiring the input/output efficiency and operating frequency of memory, and using a pre-built memory power consumption model for power consumption detection, the problem of neglecting power consumption in existing technologies is solved, and high-precision power consumption prediction and memory optimization are achieved.
Patent Information
- Application Number
- CN202011443835.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-08
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2040-12-08
AI Technical Summary
Existing technologies lack attention to the power consumption of electronic devices, focusing only on battery capacity while ignoring actual power consumption issues.
By acquiring the memory's input/output efficiency, operating frequency, and operating duration, and using a pre-built memory power consumption model for power consumption detection, the operating power consumption of the memory can be predicted in real time.
It enables real-time power consumption detection of electronic device memory, improves the accuracy and efficiency of power consumption prediction, and supports memory optimization operations.
Smart Images

Figure CN114625581B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power consumption detection technology, specifically to a power consumption detection method, device, storage medium, and electronic device. Background Technology
[0002] Currently, electronic devices such as smartphones and tablets have become necessities in people's lives, enabling activities like video calls, online video streaming, and online music listening. These devices are typically battery-powered, which means power consumption. However, current technologies focus primarily on battery capacity, neglecting to consider power consumption. Summary of the Invention
[0003] This application provides a power consumption detection method, apparatus, storage medium, and electronic device, which can realize the power consumption detection of memory in electronic devices.
[0004] In a first aspect, this application provides a power consumption detection method applied to an electronic device, the power consumption detection method comprising:
[0005] Obtain the input / output efficiency of the memory in the electronic device;
[0006] Obtain the N operating frequencies of the memory within a unit time period, and obtain the operating time of the memory at each operating frequency, where N is a positive integer greater than or equal to 1;
[0007] Based on the input / output efficiency, the N operating frequencies, and the corresponding N operating durations, the operating power consumption of the memory is predicted using a pre-built memory power consumption model.
[0008] Secondly, this application provides a power consumption detection device for use in electronic devices, the power consumption detection device comprising:
[0009] An efficiency acquisition module is used to acquire the input / output efficiency of the memory in the electronic device;
[0010] The frequency acquisition module is used to acquire N operating frequencies of the memory within a unit time period, and to acquire the operating time of the memory at each operating frequency, where N is a positive integer greater than or equal to 1.
[0011] The power consumption prediction module is used to predict the operating power consumption of the memory based on the input / output efficiency, the N operating frequencies and the corresponding N operating durations, using a pre-built memory power consumption model.
[0012] Thirdly, this application provides a storage medium storing a computer program that, when loaded by the processor of an electronic device, executes any of the power consumption detection methods provided in this application.
[0013] Fourthly, this application also provides an electronic device, which includes a processor and a memory, the memory storing a computer program, and the processor executing any of the power consumption detection methods provided in this application by loading the computer program.
[0014] The technical solution provided in this application uses the input / output efficiency, operating frequency, and operating duration of the memory in an electronic device as power consumption parameters to pre-model power consumption, thus obtaining a memory power consumption model. This enables the electronic device to obtain N operating frequencies of the memory within a unit of time, as well as the operating duration of the memory at each operating frequency, in real time. Based on the memory's input / output efficiency, the aforementioned N operating frequencies, and the corresponding N operating durations, the pre-built memory power consumption model is used to predict the memory's operating power consumption, thereby achieving power consumption detection of the memory in the electronic device. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating a power consumption detection method provided in an embodiment of this application.
[0017] Figure 2 This is a schematic diagram of the power consumption parameters selected for modeling by the electronic device in the embodiments of this application.
[0018] Figure 3 This is an example diagram of measuring memory power consumption using a power consumption board in an embodiment of this application.
[0019] Figure 4 This is a schematic diagram of the memory power consumption model obtained by using input / output efficiency, operating frequency, and operating time as power consumption parameters in the embodiments of this application.
[0020] Figure 5 This is a schematic diagram illustrating how the electronic device obtains the operating frequency and corresponding operating duration of the memory within a unit of time in an embodiment of this application.
[0021] Figure 6 This is a schematic diagram of the connection of internal components of the electronic device in the embodiments of this application.
[0022] Figure 7 This is a schematic diagram of how an electronic device predicts memory power consumption through a power consumption server in an embodiment of this application.
[0023] Figure 8This is a schematic diagram of an electronic device performing big data analysis through an analysis server in an embodiment of this application.
[0024] Figure 9 This is another flowchart illustrating the power consumption detection method provided in this application embodiment.
[0025] Figure 10 This is an example diagram showing the results of a comparative experiment conducted in the embodiments of this application.
[0026] Figure 11 This is a schematic diagram of the power consumption detection device provided in the embodiments of this application.
[0027] Figure 12 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0028] It should be noted that the principles of this application are illustrated by example in a suitable computing environment. The following description is based on the specific embodiments of this application that are illustrated, and should not be regarded as limiting other specific embodiments not detailed herein.
[0029] It should be noted that the relational terms such as "first" and "second" used in the following embodiments of this application are only used to distinguish one object or operation from another object or operation, and are not intended to limit the existence of an actual sequential relationship between these objects or operations.
[0030] This application provides a power consumption detection method, a power consumption detection device, a storage medium, and an electronic device. The power consumption detection method can be implemented using the power consumption detection device provided in this application embodiment, or an electronic device integrating the power consumption detection device. The power consumption detection device can be implemented in hardware or software. The electronic device can be a battery-powered portable electronic device such as a smartphone, tablet computer, PDA, or laptop computer, or a fixed electronic device powered by AC power such as a desktop computer or smart advertising machine.
[0031] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating the power consumption detection method provided in an embodiment of this application. This power consumption detection method is applied to electronic devices, such as... Figure 1 As shown, the flow of the power consumption detection method provided in this application embodiment can be as follows:
[0032] In 110, the input / output efficiency of the memory in the electronic device is obtained.
[0033] Memory, also known as internal memory or main memory, is used to temporarily store data processed by the processor and data exchanged with external memory. Electronic devices such as smartphones and tablets typically have memory, and all applications deployed on these devices run within memory, requiring the processor to access it frequently. Therefore, real-time monitoring of memory power consumption is crucial.
[0034] To achieve real-time detection of memory power consumption, this application provides a power consumption detection method.
[0035] In this application, a power consumption model corresponding to the memory is pre-built, denoted as the memory power consumption model, which is configured to be used for real-time prediction of memory power consumption.
[0036] For example, the memory power consumption model can be constructed as follows:
[0037] First, based on expert experience, possible power consumption parameters are screened and recorded as candidate power consumption parameters. Power consumption parameters can be understood as parameters that have some correlation with power consumption (such as a linear relationship). For example, for memory, candidate power consumption parameters can be any operating parameter of the memory, such as the memory's operating frequency and data bandwidth.
[0038] Please refer to Figure 2 After filtering out the candidate power consumption parameters, select one candidate power consumption parameter and lock the selected candidate power consumption parameter.
[0039] Then, the memory was brought to saturation, and the power consumption of the memory was measured using a power consumption board (for example, please refer to...). Figure 3 The power consumption board includes a power management chip, a current strategy device, and sampling resistors. The power management chip is responsible for powering the memory, with V1 and V2 being the memory's power supplies. The sampling resistors are connected in series in each power supply circuit. The current passing through the circuit is measured using a current measurement device to obtain the actual power consumption of the memory. Candidate power consumption parameters are then associated with and stored with the actual power consumption as a reference pair for power consumption modeling. For example, this can be stored in the form of a power consumption modeling reference table.
[0040] Candidate power consumption parameters Actual power consumption Parameter value 1 Power consumption value 1 Parameter value 2 Power consumption value 2 Parameter value 3 Power consumption value 3 Parameter value 3 Power consumption value 4
[0041] For example, when a candidate power consumption parameter is "parameter value 1", the measured power consumption value is "power consumption value 1".
[0042] As described above, other candidate power consumption parameters are selected for further measurement. Ultimately, reference pairs are obtained, consisting of different candidate power consumption parameters and measured power consumption. These reference pairs form a reference pair set. Then, a pre-configured big data analysis strategy is used to perform big data analysis on the reference pair set, thereby identifying power consumption parameters related to memory. It is understood that the analyzed power consumption parameters can be one or multiple. Correspondingly, when constructing the power consumption model, all analyzed power consumption parameters or only a portion of them can be used.
[0043] For example, suppose we analyze two power consumption parameters, A and B, where power consumption parameter A accounts for 90% of the measured memory power consumption, and power consumption parameter B accounts for 10%. Optionally, if prediction accuracy is prioritized, a memory power consumption model can be constructed based on power consumption parameter A and power consumption parameter B; if prediction efficiency is prioritized, a memory power consumption model can be constructed based on power consumption parameter A alone.
[0044] As shown above, after determining the power parameters used to construct the memory power consumption model, the correlation between the power parameters and the corresponding measured power consumption is analyzed, and the relationship between the power parameters and the power consumption is fitted as a function of the power parameters and the power consumption, which serves as the memory power consumption model.
[0045] For example, please refer to Figure 4 In this embodiment of the application, the power consumption parameters used to construct the memory power consumption model are the memory's input / output efficiency, operating frequency, and operating time at that operating frequency.
[0046] As shown above, after the memory power consumption model is pre-built, it can be deployed directly on the electronic device or on a cloud server, where the server provides power consumption prediction services for the electronic device.
[0047] Thus, using the pre-built memory power consumption model, electronic devices can detect memory power consumption in real time.
[0048] Specifically, the electronic device triggers power consumption detection when it detects a preset target event that triggers power consumption detection. The target event can be configured by those skilled in the art according to actual needs, and no specific limitations are imposed here.
[0049] For example, the configured target events include, but are not limited to:
[0050] (1) Whenever new work is generated in memory (i.e., when there is a read / write operation on memory).
[0051] (2) Switch to the application running in the foreground;
[0052] (3) Overall temperature overheating (which can be defined by a person skilled in the art based on experience);
[0053] (4) Screen on / off switching;
[0054] (5) Unplug / plug the charging cable;
[0055] (6) Power consumption reaches the set value (which can be determined by a person skilled in the art according to actual needs, such as 10%).
[0056] (7) The preset detection cycle is reached (the value can be determined by a person skilled in the art according to actual needs, such as 1 minute).
[0057] As mentioned above, the memory power consumption model in this application is constructed using the memory's input / output efficiency, operating frequency, and corresponding operating time as power consumption parameters. Accordingly, when power consumption detection is triggered, the electronic device needs to obtain the memory's input / output efficiency.
[0058] In 120, obtain the N operating frequencies of the electronic device's memory within a unit of time, and obtain the operating time of the memory at each operating frequency, where N is a positive integer greater than or equal to 1.
[0059] In addition to obtaining the input / output efficiency of the memory, the electronic device also obtains N operating frequencies of the memory within a unit of time, where N is a positive integer greater than or equal to 1.
[0060] It should be noted that the value of the unit duration is not specifically limited in the embodiments of this application, and can be configured by those skilled in the art according to actual needs. For example, the unit duration in the embodiments of this application can be configured as 1 second.
[0061] In addition to obtaining the N operating frequencies of its memory within a unit of time, the electronic device also obtains the operating time of the memory at each operating frequency.
[0062] For example, please refer to Figure 5 Let T be the unit duration. The electronic device obtains four operating frequencies within the unit duration T, namely operating frequency f1, operating frequency f2, operating frequency f3 and operating frequency f4, and obtains the operating duration t1 at operating frequency f1, the operating duration t2 at operating frequency f2, the operating duration t3 at operating frequency f3 and the operating duration t4 at operating frequency f4.
[0063] In 130, the operating power consumption of the memory is predicted by a pre-built memory power consumption model based on the input / output efficiency, N operating frequencies and corresponding N operating durations.
[0064] As described above, in this embodiment of the application, a memory power consumption model is pre-constructed to describe the correlation between input / output efficiency, operating frequency, operating duration, and memory power consumption. Accordingly, after obtaining the memory's input / output efficiency, and the N operating frequencies of the memory within a unit of time and the operating duration of each operating frequency, the electronic device can predict the memory's power consumption based on the obtained input / output efficiency, N operating frequencies, and corresponding N operating durations through the pre-constructed memory power consumption model, and denoted as the operating power consumption.
[0065] As shown above, this application uses the input / output efficiency, operating frequency, and operating duration of the memory in an electronic device as power consumption parameters to pre-model the power consumption, thus obtaining a memory power consumption model. This enables the electronic device to obtain the N operating frequencies of the memory within a unit of time, as well as the operating duration of the memory at each operating frequency, in real time. Based on the memory's input / output efficiency, the aforementioned N operating frequencies, and the corresponding N operating durations, the pre-built memory power consumption model is used to predict the memory's operating power consumption, thereby achieving power consumption detection of the memory in the electronic device.
[0066] Optionally, in one embodiment, after predicting the memory's operating power consumption using a pre-built memory power consumption model based on input / output efficiency, N operating frequencies, and corresponding N operating durations, the method further includes:
[0067] Store the power consumption of the memory in the database.
[0068] In this embodiment, the type of database used to store the aforementioned operating power consumption is not specifically limited, and can be selected by those skilled in the art according to the actual situation, such as an SQLite database.
[0069] Optionally, in one embodiment, the operating power consumption of the memory is predicted using a pre-built memory power consumption model based on input / output efficiency, N operating frequencies, and corresponding N operating durations, including:
[0070] (1) Based on the preset correspondence between measurement power and working frequency, determine the measurement power corresponding to each of the N working frequencies;
[0071] (2) In the power consumption model, the operating power consumption of the memory is determined based on the input and output efficiency, the measured power and operating time corresponding to each of the N operating frequencies.
[0072] It should be noted that the correspondence between measured power and operating frequency was obtained in advance through actual measurement.
[0073] For example, taking a certain operating frequency supported by the memory as an example, the memory is locked to operate at that frequency, and the full bandwidth power of the memory at that operating frequency is measured using a power measurement device. The average value of multiple measurements is taken as the measurement corresponding to that operating frequency. In this way, the power corresponding to different operating frequencies can be measured, thereby establishing the correspondence between measured power and operating frequency.
[0074] Accordingly, in this embodiment, based on the correspondence between the measured power and the operating frequency, the electronic device determines the measured power corresponding to each of the aforementioned N operating frequencies, and then substitutes the aforementioned input / output efficiency, as well as the measured power and operating time corresponding to each of the N operating frequencies, into the pre-built memory power consumption model. In the power consumption model, the operating power consumption of the memory is determined according to the input / output efficiency, the measured power and operating time corresponding to each of the N operating frequencies.
[0075] Optionally, in one embodiment, the memory power consumption model includes:
[0076]
[0077] Where P represents the power consumption of the memory, T represents the unit time, e represents the input / output efficiency of the memory, and p i t represents the measured power corresponding to the i-th operating frequency. i This represents the working duration of the i-th working frequency, where i∈[0,N].
[0078] Optionally, in one embodiment, the electronic device further includes a bus monitor, which obtains the input / output efficiency of the memory from the bus monitor, and obtains N operating frequencies of the memory within a unit of time, and the operating time at each operating frequency.
[0079] Please refer to Figure 6 Electronic devices typically include memory, image signal processors, graphics processors, and central processing units (CPUs). These devices are connected via a bus, enabling data exchange between them. For example, the CPU accesses memory via the bus. Furthermore, this embodiment also includes a bus monitor connected to the bus. This bus monitor is configured to monitor the data transmitted on the bus. Using this bus monitor, the memory's input / output efficiency, N operating frequencies of the memory within a unit of time, and the operating time at each frequency can be directly obtained.
[0080] Optionally, in one embodiment, the operating power consumption of the memory is predicted using a pre-built memory power consumption model based on input / output efficiency, N operating frequencies, and corresponding N operating durations, including:
[0081] (1) Send the aforementioned input / output efficiency, N operating frequencies and corresponding N operating durations to the preset power consumption server, and instruct the power consumption server to input the aforementioned input / output efficiency, N operating frequencies and corresponding N operating durations into the locally deployed memory power consumption model to obtain the operating power consumption output by the memory power consumption model;
[0082] (2) Receive the operating power consumption returned by the power consumption server.
[0083] In this embodiment of the application, a power consumption server is provided, which is deployed with a pre-built memory power consumption model and is configured to provide power consumption prediction services to electronic devices.
[0084] For example, please refer to Figure 7 Network access devices provide network access services to electronic devices, enabling them to access the Internet. After obtaining the input / output efficiency of its memory, as well as the N operating frequencies of the memory within a unit of time and the operating duration of each frequency, the electronic device packages the input / output efficiency, the N operating frequencies, and the corresponding N operating durations into an input data packet and transmits it to the power consumption server on the other side of the Internet.
[0085] On the other hand, in addition to deploying a memory power consumption model, the power consumption server also stores the correspondence between measured power and operating frequency. Accordingly, after receiving an input data packet from an electronic device, the power consumption server parses out the input / output efficiency, N operating frequencies, and N operating durations. Based on the above correspondence between measured power and operating frequency, it converts the N operating frequencies into corresponding N measured powers. Then, it inputs the converted N measured powers, the aforementioned N operating durations, and the aforementioned input / output efficiency into the locally deployed memory power consumption model to predict the memory's operating power consumption.
[0086] After predicting the memory's operating power consumption, the power server returns this power consumption to the electronic device. Correspondingly, the electronic device receives the operating power consumption returned by the power server.
[0087] Optionally, the aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations are sent to a preset power consumption server, including:
[0088] When the electronic device is running a preset application, the aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations are sent to a preset power consumption server; or
[0089] When the operating load of the electronic device is greater than or equal to a preset load, the aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations are sent to a preset power consumption server; or
[0090] When the remaining battery power of the electronic device is less than the preset battery power, the aforementioned input / output efficiency, N operating frequencies and the corresponding N operating durations are sent to the preset power consumption server.
[0091] In this embodiment, the memory power consumption model can be deployed simultaneously on both the electronic device and the power consumption server. Accordingly, the electronic device only requests power consumption prediction from the power consumption server under specific conditions, while under non-specific conditions, it uses its own deployed memory power consumption model for power consumption prediction.
[0092] For example, specific conditions configured in this application embodiment include:
[0093] Electronic devices operate with preset applications;
[0094] Alternatively, the operating load of the electronic device is greater than or equal to the preset load;
[0095] Alternatively, the remaining battery power of the electronic device is less than the preset battery power.
[0096] It should be noted that the configuration of the preset applications, preset loads and preset power in the embodiments of this application is not specifically limited, and can be configured by those skilled in the art according to actual needs.
[0097] For example, preset applications can be configured by default on electronic devices, or they can be configured by the electronic device based on user input. Among them, electronic devices can default to configuring applications with high user experience requirements, such as game applications and live streaming applications, as preset applications.
[0098] Optionally, in one embodiment, after predicting the memory's operating power consumption using a pre-built memory power consumption model based on input / output efficiency, N operating frequencies, and corresponding N operating durations, the method further includes:
[0099] (1) The power consumption is transmitted to the preset analysis server, so that the analysis server performs big data analysis based on the power consumption according to the preset analysis strategy and obtains the analysis results;
[0100] (2) Receive the analysis results returned by the analysis server.
[0101] In this embodiment of the application, an analysis server is provided, which is configured to provide big data analysis services to electronic devices.
[0102] For example, please refer to Figure 8Network access devices provide network access services to electronic devices, enabling them to access the Internet. After predicting the memory's operating power consumption, the electronic device transmits the predicted power consumption to an analysis server on the other side of the Internet via the network access device. The electronic device can transmit the power consumption data immediately after each power consumption prediction, at preset time intervals, or after predicting a first preset amount of power consumption.
[0103] On the other hand, the analysis server is configured with an analysis strategy that describes how to perform big data analysis on the operating power consumption from electronic devices. This strategy can be configured by those skilled in the art according to actual needs, and no specific limitations are imposed in this embodiment. For example, an analysis strategy for analyzing user power consumption behavior can be configured. Correspondingly, when the amount of operating power consumption received reaches a second preset quantity (i.e., the minimum amount of data required for the analysis server to perform big data analysis according to the analysis strategy), the analysis server performs big data analysis using the second preset quantity of operating power consumption, including the operating power consumption transmitted by the electronic device in the current transmission, according to the configured analysis strategy, and obtains the corresponding analysis results. After receiving the analysis results, the analysis server returns the analysis results to the electronic device.
[0104] Correspondingly, the electronic device will receive the analysis results returned by the analysis server.
[0105] After receiving the analysis results returned by the analysis server, the electronic device can output the analysis results according to the configured output strategy. The configuration of this output strategy is not specifically limited here and can be configured by those skilled in the art according to actual needs, including but not limited to audio, video, text, and image output methods.
[0106] It should be noted that the values of the above preset time interval, the first preset quantity, and the second preset quantity are not specifically limited in the embodiments of this application, and can be configured by those skilled in the art according to actual needs.
[0107] Optionally, in one embodiment, after receiving the analysis results returned by the analysis server, the method further includes:
[0108] Determine the memory optimization operations corresponding to the aforementioned analysis results, and execute the determined memory optimization operations.
[0109] In this embodiment, the electronic device further performs targeted memory optimization based on the aforementioned analysis results. Specifically, after receiving the analysis results returned by the analysis server, the electronic device determines the corresponding memory optimization operation according to a pre-configured memory optimization strategy, and executes the memory optimization operation to optimize the memory. It should be noted that the configuration of the memory optimization strategy in this embodiment is not specifically limited and can be configured by those skilled in the art according to actual needs.
[0110] For example, if the analysis results show that a user's frequently used application is a high-power application, and the electronic device determines the memory optimization operation according to the memory optimization strategy to increase the memory's operating voltage, then the electronic device will increase the memory's operating voltage the next time the aforementioned high-power application is launched.
[0111] Optionally, in one embodiment, before obtaining the input / output efficiency of the memory in the electronic device, the method further includes:
[0112] (1) Obtain a pre-built general memory power consumption model;
[0113] (2) Adapt the general memory power consumption model according to the power consumption characteristics of memory to obtain the memory power consumption model.
[0114] It should be noted that in the embodiments of this application, the specific power consumption characteristics of a particular memory are not considered. Instead, a general memory power consumption model is pre-built using the general power consumption characteristics of memory. This general memory power consumption model can be applied to the power consumption prediction of multiple memories.
[0115] Correspondingly, when electronic devices model the power consumption of their own memory, they can first obtain a pre-built general memory power consumption model, then further obtain the specific power consumption characteristics of that memory, and analyze the correlation between these specific power consumption characteristics and memory power consumption. This correlation can then be used to adaptively process the general memory power consumption model, resulting in a memory power consumption model that is compatible with that specific memory. This effectively improves the efficiency of power consumption modeling for memory.
[0116] Please refer to Figure 9 , Figure 9 This is another flowchart illustrating the power consumption detection method provided in the embodiments of this application, as shown below. Figure 9 As shown, the flow of the power consumption detection method provided in this application embodiment can be as follows:
[0117] In 210, electronic devices acquire a pre-built general memory power consumption model.
[0118] To achieve real-time detection of memory power consumption, this application provides a power consumption detection method.
[0119] In this application, a power consumption model corresponding to the memory is pre-built, denoted as the memory power consumption model, which is configured to be used for real-time prediction of memory power consumption.
[0120] For example, the memory power consumption model can be constructed as follows:
[0121] First, instead of considering the specific power consumption characteristics of individual memory modules, a general memory power consumption model is pre-constructed using the general power consumption characteristics of memory modules. This general memory power consumption model can be applied to power consumption prediction for multiple memory modules. Specifically, in this embodiment, the power consumption parameters used to construct the general memory power consumption model are the operating frequency and the corresponding operating duration.
[0122] Then, when constructing the power consumption model of the memory in the corresponding electronic device, the electronic device first obtains the pre-constructed general memory power consumption model.
[0123] In 220, the electronic device adapts the general memory power consumption model according to the power consumption characteristics of the memory to obtain the memory power consumption model.
[0124] In this process, after obtaining a pre-built general memory power consumption model, the electronic device further obtains the unique power consumption characteristics of the memory in the electronic device, and analyzes the correlation between the unique power consumption characteristics and the memory power consumption. Then, it uses the correlation to adaptively process the general memory power consumption model to obtain a memory power consumption model that is compatible with the memory, thereby efficiently completing the power consumption modeling of the memory.
[0125] In 230, the efficiency of electronic devices in acquiring memory input / output is discussed.
[0126] Specifically, the electronic device triggers power consumption detection when it detects a preset target event that triggers power consumption detection. The target event can be configured by those skilled in the art according to actual needs, and no specific limitations are imposed here.
[0127] For example, the configured target events include, but are not limited to:
[0128] (1) Whenever new work is generated in memory (i.e., when there is a read / write operation on memory).
[0129] (2) Switch to the application running in the foreground;
[0130] (3) Overall temperature overheating (which can be defined by a person skilled in the art based on experience);
[0131] (4) Screen on / off switching;
[0132] (5) Unplug / plug the charging cable;
[0133] (6) Power consumption reaches the set value (which can be determined by a person skilled in the art according to actual needs, such as 10%).
[0134] (7) The preset detection cycle is reached (the value can be determined by a person skilled in the art according to actual needs, such as 1 minute).
[0135] As mentioned above, the memory power consumption model in this application is constructed using the memory's input / output efficiency, operating frequency, and corresponding operating time as power consumption parameters. Accordingly, when power consumption detection is triggered, the electronic device needs to obtain the memory's input / output efficiency.
[0136] In 240, the electronic device obtains N operating frequencies of the memory within a unit of time, and obtains the operating time of the memory at each operating frequency, where N is a positive integer greater than or equal to 1.
[0137] In addition to obtaining the input / output efficiency of the memory, the electronic device also obtains N operating frequencies of the memory within a unit of time, where N is a positive integer greater than or equal to 1.
[0138] It should be noted that the value of the unit duration is not specifically limited in the embodiments of this application, and can be configured by those skilled in the art according to actual needs. For example, the unit duration in the embodiments of this application can be configured as 1 second.
[0139] In addition to obtaining the N operating frequencies of its memory within a unit of time, the electronic device also obtains the operating time of the memory at each operating frequency.
[0140] For example, please refer to Figure 5 Let T be the unit duration. The electronic device obtains four operating frequencies within the unit duration T, namely operating frequency f1, operating frequency f2, operating frequency f3 and operating frequency f4, and obtains the operating duration t1 at operating frequency f1, the operating duration t2 at operating frequency f2, the operating duration t3 at operating frequency f3 and the operating duration t4 at operating frequency f4.
[0141] In 250, the electronic device predicts the operating power consumption of the memory based on the input / output efficiency, N operating frequencies and corresponding N operating durations through a pre-built memory power consumption model.
[0142] As described above, in this embodiment of the application, a memory power consumption model is pre-constructed to describe the correlation between input / output efficiency, operating frequency, operating duration, and memory power consumption. Accordingly, after obtaining the memory's input / output efficiency, and the N operating frequencies of the memory within a unit of time and the operating duration of each operating frequency, the electronic device can predict the memory's power consumption based on the obtained input / output efficiency, N operating frequencies, and corresponding N operating durations through the pre-constructed memory power consumption model, and denoted as the operating power consumption.
[0143] In 260, the electronic device transmits its operating power consumption to a preset analysis server, which then performs big data analysis based on the operating power consumption according to a preset analysis strategy to obtain the analysis results.
[0144] In this embodiment of the application, an analysis server is provided, which is configured to provide big data analysis services to electronic devices.
[0145] For example, please refer to Figure 8 Network access devices provide network access services to electronic devices, enabling them to access the Internet. After predicting the memory's operating power consumption, the electronic device transmits the predicted power consumption to an analysis server on the other side of the Internet via the network access device. The electronic device can transmit the power consumption data immediately after each power consumption prediction, at preset time intervals, or after predicting a first preset amount of power consumption.
[0146] On the other hand, the analysis server is configured with an analysis strategy that describes how to perform big data analysis on the operating power consumption from electronic devices. This strategy can be configured by those skilled in the art according to actual needs, and no specific limitations are imposed in this embodiment. For example, an analysis strategy for analyzing user power consumption behavior can be configured. Correspondingly, when the amount of operating power consumption received reaches a second preset quantity (i.e., the minimum amount of data required for the analysis server to perform big data analysis according to the analysis strategy), the analysis server performs big data analysis using the second preset quantity of operating power consumption, including the operating power consumption transmitted by the electronic device in the current transmission, according to the configured analysis strategy, and obtains the corresponding analysis results. After receiving the analysis results, the analysis server returns the analysis results to the electronic device.
[0147] In 270, the electronic device receives the analysis results returned by the analysis server.
[0148] Correspondingly, the electronic device will receive the analysis results returned by the analysis server.
[0149] After receiving the analysis results returned by the analysis server, the electronic device can output the analysis results according to the configured output strategy. The configuration of this output strategy is not specifically limited here and can be configured by those skilled in the art according to actual needs, including but not limited to audio, video, text, and image output methods.
[0150] In addition, electronic devices can perform targeted optimization based on the aforementioned analysis results. For example, when the analysis results reflect the user's electricity consumption behavior, the electronic device can perform targeted electricity consumption optimization based on the analysis results.
[0151] It should be noted that the values of the above preset time interval, the first preset quantity, and the second preset quantity are not specifically limited in the embodiments of this application, and can be configured by those skilled in the art according to actual needs.
[0152] To verify the performance of the power consumption detection method provided in this application, the following experiment was conducted.
[0153] The electronic device was operated to play a test video in 1-second increments. Within 45 seconds, the power consumption of the electronic device's memory was measured multiple times using a power consumption board, obtaining multiple measured power consumption values. Furthermore, the memory power consumption model provided in this application was used to make multiple predictions, obtaining multiple predicted power consumption values. Based on the multiple measured power consumption values and the multiple predicted power consumption values, a... Figure 10 The power consumption curves shown indicate that the memory power consumption model provided in this application achieves an accuracy of over 80% compared to traditional power board measurement methods, demonstrating high precision.
[0154] Please refer to Figure 11 To better implement the power consumption detection method provided in this application, this application further provides a power consumption detection device 300, which is applied to electronic devices, such as... Figure 10 As shown, the power consumption detection device 300 may include:
[0155] Efficiency acquisition module 310 is used to acquire the input / output efficiency of the memory in an electronic device;
[0156] The frequency acquisition module 320 is used to acquire N operating frequencies of the memory within a unit of time, and to acquire the operating time of the memory at each operating frequency, where N is a positive integer greater than or equal to 1.
[0157] The power consumption prediction module 330 is used to predict the operating power consumption of the memory based on the input / output efficiency, N operating frequencies and corresponding N operating durations, through a pre-built memory power consumption model.
[0158] Optionally, in one embodiment, when predicting the operating power consumption of the memory based on the input / output efficiency, N operating frequencies, and the corresponding N operating durations using a pre-built memory power consumption model, the power consumption prediction module 330 is used to:
[0159] Based on the preset correspondence between measurement power and operating frequency, determine the measurement power corresponding to each of the N operating frequencies.
[0160] In the power consumption model, the operating power consumption of the memory is determined based on the input / output efficiency, the measured power and operating time corresponding to each of the N operating frequencies.
[0161] Optionally, in one embodiment, the memory power consumption model includes:
[0162]
[0163] Where P represents the power consumption of the memory, T represents the unit time, e represents the input / output efficiency of the memory, and p i t represents the measured power corresponding to the i-th operating frequency. i This represents the working duration of the i-th working frequency, where i∈[0,N].
[0164] Optionally, in one embodiment, when predicting the operating power consumption of the memory based on the input / output efficiency, N operating frequencies, and the corresponding N operating durations using a pre-built memory power consumption model, the power consumption prediction module 330 is used to:
[0165] The aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations are sent to a preset power consumption server, and the power consumption server is instructed to input the aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations into the locally deployed memory power consumption model to obtain the operating power consumption output by the memory power consumption model.
[0166] Receive the operating power consumption returned by the power consumption server.
[0167] Optionally, in one embodiment, when sending the aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations to a preset power consumption server, the power consumption prediction module 330 is used to:
[0168] When the electronic device is running a preset application, the aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations are sent to a preset power consumption server; or
[0169] When the operating load of the electronic device is greater than or equal to a preset load, the aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations are sent to a preset power consumption server; or
[0170] When the remaining battery power of the electronic device is less than the preset battery power, the aforementioned input / output efficiency, N operating frequencies and the corresponding N operating durations are sent to the preset power consumption server.
[0171] Optionally, in one embodiment, the power consumption detection device 300 provided in this application further includes an analysis module, which, after predicting the operating power consumption of the memory based on the input / output efficiency, N operating frequencies, and corresponding N operating durations using a pre-built memory power consumption model, is used for:
[0172] The power consumption is transmitted to a preset analysis server, which then performs big data analysis based on the power consumption according to a preset analysis strategy to obtain the analysis results.
[0173] Receive the analysis results returned by the analysis server.
[0174] Optionally, in one embodiment, the power consumption detection device 300 of this application further includes an optimization module, which, after receiving the analysis results returned by the analysis server, is used to:
[0175] Determine the memory optimization operations corresponding to the aforementioned analysis results, and execute the determined memory optimization operations.
[0176] It should be noted that the power consumption detection device 300 provided in this application embodiment belongs to the same concept as the power consumption detection method in the above embodiment. The specific implementation process can be found in the above related embodiments, and will not be repeated here.
[0177] This application also provides an electronic device; please refer to [link / reference]. Figure 12 , Figure 12 This is a schematic diagram of the structure of the electronic device 400 provided in an embodiment of this application.
[0178] The electronic device 400 may include components such as a network interface 410, a memory 420, a central processing unit 430, and a memory 440. Those skilled in the art will understand that... Figure 12 The structure of the electronic device 400 shown does not constitute a limitation on the electronic device 400, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0179] Network interface 410 can be used for network connections between devices.
[0180] Memory 440, also known as internal memory or main memory, is used to temporarily store the processing data of processor 430, as well as data exchanged with external memory.
[0181] Memory 420 can be used to store computer programs and data. The computer programs stored in memory 420 contain executable code. Computer programs can be divided into various functional modules. Central processing unit 430 executes various functional applications and data processing by running the computer programs stored in memory 420.
[0182] The central processing unit 430 is the control center of the electronic device 400. It connects various parts of the electronic device 400 through various interfaces and lines. By running or executing computer programs stored in the memory 420 and calling data stored in the memory 420, it performs various functions of the electronic device 400 and processes data, thereby controlling the electronic device 400 as a whole.
[0183] In this embodiment, the central processing unit 430 in the electronic device 400 loads executable code corresponding to one or more computer programs into the memory 420 according to the following instructions, and the central processing unit 430 executes the following steps:
[0184] Obtain the input / output efficiency of memory 440 in electronic device 400;
[0185] Get N operating frequencies of memory 440 within a unit of time, and get the operating time of memory 440 at each operating frequency, where N is a positive integer greater than or equal to 1;
[0186] Based on input / output efficiency, N operating frequencies and corresponding N operating durations, the operating power consumption of memory 440 is predicted using a pre-built memory power consumption model.
[0187] In one embodiment, when the operating power consumption of memory 440 is predicted using a pre-built memory power consumption model based on input / output efficiency, N operating frequencies, and corresponding N operating durations, the central processing unit 430 executes:
[0188] Based on the preset correspondence between measurement power and operating frequency, determine the measurement power corresponding to each of the N operating frequencies.
[0189] In the power consumption model, the operating power consumption of memory 440 is determined based on the input / output efficiency, the measured power and operating time corresponding to each of the N operating frequencies.
[0190] In one embodiment, the memory power consumption model includes:
[0191]
[0192] Where P represents the power consumption of the memory, T represents the unit time, e represents the input / output efficiency of the memory 440, and p it represents the measured power corresponding to the i-th operating frequency. i This represents the working duration of the i-th working frequency, where i∈[0,N].
[0193] Optionally, in one embodiment, when the operating power consumption of memory 440 is predicted by a pre-built memory power consumption model based on input / output efficiency, N operating frequencies, and corresponding N operating durations, the central processing unit 430 executes:
[0194] The aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations are sent to a preset power consumption server, and the power consumption server is instructed to input the aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations into the locally deployed memory power consumption model to obtain the operating power consumption output by the memory power consumption model.
[0195] Receive the operating power consumption returned by the power consumption server.
[0196] Optionally, in one embodiment, when sending the aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations to a preset power consumption server, the power consumption prediction module 330 is used to:
[0197] When the electronic device 400 is running a preset application, the aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations are sent to a preset power consumption server; or
[0198] When the operating load of electronic device 400 is greater than or equal to a preset load, the aforementioned input / output efficiency, N operating frequencies, and corresponding N operating durations are sent to a preset power consumption server; or
[0199] When the remaining power of electronic device 400 is less than the preset power, the aforementioned input / output efficiency, N operating frequencies and corresponding N operating durations are sent to the preset power consumption server.
[0200] Optionally, in one embodiment, the power consumption detection device 300 provided in this application further includes an analysis module, which, after predicting the operating power consumption of the memory 400 based on the input / output efficiency, N operating frequencies, and corresponding N operating durations using a pre-built memory power consumption model, is used to:
[0201] The power consumption is transmitted to a preset analysis server, which then performs big data analysis based on the power consumption according to a preset analysis strategy to obtain the analysis results.
[0202] Receive the analysis results returned by the analysis server.
[0203] Optionally, in one embodiment, the power consumption detection device 300 of this application further includes an optimization module, which, after receiving the analysis results returned by the analysis server, is used to:
[0204] Determine the memory optimization operations corresponding to the aforementioned analysis results, and execute the determined memory optimization operations.
[0205] It should be noted that the electronic device 400 provided in this application embodiment and the power consumption detection method in the above embodiment belong to the same concept. The specific implementation process can be found in the above related embodiments, and will not be repeated here.
[0206] This application also provides a computer-readable storage medium storing a computer program thereon. When the computer program stored thereon is executed on the central processing unit of the electronic device provided in the embodiments of this application, the central processing unit of the electronic device performs any of the steps in the power consumption detection method suitable for the electronic device described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0207] The above provides a detailed description of a power consumption detection method, apparatus, storage medium, and electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A power consumption detection method, applied to electronic devices, characterized in that, The power consumption detection method includes: Obtain the input / output efficiency of the memory in the electronic device; Obtain the N operating frequencies of the memory within a unit time period, and obtain the operating time of the memory at each operating frequency, where N is a positive integer greater than or equal to 1; Based on the input / output efficiency, the N operating frequencies, and the corresponding N operating durations, the operating power consumption of the memory is predicted using a pre-built memory power consumption model. This includes: determining the measured power corresponding to each of the N operating frequencies based on a preset correspondence between measured power and operating frequency; and determining the operating power consumption in the power consumption model based on the input / output efficiency, the measured power corresponding to each of the N operating frequencies, and the operating duration. The memory power consumption model includes: ; in, The power consumption is represented by T, the unit time is represented by e, and the input / output efficiency is represented by p. i t represents the measured power corresponding to the i-th operating frequency. i Let i represent the working duration corresponding to the i-th working frequency, where i∈[0,N].
2. The power consumption detection method according to claim 1, characterized in that, The step of predicting the operating power consumption of the memory based on the input / output efficiency, the N operating frequencies, and the corresponding N operating durations using a pre-built memory power consumption model further includes: The input / output efficiency, the N operating frequencies and the corresponding N operating durations are sent to a preset power consumption server, and the power consumption server is instructed to input the input / output efficiency, the N operating frequencies and the corresponding N operating durations into the locally deployed memory power consumption model to obtain the operating power consumption output by the memory power consumption model. Receive the operating power consumption returned by the power consumption server.
3. The power consumption detection method according to claim 2, characterized in that, The step of sending the input / output efficiency, the N operating frequencies, and the corresponding N operating durations to a preset power consumption server includes: When the electronic device is running a preset application, the input / output efficiency, the N operating frequencies, and the corresponding N operating durations are sent to a preset power consumption server; or When the operating load of the electronic device is greater than or equal to a preset load, the input / output efficiency, the N operating frequencies, and the corresponding N operating durations are sent to a preset power consumption server; or When the remaining power of the electronic device is less than the preset power, the input / output efficiency, the N operating frequencies, and the corresponding N operating durations are sent to the preset power consumption server.
4. The power consumption detection method according to any one of claims 1-3, characterized in that, After predicting the operating power consumption of the memory using a pre-built memory power consumption model based on the input / output efficiency, the N operating frequencies, and the corresponding N operating durations, the method further includes: The power consumption is transmitted to a preset analysis server, which then performs big data analysis based on the power consumption according to a preset analysis strategy to obtain analysis results. Receive the analysis results returned by the analysis server.
5. The power consumption detection method according to claim 4, characterized in that, After receiving the analysis results returned by the analysis server, the process further includes: Determine the memory optimization operation corresponding to the analysis results, and execute the memory optimization operation.
6. A power consumption detection device, applied to electronic devices, characterized in that, The power consumption detection device includes: An efficiency acquisition module is used to acquire the input / output efficiency of the memory in the electronic device; The frequency acquisition module is used to acquire N operating frequencies of the memory within a unit time period, and to acquire the operating time of the memory at each operating frequency, where N is a positive integer greater than or equal to 1. The power consumption prediction module is used to predict the operating power consumption of the memory based on the input / output efficiency, the N operating frequencies and the corresponding N operating durations through a pre-built memory power consumption model. This includes: determining the measured power corresponding to each of the N operating frequencies based on a preset correspondence between measured power and operating frequency; and determining the operating power consumption in the power consumption model based on the input / output efficiency, the measured power corresponding to each of the N operating frequencies, and the operating duration. The memory power consumption model includes: ; in, The power consumption is represented by T, the unit time is represented by e, and the input / output efficiency is represented by p. i t represents the measured power corresponding to the i-th operating frequency. i Let i represent the working duration corresponding to the i-th working frequency, where i∈[0,N].
7. A storage medium having a computer program stored thereon, characterized in that, The power consumption detection method as described in any one of claims 1-5 is executed when the computer program is loaded by the processor of the electronic device.
8. An electronic device comprising a processor and a memory, the memory storing a computer program, characterized in that, The processor executes the power consumption detection method as described in any one of claims 1-5 by loading the computer program.
Citation Information
Patent Citations
Method for measuring power consumption of CPU (Central Processing Unit) and GPU (Graphics Processing Unit) software on mobile processor
CN104461849A
CPU frequency-adjusting method and device, and processing apparatus
CN108139960A