Hardware resource allocation method, device and equipment of electronic device

By sampling and exponentially weighted verifying the hardware power consumption data of electronic devices in real time, sudden changes in hardware power consumption can be identified, and future resource demands can be predicted. This solves the problem that resource allocation in existing technologies cannot match the differentiated needs of users, and achieves more efficient dynamic adjustment of hardware resources and improved user experience.

CN122152502APending Publication Date: 2026-06-05LCFC HEFEI ELECTRONICS TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LCFC HEFEI ELECTRONICS TECH
Filing Date
2026-02-02
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In existing technologies, the hardware resource allocation mechanism of electronic devices lacks real-time perception and dynamic analysis capabilities, and cannot identify fine-grained operational differences of users in the same application scenario, resulting in resource allocation that cannot match users' differentiated power consumption and resource needs.

Method used

By sampling the hardware power consumption data of electronic devices in real time, fluctuation indicators are determined based on current and historical data, sudden changes in hardware power consumption are identified, and the effectiveness of the changes is verified by exponential weighting. This allows for the prediction of future hardware resource requirements and dynamic adjustment of hardware resource allocation.

Benefits of technology

It enables rapid response to fine-grained user operations, ensures that hardware resource allocation matches user needs, and improves the dynamic performance of electronic devices and the user interaction experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122152502A_ABST
    Figure CN122152502A_ABST
Patent Text Reader

Abstract

The present disclosure provides a hardware resource allocation method, device and equipment of an electronic device, which preliminarily identifies hardware power consumption mutation by sampling the hardware power consumption data of the electronic device in real time and determining the fluctuation index corresponding to the current sampling data. Further, the exponential weighted value of the current sampling data is determined, and when the current exponential weighted value and the exponential weighted value when the last fluctuation index meets the set condition, the mutation is determined as an effective mutation. Furthermore, when the fluctuation index and the exponential weighted value meet the condition at the same time, the future hardware power consumption data is further predicted, and the hardware resource demand information of the electronic device in the next target period is determined in combination with the fluctuation index. The fluctuation of the hardware power consumption data can cover the user's fine-grained operation, and by predicting the future hardware resource demand information, the resources can be prepared in advance, avoiding the situation of insufficient or lagging resources during scene switching, and ensuring smooth user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, and device for allocating hardware resources in an electronic device. Background Technology

[0002] As the application scenarios of electronic devices continue to be segmented and user needs become increasingly dynamic, the relevant hardware resource management mechanisms adopt preset static rules to identify application scenarios, such as pre-setting performance modes, including fixed performance modes such as office mode and game mode. The resource allocation logic is solidified, and users need to manually switch and adjust the hardware resource allocation according to the usage scenario, which is insufficient at the level of refinement. Summary of the Invention

[0003] This disclosure provides a method, apparatus, and device for allocating hardware resources in an electronic device, in order to at least solve the above-mentioned technical problems existing in the prior art.

[0004] A first aspect of this disclosure provides a method for allocating hardware resources in an electronic device, the method comprising:

[0005] Sampling of hardware power consumption data for electronic devices; Based on the current sampling data and the historical sampling data of the previous time period, a fluctuation index of the hardware power consumption data corresponding to the current sampling data is determined. The fluctuation index characterizes the magnitude and direction of the increase in the hardware power consumption of the electronic device. In response to the fluctuation index meeting the set conditions, it is determined that a sudden change has occurred in the hardware power consumption of the electronic device; Determine the exponential weighting value of the current sampled data, and determine the validity of the mutation based on the exponential weighting value. The exponential weighting value represents the baseline power consumption level of the electronic device in the sampling period consisting of the current sampling time and the adjacent preceding time period. In response to the mutation being a valid mutation, a set of predicted hardware power consumption values ​​for the electronic device in the next target time period is determined based on the current sampled data, and the hardware resource requirement information of the electronic device is determined based on the set of predicted hardware power consumption values. The hardware resources of the electronic device are allocated based on the hardware resource requirement information.

[0006] In one possible implementation, determining the fluctuation index of the hardware power consumption data corresponding to the current sampled data based on the current sampled data and historical sampled data from a previous time period includes: From the historical sampling data of the preceding time period, obtain the historical sampling data of a preset time period adjacent to the current sampling time, and determine the instantaneous fluctuation intensity of the first sampling dataset composed of the historical sampling data within the preset time period and the current sampling data; Determine the average fluctuation intensity of the second sampling dataset, which consists of the current sampling data and historical sampling data from the preceding time period; Based on the degree of deviation of the instantaneous fluctuation intensity from the average fluctuation intensity, the fluctuation index of the hardware power consumption data corresponding to the current sampled data is determined.

[0007] In one possible implementation, determining the exponential weighting value of the current sampled data includes: Each of the current sampled data and each historical sampled data in the preceding time period is assigned a corresponding weight, and the weight decreases sequentially as the sampling time goes back; The product of the current sampled data and its corresponding weight is added to the product of each historical sampled data and its corresponding weight in the preceding time period to obtain a weighted fusion result. The ratio of the weighted fusion result to the sum of all weights is then determined to obtain the exponential weighted value of the current sampled data.

[0008] In one possible implementation, determining the validity of the mutation based on the exponential weighting value includes: Determine the exponential weighted value of the previous fluctuation index of the current sampled data when it meets the set conditions. The previous fluctuation index is the fluctuation index that most recently met the fluctuation conditions among all historical fluctuation indices at the current sampling time. If the exponential weighted value of the current sampled data exceeds the exponential weighted value when the previous fluctuation index met the set conditions, the mutation is determined to be a valid mutation.

[0009] In one possible implementation, determining the set of predicted hardware power consumption values ​​for the electronic device in the next target time period based on the current sampled data includes: Determine the power smoothing value of the current sampled data, wherein the power smoothing value represents the actual power consumption of the electronic device after filtering out interference at the current sampling time; Determine the trend change value of the current sampled data, wherein the trend change value characterizes the changing trend of the hardware resource requirements of the electronic device at the current sampling time relative to the previous sampling time; Based on the power smoothing value and the trend change value, predict the power consumption of the electronic device at each sampling moment in the next target time period to obtain the corresponding set of hardware power consumption prediction values.

[0010] In one possible implementation, determining the hardware resource requirements of the electronic device based on the set of predicted hardware power consumption values ​​includes: Based on the overall trend of the hardware power consumption prediction value set, determine the power consumption change trend of the electronic device in the next target time period; Since both the direction of the power consumption change trend and the direction of the hardware power consumption growth of the fluctuation index are positive, the determined hardware resource demand information indicates that there is a hardware resource allocation demand. Since both the direction of the power consumption change trend and the direction of the hardware power consumption growth of the fluctuation index are negative, the determined hardware resource demand information indicates that there is a demand for hardware resource release.

[0011] In one possible implementation, allocating hardware resources of the electronic device based on the hardware power consumption requirement information includes: Determining the hardware resource requirement information includes the existence of hardware resource allocation requirements, and allocating the hardware resources of the electronic device to the corresponding application; The determination of the hardware resource requirement information includes the existence of a hardware resource release requirement, and the recovery of the hardware resources of the electronic device from the corresponding application.

[0012] In one possible implementation, the hardware power consumption data includes at least one of the following: CPU voltage value, GPU voltage value, SSD voltage value, or MEM voltage value.

[0013] A second aspect of this disclosure provides a hardware resource allocation apparatus for an electronic device, the apparatus comprising: The data acquisition module is used to sample the hardware power consumption data of electronic devices; The first fluctuation analysis module is used to determine the fluctuation index of the hardware power consumption data corresponding to the current sampling data based on the current sampling data and the historical sampling data of the previous time period. The fluctuation index represents the magnitude and direction of the increase in the hardware power consumption of the electronic device. The first fluctuation analysis module is further configured to determine, in response to the fluctuation index meeting the set conditions, that the hardware power consumption of the electronic device has undergone a sudden change; The second fluctuation analysis module is used to determine the exponential weighted value of the current sampled data and determine the validity of the mutation based on the exponential weighted value. The exponential weighted value represents the baseline power consumption level of the electronic device in the sampling period consisting of the current sampling time and the adjacent preceding time period. A power consumption prediction module is used to respond to the mutation being a valid mutation by predicting a set of hardware power consumption prediction values ​​for the electronic device in the next target time period based on the current sampled data and determining the hardware resource requirement information of the electronic device based on the set of hardware power consumption prediction values. The power allocation module is used to allocate the hardware resources of the electronic device according to the hardware resource requirement information.

[0014] A third aspect of this disclosure provides a hardware resource allocation device for an electronic device, including a processor and a memory for storing processor-executable instructions, characterized in that the processor is configured to perform the steps of the hardware resource allocation method for the electronic device as described in any of the preceding claims when invoking executable instructions in the memory.

[0015] This disclosure discloses a hardware resource allocation method for electronic devices. It involves real-time sampling of the electronic device's hardware power consumption data and determining the fluctuation index corresponding to the current sampled data to initially identify sudden changes in hardware power consumption. Based on the fluctuation index meeting set conditions, an exponential weighted value for the current sampled data is further determined. This exponential weighted value is used to determine whether the change is a valid change, filtering out short-term fluctuations caused by non-human operation. Furthermore, when both the fluctuation index and the exponential weighted value meet the conditions (i.e., a valid change has occurred), future hardware power consumption data is predicted to determine the hardware resource requirements of the electronic device in the next target time period. Hardware resources are then allocated based on these requirements. In essence, by directly processing the collected hardware power consumption data of the electronic device, user operation behavior is identified, providing a reference for dynamic adjustment of hardware resources. The fluctuations in hardware power consumption data can cover fine-grained user operations, and by predicting future hardware resource requirements, the direction of changes in hardware resource requirements can be judged in advance, allowing for targeted adjustments to the hardware resource allocation strategy. This avoids situations where related hardware resources do not match the actual user operation needs when switching application scenarios, thereby ensuring the dynamic performance of the electronic device and improving the user's interactive experience.

[0016] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0017] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which: In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.

[0018] Figure 1 A schematic diagram illustrating the implementation flow of a hardware resource allocation method for an electronic device according to an embodiment of the present disclosure is shown. Figure 2 This illustration shows an application scenario diagram of a hardware resource allocation method for an electronic device according to an embodiment of the present disclosure; Figure 3The diagram illustrates the hardware power consumption data curve, fluctuation index curve, and exponential weighted value curve of a hardware resource allocation method for an electronic device according to an embodiment of the present disclosure. Figure 4 A schematic diagram of a hardware resource allocation device for an electronic device according to an embodiment of the present disclosure is shown. Figure 5 A schematic diagram of the composition structure of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation

[0019] To make the objectives, features, and advantages of this disclosure more apparent and understandable, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.

[0020] The core shortcoming of these technologies lies in their inability to set uniform resource strategies based on broad application scenarios. They lack real-time perception and dynamic analysis capabilities, and cannot identify fine-grained differences in user operations within the same application scenario under a static rule framework. For example, in practical applications, users may have different operational needs for the same application scenario, resulting in different power consumption requirements. For instance, users sharing presentations in video conferences have higher CPU power consumption requirements, while users who are only listening to discussions do not require high-performance support. However, these technologies, based on pre-configured static rules, cannot distinguish these fine-grained operational differences and simply allocate resources according to a uniform video conferencing mode, making it difficult to match users' differentiated power consumption and resource needs.

[0021] This disclosure provides a method for allocating hardware resources in an electronic device, such as... Figure 1 As shown, this method can be applied to electronic devices with built-in chips, specifically to the built-in chip. Optionally, the built-in chip can be an artificial intelligence (AI) chip.

[0022] The following section uses the built-in chip as an AI chip as an example to illustrate the hardware resource allocation method of electronic devices.

[0023] S101, the AI ​​chip, samples the hardware power consumption data of electronic devices.

[0024] In this step, the electronic device is a device containing an AI chip, such as a laptop or smartphone. The hardware power consumption data of the electronic device includes data from its Central Processing Unit (CPU), Graphics Processing Unit (GPU), Solid State Drive (SSD), and Memory (MEM). It should be noted that the hardware power consumption data in this step refers to the hardware voltage values; that is, the AI ​​chip samples the CPU, GPU, SSD, and MEM voltage values ​​of the electronic device. This hardware power consumption data can be acquired through the Analog-to-Digital Converter (ADC) module on the AI ​​chip of the electronic device. By acquiring real-time hardware power consumption data such as CPU, GPU, SSD, and MEN voltage values ​​using an AI chip, without consuming additional CPU resources, and compared to related technologies that rely on a host computer to collect and analyze electronic device power consumption data, the AI ​​chip can capture fluctuations in the aforementioned hardware power consumption data immediately. These fluctuations can cover fine-grained user operations, enabling rapid perception of different granularities of operations and providing data reference for subsequent allocation of different hardware resources. The hardware resources in this step include computing resources and storage resources. Computing resources provide computing power to the software system, improving its data processing speed, while storage resources provide storage space, increasing its data storage capacity. Furthermore, the adjustment of hardware resources is achieved by adjusting configurable parameters that control hardware performance. For example, adjusting parameters limiting CPU power consumption increases or decreases the computing resources allocated to the CPU, dynamically improving or limiting its computing power; adjusting parameters limiting memory operating frequency controls memory data read / write efficiency.

[0025] S102. Based on the current sampling data and the historical sampling data of the previous time period, determine the fluctuation index of the hardware power consumption data corresponding to the current sampling data. The fluctuation index characterizes the magnitude and direction of the increase in the hardware power consumption of the electronic device.

[0026] In this step, the preceding time period is a time interval consisting of multiple sampling times sequentially adjacent to the current sampling time. The historical sampling data of the preceding time period consists of all sampling data within that time interval. For example, if hardware power consumption data of an electronic device is collected once per second, the preceding time period is a time interval consisting of x seconds before the current sampling time, and the historical sampling data of the preceding time period consists of all sampling data within those x seconds. One sampling data point corresponds to each second, meaning there are a total of x+1 sampling data points including the current sampling data. Using these x+1 sampling data points, the fluctuation index of the hardware power consumption data corresponding to the current sampling data can be calculated. Among them, the fluctuation index characterizes the magnitude and direction of the increase in hardware power consumption of electronic devices, which can preliminarily predict hardware resource demand information. The magnitude of the increase in hardware power consumption indicates the degree to which the current fluctuation state deviates from the normal level. The larger the absolute value, the stronger the fluctuation. The direction of the increase in hardware power consumption indicates whether the current fluctuation state is intensified or calmed. An upward direction of power consumption growth indicates that the current fluctuation state is intensified, and the user may have performed an operation with high demand for hardware resources. A downward direction of power consumption growth indicates that the current fluctuation state is calmed, that is, it has entered a relatively stable and idle state, and there is a need to reclaim hardware resources.

[0027] S103. In response to the fluctuation index meeting the set conditions, determine that the hardware power consumption of the electronic device has changed abruptly.

[0028] In this step, the sudden change in the hardware power consumption of the electronic device is determined by whether the fluctuation index meets the set conditions. Specifically, it can be determined whether the fluctuation index exceeds the set fluctuation threshold. If the fluctuation index exceeds the threshold, it indicates a sudden change in the hardware power consumption of the electronic device, meaning the user may have performed an operation that causes a rise or fall in hardware power consumption. If the fluctuation index does not exceed the threshold, no action is required. The fluctuation threshold includes an upper fluctuation threshold and a lower fluctuation threshold. If the fluctuation index exceeds the upper fluctuation threshold, it is considered an upward fluctuation, indicating an increase in the demand for hardware resources; if the fluctuation index exceeds the lower fluctuation threshold, it is considered a downward fluctuation, indicating a decrease in the demand for hardware resources. For example, if the upper fluctuation threshold is 25% and the lower fluctuation threshold is -25%, if the current fluctuation index exceeds the preset upper fluctuation threshold (e.g., 28%), it indicates an upward fluctuation. Similarly, if the current fluctuation index exceeds the preset lower fluctuation threshold (e.g., -28%), it indicates a downward fluctuation.

[0029] S104. Determine the exponential weighting value of the current sampled data, and determine the validity of the mutation based on the exponential weighting value. The exponential weighting value characterizes the baseline power consumption level of the electronic device's hardware power consumption in the sampling period consisting of the current sampling time and the adjacent preceding time period.

[0030] In this step, after identifying a sudden change in the hardware power consumption of the electronic device, it is further determined whether this change is a valid change caused by user operation. Non-human factors such as environmental conditions or the inherent characteristics of the electronic device's hardware can also cause drastic fluctuations in hardware power consumption within a short period. For example, a sudden temperature rise can cause a 1-second change in instantaneous CPU power consumption, in which case the fluctuation index will exceed the fluctuation threshold. To eliminate misjudgments of fluctuations caused by such non-human operation, this step further determines the exponentially weighted value of the electronic device. The exponentially weighted value represents the baseline power consumption of the electronic device during the sampling period consisting of the current sampling time and its adjacent preceding time period, reflecting the short-term true power consumption level of the electronic device's hardware power consumption after smoothing from instantaneous interference. The validity of the change is determined based on the exponentially weighted value of the current sampled data and the exponentially weighted value of the previous fluctuation index when it met the set conditions. The previous fluctuation index is the fluctuation index that most recently met the fluctuation conditions among all historical fluctuation indices. The obtained exponentially weighted value of the current sampled data is compared with the exponentially weighted value of the previous fluctuation index when it exceeded the fluctuation threshold to determine whether the change is a valid change, i.e., whether it is a hardware power consumption fluctuation caused by human operation, filtering out short-term noise and capturing the true power consumption trend. For example, in a sampling period of 1-100s, if the current sampling time is 100s, the fluctuation threshold is 28%, and the fluctuation index is 25%, then by backtracking from the sampling time of 100s, if the fluctuation thresholds corresponding to the sampling times of 99s, 98s, and 97s are all less than 25%, and the fluctuation threshold corresponding to the sampling time of 96s is 26%, exceeding the fluctuation threshold of 25%, then it is further determined that the sampling time of 96s is the previous sampling time corresponding to the current sampling time of 100s where the fluctuation index meets the set conditions. Subsequently, the exponential weighted value of the sampling time of 96s and the exponential weighted value of the sampling time of 100s are further compared to determine whether the mutation is a valid mutation.

[0031] It's important to note that among all historical fluctuation indicators, the most recent one exceeding the fluctuation threshold at the current sampling time corresponds to an exponentially weighted value that serves as the historical benchmark for effective power consumption changes, such as 1.1V. Only when the exponentially weighted value of the current sampled data exceeds this benchmark can it be determined that an effective power consumption change has occurred in the electronic device's hardware. For example, when a fluctuation indicator exceeds the upper fluctuation threshold, if there is transient noise, i.e., a transient change in CPU data (such as the CPU voltage jumping instantaneously from 1.1V to 2.1V and returning to 1.1V after 0.5ms), the corresponding exponentially weighted value hardly changes and will not exceed the exponentially weighted value at the time of the last confirmed effective change, remaining stable at 1.1V. In this case, the transient change can be filtered out based on the calculated corresponding exponentially weighted value, indicating that no effective power consumption change has occurred in the electronic device's hardware.

[0032] S105. In response to a mutation being a valid mutation, determine the set of hardware power consumption prediction values ​​for the electronic device in the next target time period based on the current sampled data, and determine the hardware resource requirement information of the electronic device based on the hardware power consumption prediction values.

[0033] In this step, after confirming that the mutation is valid, the hardware power consumption of the electronic device at each sampling moment in the next target time period after the valid mutation is predicted, resulting in a set of predicted hardware power consumption values. The starting point of the next target time period is the Tth second after the valid mutation, meaning the hardware power consumption is predicted for a period after T seconds. For example, predicting CPU data at multiple sampling moments 5 seconds after the valid mutation occurs yields a corresponding set of predicted CPU data values, which serves as the data basis for subsequent predictions of hardware requirements.

[0034] In addition, this step determines the power consumption trend of electronic devices in the next target period based on the overall numerical trend of the hardware power consumption prediction value set. By judging whether the direction of the power consumption trend is consistent with the direction of hardware power consumption growth represented by the fluctuation index, it verifies whether the determined effective mutation will continue. This improves the accuracy of determining the hardware resource requirements of electronic devices in the next target period and ensures that the subsequent allocation of hardware resources to electronic devices is reasonable.

[0035] If the predicted power consumption trend is upward and the hardware power consumption growth direction is also upward, that is, both are in the same direction and both show an upward trend, it can be determined that the hardware resource demand information of the electronic device in the next target period indicates that there is a hardware resource allocation demand, reflecting that the user has actually performed some operation that requires hardware resource allocation; if the predicted power consumption trend is downward and the hardware power consumption growth direction is also downward, that is, both are in the same direction and both show a downward trend, it can be determined that the hardware resource demand information of the electronic device in the next target period indicates that there is a hardware resource release demand, reflecting that the user's demand for hardware resources has decreased.

[0036] S106. Allocate hardware resources for electronic devices based on hardware resource requirements information.

[0037] In this step, hardware resources of the electronic device are allocated according to the hardware resource requirement information determined in step S105, including allocating hardware resources to the application and reclaiming hardware resources from the application. For example, Figure 2As shown, the electronic device includes an embedded controller (EC) and a basic input / output system (BIOS). After the AI ​​chip analyzes and processes the hardware power consumption data of the electronic device, it determines the actual hardware resource requirements and sends the hardware resource requirements information to the EC through the integrated circuit bus (IIC). The EC then sends an event notification containing the hardware resource requirements information to the BIOS through the queue event mechanism Qevent. The BIOS forwards the notification to the service program running in the operating system through the (WMI) interface. After receiving the notification, the service program executes the corresponding resource scheduling action to respond to the hardware resource requirements. It should be noted that the hardware resources in this step refer to computing resources and storage resources. For example, when it is determined based on steps S101-S105 that the CPU computing performance needs to be improved, the EC sends an instruction containing the need to improve CPU performance to the BIOS through the queue event mechanism. The BIOS forwards the event to the resource scheduling service program through the WMI interface. After parsing the instruction, the service program adjusts the parameters that limit the CPU's operating power consumption, such as the short-term power control (Power Limit 2, PL2) parameter, so as to allocate more computing power to the CPU in a short period of time to meet the user's demand for CPU performance, ensure the dynamic performance of electronic devices, and effectively improve the user experience.

[0038] In one possible implementation, based on the current sampled data and historical sampled data from previous time periods, the fluctuation index of the hardware power consumption data corresponding to the current sampled data is determined, including: The instantaneous fluctuation intensity of the first sampling dataset composed of the historical sampling data of the previous time period and the current sampling time is determined by obtaining the historical sampling data of the previous time period and the historical sampling data of the current time period. Determine the average fluctuation intensity of the second sampling dataset, which consists of the current sampling data and historical sampling data from the previous time period; Based on the degree of deviation of the instantaneous fluctuation intensity from the average fluctuation intensity, the fluctuation index of the hardware power consumption data corresponding to the current sampled data is determined.

[0039] In this embodiment, hardware resource requirements are initially predicted by determining the fluctuation index of the current sampled data. Specifically, when determining the fluctuation index, historical sampled data from a preset time period adjacent to the current sampling time is obtained from historical sampled data from previous time periods. For example, the historical sampled data from the previous time period could be all sampled data from x seconds before the current sampling time, and the historical sampled data from the preset time period adjacent to the current sampling time could be all sampled data from x / 2 seconds before the current sampling time. These two data points, along with the current sampled data, form a first sampled dataset, and the instantaneous fluctuation intensity of the first sampled dataset is calculated. It should be noted that the instantaneous fluctuation intensity is the standard deviation of each sampled data point in the first sampled dataset, used to reflect the power consumption fluctuation in the x / 2 seconds before the current sampling time.

[0040] Furthermore, the average fluctuation intensity of the second sampling dataset, composed of the current sampled data and all historical sampled data from the preceding time period, is determined. The average fluctuation intensity is the first-order smoothing exponent of the standard deviation of each sampled data point in the second sampling dataset, reflecting the average power consumption fluctuation over the previous x seconds. Based on the deviation of the instantaneous fluctuation intensity from the average fluctuation intensity, the fluctuation index of the hardware power consumption data corresponding to the current sampled data can be determined, reflecting whether the power consumption fluctuation over the most recent x / 2 seconds is increasing or decreasing compared to the most recent x seconds.

[0041] In this embodiment, the formula for calculating the volatility index is as follows:

[0042] In the formula, As a volatility indicator, The number of sampled data in the first sampled dataset. The number of sampled data in the second sampled dataset. Let u be the average value of the sampled data in the first sampled dataset, w be the first-order smoothing coefficient, and y = That is, the standard deviation of the sampled data in the first sampled dataset. This is the first-order smoothing exponent value of the standard deviation of the sampled data in the second sampled dataset.

[0043] Taking N=10 and n=20 as an example, when calculating the fluctuation index of the current sampled data, the 10 sampled data points, including the current sampled data, are substituted into the calculation. The standard deviation of the first sampled dataset is calculated to reflect power consumption fluctuations over the most recent 10 timeframes, including the current timeframe. Simultaneously, the standard deviation of the 20 collected sampled data sets, including the current sampled data, is substituted into the dataset. In the first sample dataset, a first-order smoothing exponent value is determined by combining a pre-configured first-order exponential smoothing coefficient w. It should be noted that the first-order smoothing exponent value is calculated so that sampled data closer to the current time have a higher weight, better reflecting abrupt changes. Further, the calculated first-order smoothing exponent values ​​of the standard deviations of the first and second sample datasets are substituted into the Pof formula to obtain the fluctuation index of the current sampled data. Here, the sign of Pof represents the direction of fluctuation in hardware power consumption data, and the magnitude of Pof represents the intensity of hardware power consumption data. If the magnitude of Pof exceeds a set fluctuation threshold, it indicates a power consumption abrupt change in the last 10 seconds compared to the last 20 seconds.

[0044] As can be seen from the above calculation process, the volatility index Pof is essentially a percentage of the first smoothing exponent of the standard deviation of the most recent 10 seconds including the current time and the standard deviation of the most recent 20 seconds. That is, this embodiment improves the impact caused by the difference in data between different models of electronic devices by calculating the percentage value. It can be applied to any model of electronic device with an AI chip and has a wider range of applications.

[0045] In one possible implementation, determining the exponential weighting value of the current sampled data includes: Assign corresponding weights to the current sampled data and each historical sampled data in the previous time period, and the weights decrease sequentially as the sampling time goes back; The product of the current sampled data and its corresponding weight is added to the product of each historical sampled data and its corresponding weight in the previous time period to obtain the weighted fusion result. The ratio of the weighted fusion result to the sum of all weights is then determined to obtain the exponential weighted value of the current sampled data.

[0046] In this embodiment, to filter short-term fluctuations—that is, to avoid identifying fluctuations caused by non-human operation as valid fluctuations—after determining that the hardware power consumption of the electronic device has changed drastically, the exponentially weighted value of the current sampled data is further calculated. The fluctuation change is further identified based on whether the exponentially weighted value of the current sampled data exceeds the exponentially weighted value corresponding to the previous fluctuation indicator that met the set conditions. The formula for calculating the exponentially weighted value is as follows:

[0047] In the formula, For index weights, For sampled data; Based on the above formula, the exponentially weighted value of the current sampled data is determined as the basis for verifying continuous changes in power consumption. The calculated exponentially weighted value smooths out short-term fluctuations, thus reflecting the overall baseline power consumption in the recent period. It should be noted that Pof itself detects the magnitude and direction of power consumption growth, but a power consumption increase at a certain moment does not necessarily mean that the user has performed an operation that requires hardware power. For example, CPU data may experience temporary power consumption fluctuations due to heat dissipation issues; these temporary fluctuations are not caused by user operations. If only Pof results are relied upon, the system may react to any short-term fluctuations, frequently adjusting resources, reducing system efficiency, and impacting user experience.

[0048] In one possible implementation, determining the validity of a mutation based on an exponentially weighted value includes: Determine the index weighted value of the previous volatility index of the current sampled data when it meets the set conditions. The previous volatility index is the volatility index that meets the volatility conditions most recently among all historical volatility indices at the current sampling time. If the exponential weighting value of the current sampled data exceeds the exponential weighting value when the previous volatility index met the set conditions, the mutation is determined to be a valid mutation.

[0049] In this embodiment, since user operations typically lead to continuous changes in power consumption, while power consumption fluctuations caused by the environment or the electronic device itself are usually temporary, this embodiment compares the Mop of the current sampled data with the Mop recorded when the Pof value most recently exceeded a set threshold to determine whether the power consumption fluctuation is a continuous change caused by user operations. If the current Pof result exceeds a preset upper fluctuation threshold, such as 25%, it indicates an upward mutation. If the current Mop is greater than the Mop when the previous Pof value exceeded the upper fluctuation threshold, the mutation is determined to be a valid upward mutation, and the service program will be notified to perform a resource release operation to accelerate the opening of the corresponding application. If the current Pof result exceeds a preset lower fluctuation threshold, such as -25%, it indicates a downward mutation. If the current Mop is less than the Mop when the previous Pof value exceeded the lower fluctuation threshold, the mutation is determined to be a valid downward mutation, and the service program will be notified to perform a corresponding resource reclamation operation to avoid resource waste.

[0050] In one possible implementation, determining a set of predicted hardware power consumption values ​​for the electronic device in the next target time period based on current sampling data includes: Determine the power smoothing value of the current sampled data. The power smoothing value represents the actual power consumption of the electronic device after filtering out interference at the current sampling time. Determine the trend change value of the current sampled data. The trend change value represents the changing trend of the electronic device’s hardware resource requirements at the current sampling time relative to the previous sampling time. Based on the power smoothing value and trend change value, predict the power consumption of the electronic device at each sampling time in the next target period to obtain the corresponding set of hardware power consumption prediction values.

[0051] In this embodiment, after determining that the mutation is a valid mutation, the hardware power consumption of the electronic device in the next target time period is further predicted, and the result of the prediction is used to determine whether to maintain the mutation result or to perform a callback. First, the power consumption smoothing value of the current sampled data is determined. Accordingly, the formula for the power consumption smoothing value is as follows:

[0052] In the formula This is the current power consumption smoothing value. For smoothing coefficients, For the current sampled data, This represents the trend change value at the previous sampling time.

[0053] The above formula can be used to calculate the current power consumption smoothing value, which represents the actual power consumption of the electronic device after filtering out interference at the current sampling time. This serves as the data basis for predicting the power consumption forecast value for the next target period, making the prediction results more accurate.

[0054] Furthermore, the trend change value of the current sampled data is determined, and the formula for the trend change value is as follows:

[0055] In the formula This is the trend smoothing coefficient. This is the current power consumption smoothing value.

[0056] The trend change value of the current sampled data can be calculated based on the above formula, which represents the changing trend of the electronic device's hardware resource requirements at the current sampling time relative to the previous sampling time. Combined with the calculated power consumption smoothing value, the power consumption prediction value can be obtained. Accordingly, the formula for calculating the power consumption prediction value is as follows:

[0057] In the formula To predict the time, such as the power consumption forecast for the next 5 to 10 seconds, then... Substituting 5, 6, 7, 8, 9, and 10 into the above formula, we can calculate the corresponding power consumption prediction values, thereby obtaining a set of hardware power consumption prediction values. Subsequently, by analyzing the overall trend of the values ​​in the set of hardware power consumption prediction values, we can determine whether to release hardware resources to the corresponding application or to reclaim resources from the corresponding application. In other words, we can predict and respond to changes in user resource needs to meet user requirements.

[0058] In one possible implementation, determining the hardware resource requirements of an electronic device based on a set of predicted hardware power consumption values ​​includes: Based on the overall trend of the hardware power consumption prediction set, determine the power consumption trend of electronic devices in the next target period. The direction of hardware power consumption growth, which responds to both the direction of power consumption change trends and fluctuation indicators, is positive, indicating that there is a demand for hardware resource allocation. The direction of hardware power consumption growth, which responds to both the trend of power consumption change and the fluctuation index, is negative, indicating that the determined hardware resource demand information represents the existence of a demand for hardware resource release.

[0059] In this embodiment, after obtaining the set of predicted hardware power consumption values, the overall numerical trend of the set of predicted hardware power consumption values ​​is further analyzed to determine the power consumption change trend of the electronic device in the next target time period. The slope represents the predicted trend of power consumption change. For example... The calculation formula based on the power consumption prediction value can be used to calculate the values ​​at 5, 6, 7, 8, 9, and 10. And further calculate the above The slope of the power consumption prediction sequence. If the slope of the power consumption prediction sequence for the next 5-10 seconds from the current sampling time is positive, and the PoF result corresponding to the current sampling data shows an upward fluctuation, it indicates that the predicted power consumption is in the same direction as the actual fluctuating power consumption, suggesting that the subsequent hardware power consumption data has an upward trend, that is, the determined hardware resource demand information indicates the existence of hardware resource allocation demand; if the slope of the power consumption prediction sequence for the next 5-10 seconds from the current sampling time is negative, and the PoF result corresponding to the current sampling data shows a downward fluctuation, it also indicates that the predicted power consumption is in the same direction as the actual power consumption, suggesting that the subsequent hardware power consumption data has a downward trend, that is, the determined hardware resource demand information indicates the existence of hardware resource release demand. This embodiment uses power consumption prediction for a period of time in the future to re-verify whether a valid mutation has occurred. Only when... Only when the reflected trend is consistent with the effective mutation direction derived from Pof and Mop can it be finally determined that the application has a need for resource allocation or release, and the hardware resource allocation performed accordingly is more accurate.

[0060] In one possible implementation, the hardware resources of the electronic device are allocated based on hardware power consumption requirement information, including: Determining hardware resource requirements includes identifying existing hardware resource allocation needs and allocating the hardware resources of electronic devices to the corresponding applications. Determining hardware resource requirements includes identifying the need to release hardware resources and reclaiming hardware resources from the corresponding application for the electronic device.

[0061] In this embodiment, if the hardware resource requirement information includes a hardware resource allocation requirement, meaning the current user has performed an operation that requires hardware resource allocation, then the hardware resources are released to the corresponding application to ensure smooth user operation. If the hardware resource requirement information includes a hardware resource release requirement, meaning the current user is inactive, then to reduce unnecessary power consumption and extend battery life, the hardware resources of the electronic device are reclaimed from the corresponding application accordingly.

[0062] The following will use the Teams scenario as an example for a detailed explanation.

[0063] like Figure 3 As shown, Figure 3 Curve A represents the actual CPU voltage value collected by the AI ​​chip, curve B is the PoF curve, and curve C is the Mop curve. Indicated by '1', the laptop transitions from the IDLE scene to Teams, causing the CPU voltage to rise. At this point, the PoF value, calculated according to the formula, exceeds a set upper threshold. Subsequently, Mop is calculated and recorded, and this Mop is greater than the Mop' recorded when the PoF value previously exceeded the threshold. Based on the simultaneous satisfaction of PoF and Mop conditions, a data sequence predicting the CPU voltage value over a future period is generated. Line segment D represents the corresponding power consumption prediction value sequence, such as... Figure 3 The slope of the sequence shown is positive, indicating that the CPU voltage value is on an upward trend. This means that the user has performed an operation that requires CPU resources at the marked location. The AI ​​chip will notify the service program, which will then perform a corresponding release operation, using turbo to release resources and accelerate the opening of Teams.

[0064] Figure 3 In the diagram, identifier 2 corresponds to Teams being enabled. When the CPU voltage drops, the PoF value is calculated according to the PoF formula and exceeds a set threshold. The corresponding Mop is then calculated and recorded, and Mop is less than the Mop' recorded when PoF previously exceeded the threshold. Based on the simultaneous satisfaction of PoF and Mop conditions, a data sequence of CPU voltage values ​​for a future period is predicted. Line segment E represents the corresponding power consumption prediction value sequence, such as... Figure 3 The negative slope of the sequence indicates a downward trend in the subsequent CPU voltage values. This suggests that the user has requested CPU resource reclamation at the marked location. The AI ​​chip will then notify the service program, which will perform the corresponding reclamation operation to reclaim the resources.

[0065] The transition from marker 1 to marker 2 takes only a few seconds. Related technologies struggle to achieve such a rapid response. This embodiment, however, directly processes the fluctuations in the collected CPU voltage values ​​to achieve faster demand identification, avoiding resource shortages or lag during scene switching and ensuring a smooth user experience. Similarly, this embodiment can identify entering a Teams meeting by marking markers 3 to 4, and identify the user turning on their microphone by marking marker 5, promptly meeting the user's actual needs.

[0066] In one possible implementation, the hardware power consumption data includes at least one of the following: CPU voltage value, GPU voltage value, SSD voltage value, or MEM voltage value.

[0067] In this embodiment, the AI ​​chip uses an ADC module to collect at least one of the following voltage values ​​in real time: CPU voltage, GPU voltage, SSD voltage, or MEM voltage, and stores it in a cache. Taking CPU voltage as an example, after the real-time collected CPU voltage value is stored in the cache, the standard deviation of the CPU voltage value X seconds before the current sampling time and the first-order smoothing exponent value Y seconds before the current sampling time are calculated and stored in the cache. The values ​​of X and Y can be adjusted according to actual needs and are not specifically limited here. Substituting the standard deviation and the first-order smoothing exponent value into the PoF formula, the percentage fluctuation of the CPU voltage value is calculated and compared with a preset upper and lower threshold. Percentages below the fluctuation threshold are not processed; percentages exceeding the upper fluctuation threshold indicate an upward mutation; percentages exceeding the lower fluctuation threshold indicate a downward mutation. Based on percentages exceeding the fluctuation threshold, the current CPU voltage value is further substituted into the Mop formula to calculate an exponential weighted value. If both PoF and Mop simultaneously satisfy an upward mutation and the current Mop is greater than the Mop at the time of the previous mutation, it is considered a valid mutation. Similarly, if both PoF and Mop simultaneously satisfy a downward mutation and the current Mop is less than the Mop at the time of the previous mutation, it is also considered a valid mutation. The system further determines the predicted CPU voltage value after a valid mutation occurs, and then checks whether the overall trend of the predicted values ​​in the obtained set is consistent with the mutation direction reflected by the Proof of Value (POF). Finally, it determines how to allocate hardware resources. Compared to related technologies, this embodiment monitors hardware voltage fluctuations in real time, dynamically predicting and responding to changes in user resource needs. It directly processes the collected voltage data without involving model training or scene labeling, resulting in faster recognition speed. Simultaneously, voltage fluctuations can cover fine-grained user operations, recognizing not only power consumption requirements during large-scale scene transitions such as switching from game mode to IDLE mode, but also power consumption requirements in fine-grained scenarios such as sharing presentation documents in video conferencing. This ensures faster recognition speed while better adapting to actual user needs.

[0068] To implement the above method, one example of this application also provides a hardware resource allocation device for an electronic device, such as... Figure 4 As shown, the device includes: The data acquisition module 401 is used to sample the hardware power consumption data of the electronic device; The first fluctuation analysis module 402 is used to determine the fluctuation index of the hardware power consumption data corresponding to the current sampling data based on the current sampling data and the historical sampling data of the previous time period. The fluctuation index characterizes the magnitude and direction of the increase in the hardware power consumption of the electronic device. The first fluctuation analysis module 402 is also used to determine a sudden change in the hardware power consumption of the electronic device in response to the fluctuation index meeting the set conditions. The second fluctuation analysis module 403 is used to determine the exponential weighted value of the current sampled data and determine the validity of the abrupt change based on the exponential weighted value. The exponential weighted value characterizes the baseline power consumption level of the electronic device's hardware power consumption in the sampling period consisting of the current sampling time and the adjacent preceding time period. The power consumption prediction module 404 is used to predict the set of hardware power consumption prediction values ​​of the electronic device in the next target period based on the current sampled data in response to the mutation becoming a valid mutation, and to determine the hardware resource requirement information of the electronic device in the next target period based on the set of hardware power consumption prediction values. The power allocation module 406 is used to allocate hardware resources of electronic devices according to hardware resource requirement information.

[0069] In one embodiment, the first fluctuation analysis module 402 is used to obtain historical sampling data of a preset period adjacent to the current sampling time from historical sampling data of a previous time period, and determine the instantaneous fluctuation intensity of the first sampling dataset composed of the historical sampling data and the current sampling data within the preset period. Determine the average fluctuation intensity of the second sampling dataset, which consists of the current sampling data and historical sampling data from the previous time period; Based on the degree of deviation of the instantaneous fluctuation intensity from the average fluctuation intensity, the fluctuation index of the hardware power consumption data corresponding to the current sampled data is determined.

[0070] In one embodiment, the second fluctuation analysis module 403 is used to assign corresponding weights to the current sampled data and each historical sampled data in the previous time period, and the weights decrease sequentially as the sampling time is traced back. The product of the current sampled data and its corresponding weight is added to the product of each historical sampled data and its corresponding weight in the previous time period to obtain the weighted fusion result. The ratio of the weighted fusion result to the sum of all weights is then determined to obtain the exponential weighted value of the current sampled data.

[0071] In one embodiment, the second fluctuation analysis module 403 is further configured to determine the exponential weighted value of the previous fluctuation index of the current sampled data when it meets the set conditions. The previous fluctuation index is the fluctuation index that meets the fluctuation conditions most recently among all historical fluctuation indices at the current sampling time. In response to the exponential weighted value of the current sampled data exceeding the exponential weighted value of the previous fluctuation index when it meets the set conditions, the mutation is determined to be a valid mutation.

[0072] In one embodiment, the power consumption prediction module 404 is used to determine the power consumption smoothing value of the current sampled data. The power consumption smoothing value represents the actual power consumption of the electronic device after filtering out interference at the current sampling time. Determine the trend change value of the current sampled data. The trend change value represents the changing trend of the electronic device’s hardware resource requirements at the current sampling time relative to the previous sampling time. The power consumption prediction value of the electronic device at each sampling time in the next target period is predicted based on the power consumption smoothing value and trend change value.

[0073] In one embodiment, the power consumption prediction module 404 is used to determine the power consumption change trend of the electronic device in the next target period based on the overall numerical trend of the hardware power consumption prediction value set. The direction of hardware power consumption growth, which responds to both the direction of power consumption change trends and fluctuation indicators, is positive, indicating that there is a demand for hardware resource allocation. The direction of hardware power consumption growth, which responds to both the trend of power consumption change and the fluctuation index, is negative, indicating that the determined hardware resource demand information represents the existence of a demand for hardware resource release.

[0074] In one possible implementation, the power allocation module 406 is used to determine hardware resource requirement information, including the existence of hardware resource allocation requirements, and allocate the hardware resources of the electronic device to the corresponding application. Determining hardware resource requirements includes identifying the need to release hardware resources and reclaiming hardware resources from the corresponding application for the electronic device.

[0075] In one possible implementation, the hardware power consumption data includes at least one of the following: CPU voltage value, GPU voltage value, SSD voltage value, or MEM voltage value.

[0076] By way of example, this application also provides an electronic device, including: processor; Memory used to store processor-executable instructions; A processor is configured to read executable instructions from memory and execute the instructions to implement the hardware resource allocation method of the electronic device described above.

[0077] For example, this application also provides a computer-readable storage medium storing a computer program for executing the hardware resource allocation method of the electronic device described above.

[0078] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0079] like Figure 5 As shown, device 500 includes a computing unit 501, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 502 or a computer program loaded from storage unit 508 into random access memory (RAM) 503. RAM 503 may also store various programs and data required for the operation of device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.

[0080] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0081] The computing unit 501 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as a hardware resource allocation method for an electronic device. For example, in some embodiments, a hardware resource allocation method for an electronic device may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the hardware resource allocation method for an electronic device described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured, by any other suitable means (e.g., by means of firmware), to perform a hardware resource allocation method for an electronic device.

[0082] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0083] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0084] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0085] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0086] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0087] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0088] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0089] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise explicitly specified.

[0090] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.

Claims

1. A method for allocating hardware resources in an electronic device, characterized in that, The method includes: Sampling of hardware power consumption data for electronic devices; Based on the current sampling data and the historical sampling data of the previous time period, a fluctuation index of the hardware power consumption data corresponding to the current sampling data is determined. The fluctuation index characterizes the magnitude and direction of the increase in the hardware power consumption of the electronic device. In response to the fluctuation index meeting the set conditions, it is determined that a sudden change has occurred in the hardware power consumption of the electronic device; Determine the exponential weighting value of the current sampled data, and determine the validity of the mutation based on the exponential weighting value. The exponential weighting value represents the baseline power consumption level of the electronic device in the sampling period consisting of the current sampling time and the adjacent preceding time period. In response to the mutation being a valid mutation, a set of predicted hardware power consumption values ​​for the electronic device in the next target time period is determined based on the current sampled data, and the hardware resource requirement information of the electronic device is determined based on the set of predicted hardware power consumption values. The hardware resources of the electronic device are allocated based on the hardware resource requirement information.

2. The hardware resource allocation method for electronic devices according to claim 1, characterized in that, The step of determining the fluctuation index of hardware power consumption data corresponding to the current sampled data based on the current sampled data and historical sampled data from the previous time period includes: From the historical sampling data of the preceding time period, obtain the historical sampling data of a preset time period adjacent to the current sampling time, and determine the instantaneous fluctuation intensity of the first sampling dataset composed of the historical sampling data within the preset time period and the current sampling data; Determine the average fluctuation intensity of the second sampling dataset, which consists of the current sampling data and historical sampling data from the preceding time period; Based on the degree of deviation of the instantaneous fluctuation intensity from the average fluctuation intensity, the fluctuation index of the hardware power consumption data corresponding to the current sampled data is determined.

3. The hardware resource allocation method for electronic devices according to claim 1, characterized in that, Determining the exponential weighted value of the current sampled data includes: Each of the current sampled data and each historical sampled data in the preceding time period is assigned a corresponding weight, and the weight decreases sequentially as the sampling time goes back; The product of the current sampled data and its corresponding weight is added to the product of each historical sampled data and its corresponding weight in the preceding time period to obtain a weighted fusion result. The ratio of the weighted fusion result to the sum of all weights is then determined to obtain the exponential weighted value of the current sampled data.

4. The hardware resource allocation method for electronic devices according to claim 1, characterized in that, The determination of the validity of the mutation based on the exponential weighting value includes: Determine the exponential weighted value of the previous fluctuation index of the current sampled data when it meets the set conditions. The previous fluctuation index is the fluctuation index that most recently met the fluctuation conditions among all historical fluctuation indices at the current sampling time. If the exponential weighted value of the current sampled data exceeds the exponential weighted value when the previous fluctuation index met the set conditions, the mutation is determined to be a valid mutation.

5. The hardware resource allocation method for electronic devices according to claim 1, characterized in that, The step of determining the set of predicted hardware power consumption values ​​for the electronic device in the next target time period based on the current sampled data includes: Determine the power smoothing value of the current sampled data, wherein the power smoothing value represents the actual power consumption of the electronic device after filtering out interference at the current sampling time; Determine the trend change value of the current sampled data, wherein the trend change value characterizes the changing trend of the hardware resource requirements of the electronic device at the current sampling time relative to the previous sampling time; Based on the power smoothing value and the trend change value, predict the power consumption of the electronic device at each sampling moment in the next target time period to obtain the corresponding set of hardware power consumption prediction values.

6. The hardware resource allocation method for electronic devices according to claim 1, characterized in that, The step of determining the hardware resource requirements of the electronic device based on the set of predicted hardware power consumption values ​​includes: Based on the overall trend of the hardware power consumption prediction value set, determine the power consumption change trend of the electronic device in the next target time period; Since both the direction of the power consumption change trend and the direction of the hardware power consumption growth of the fluctuation index are positive, the determined hardware resource demand information indicates that there is a hardware resource allocation demand. Since both the direction of the power consumption change trend and the direction of the hardware power consumption growth of the fluctuation index are negative, the determined hardware resource demand information indicates that there is a demand for hardware resource release.

7. The hardware resource allocation method for an electronic device according to claim 6, characterized in that, The allocation of hardware resources of the electronic device based on the hardware power consumption requirement information includes: Determining the hardware resource requirement information includes the existence of hardware resource allocation requirements, and allocating the hardware resources of the electronic device to the corresponding application; The determination of the hardware resource requirement information includes the existence of a hardware resource release requirement, and the recovery of the hardware resources of the electronic device from the corresponding application.

8. The hardware resource allocation method for an electronic device according to any one of claims 1-7, characterized in that, The hardware power consumption data includes at least one of the following: CPU voltage value, GPU voltage value, SSD voltage value, or MEM voltage value.

9. A hardware resource allocation device for an electronic device, characterized in that, The device includes: The data acquisition module is used to sample the hardware power consumption data of electronic devices; The first fluctuation analysis module is used to determine the fluctuation index of the hardware power consumption data corresponding to the current sampling data based on the current sampling data and the historical sampling data of the previous time period. The fluctuation index represents the magnitude and direction of the increase in the hardware power consumption of the electronic device. The first fluctuation analysis module is further configured to determine, in response to the fluctuation index meeting the set conditions, that the hardware power consumption of the electronic device has undergone a sudden change; The second fluctuation analysis module is used to determine the exponential weighted value of the current sampled data and determine the validity of the mutation based on the exponential weighted value. The exponential weighted value represents the baseline power consumption level of the electronic device in the sampling period consisting of the current sampling time and the adjacent preceding time period. A power consumption prediction module is used to respond to the mutation being a valid mutation by predicting a set of hardware power consumption prediction values ​​for the electronic device in the next target time period based on the current sampled data and determining the hardware resource requirement information of the electronic device based on the set of hardware power consumption prediction values. The power allocation module is used to allocate the hardware resources of the electronic device according to the hardware resource requirement information.

10. A hardware resource allocation device for an electronic device, comprising a processor and a memory for storing processor-executable instructions, characterized in that, The processor is configured to perform the steps of the hardware resource allocation method of the electronic device as described in any one of claims 1 to 8 when invoking executable instructions in memory.