Operation power regulation and control method and device, computer equipment and storage medium
By monitoring the operating power in target devices with heterogeneous chips in real time and implementing multi-dimensional control strategies when overloaded, the problem of high failure rate of heterogeneous chips is solved, and the effect of reducing failure rate and extending service life is achieved.
Patent Information
- Application Number
- CN202410592267.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2025-11-11
AI Technical Summary
The high failure rate of heterogeneous chips leads to increased replacement costs and project delays, and existing technologies are unable to effectively reduce the failure rate.
By acquiring the operating power of the target device and implementing control strategies when the power threshold is exceeded, including control at the program execution, network communication, and device management levels, the operating power of heterogeneous cards can be reduced to avoid power overload.
It reduced the failure rate of heterogeneous cards, extended their service life, and avoided increased costs and project delays caused by replacing heterogeneous cards.
Smart Images

Figure CN120929183A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, and storage medium for regulating operating power. Background Technology
[0002] As a core component of electronic devices, the performance and efficiency of chips directly affect the overall system operation. Among these, heterogeneous chips, as an innovative chip design approach, are gradually gaining industry attention. Heterogeneous chips refer to chips that integrate multiple different types of processor cores. Through heterogeneous chips, hardware resources can be shared and optimized, enabling parallel processing of various tasks and improving overall computing efficiency and system performance. In practical applications, heterogeneous chips typically operate under continuous high loads, thus their failure rate is usually higher than that of ordinary chips. When a heterogeneous chip fails, replacing it incurs significant costs, and temporary downtime during repairs also impacts project progress. Therefore, reducing the failure rate of heterogeneous chips is a pressing issue that needs to be addressed. Summary of the Invention
[0003] This application provides a method, apparatus, computer device, and storage medium for regulating operating power. This not only prevents the target device from being continuously under power overload, thus avoiding damage to heterogeneous cards and reducing their failure rate, but also increases their lifespan. Furthermore, it avoids increased costs and project delays caused by replacing heterogeneous cards. The technical solution is as follows:
[0004] On the one hand, a method for regulating operating power is provided, the method comprising:
[0005] The operating power of the target device is obtained. The computing power container of the target device includes multiple heterogeneous card containers. The multiple heterogeneous card containers are used to perform various data processing tasks, including model training tasks, image processing tasks, and data analysis tasks.
[0006] When the operating power of the target device exceeds a power threshold, a target control strategy is executed. The target control strategy is used to reduce the operating power of the target device through control methods in at least one dimension. The at least one dimension includes a program execution dimension, a network communication dimension, and a device management dimension. The program execution dimension is used to indicate control based on the time slice of the heterogeneous computing core. The network communication dimension is used to indicate control based on the communication load of the multiple heterogeneous card containers. The device management dimension is used to indicate control by scheduling the multiple heterogeneous card containers.
[0007] The operating power of the target device is continuously acquired if the operating power of the target device is not greater than the power threshold.
[0008] On the other hand, a power control device is provided, the device comprising:
[0009] The acquisition module is used to acquire the operating power of the target device. The computing power container of the target device includes multiple heterogeneous card containers. The multiple heterogeneous card containers are used to perform various data processing tasks, including model training tasks, image processing tasks, and data analysis tasks.
[0010] The control module is used to execute a target control strategy when the operating power of the target device is greater than a power threshold. The target control strategy is used to reduce the operating power of the target device through control methods in at least one dimension. The at least one dimension includes a program execution dimension, a network communication dimension, and a device management dimension. The program execution dimension is used to indicate control based on the time slice of the heterogeneous computing core. The network communication dimension is used to indicate control based on the communication load of the multiple heterogeneous card containers. The device management dimension is used to indicate control by scheduling the multiple heterogeneous card containers.
[0011] The detection module is used to continuously acquire the operating power of the target device when the operating power of the target device is not greater than the power threshold.
[0012] In some embodiments, the control module is configured to: execute a first control strategy when the operating power of the target device exceeds a power threshold, wherein the first control strategy is configured to reallocate time slices corresponding to multiple programs in the program execution dimension, each time slice indicating a time period for the heterogeneous card processing program; or / and, execute a second control strategy when the operating power of the target device exceeds a power threshold, wherein the second control strategy is configured to adjust the amount of data input to the target device through the network card based on a data volume threshold in the network communication dimension, wherein the data volume threshold indicates the maximum amount of data allowed to be input to the target device through the network card per unit time; or / and, execute a third control strategy when the operating power of the target device exceeds a power threshold, wherein the third control strategy is configured to migrate the multiple heterogeneous card containers to other devices in the device management dimension, wherein the other devices refer to other electronic devices equipped with heterogeneous cards.
[0013] In some embodiments, the control module includes:
[0014] The first control unit is used to execute a first control strategy when the operating power of the target device is greater than the power threshold. The first control strategy is used to reallocate time slices corresponding to multiple programs in the program running dimension, and each time slice is used to indicate the time period of the heterogeneous card processing program.
[0015] The acquisition unit is used to acquire the operating power of the target device at first preset time intervals;
[0016] The acquisition unit is also used to continuously acquire the operating power of the target device again if the operating power is less than the power threshold within any of the second preset durations, wherein the second preset duration is an integer multiple of the first preset duration;
[0017] The second control unit is used to execute a second control strategy when the operating power at the end of the second preset duration is greater than the power threshold. The second control strategy is used to adjust the amount of data input to the target device through the network card based on a data volume threshold in the network communication dimension. The data volume threshold is used to indicate the maximum amount of data allowed to be input to the target device through the network card per unit time.
[0018] In some embodiments, the second control unit is configured to: lower the data volume threshold when the operating power at the end of the second preset duration is greater than the power threshold; increment the value of an adjustment parameter by one, wherein the adjustment parameter indicates the number of times the data volume threshold has been adjusted; and repeatedly lower the data volume threshold when the value of the adjustment parameter is not greater than the number of times threshold.
[0019] In some embodiments, the second control unit is further configured to: when the value of the adjustment parameter is not greater than the number of times threshold, collect the operating power of the target device at a first preset time interval; when the operating power within any time interval of a third preset time is less than the power threshold, continuously collect the operating power of the target device again, wherein the third preset time is an integer multiple of the first preset time; and when the operating power at the end of the third preset time is greater than the power threshold, lower the data volume threshold again and increment the value of the adjustment parameter by one.
[0020] In some embodiments, the second control unit is further configured to execute a third control strategy when the value of the adjustment parameter is greater than the number of times threshold. The third control strategy is configured to migrate the plurality of heterogeneous card containers to other devices in the device management dimension. The other devices refer to other electronic devices that have heterogeneous cards installed.
[0021] In some embodiments, the control module is further configured to intersperse idle time slices in the time slices corresponding to the plurality of programs, the idle time slices being used to implement the delay calculation of the plurality of programs.
[0022] In some embodiments, the control module is further configured to lower the data volume threshold to obtain an adjusted data volume threshold; when the real-time data volume of the network card is not greater than the adjusted data volume threshold, continuously detect the real-time data volume of the network card, wherein the real-time data volume of the network card is the amount of data input to the target device through the network card that is detected in real time; when the real-time data volume of the network card is greater than the adjusted data volume threshold, reduce the real-time data volume of the network card to below the adjusted data volume threshold.
[0023] In some embodiments, the control module is further configured to copy the configuration files of the plurality of heterogeneous card containers to the other device; start the plurality of heterogeneous card containers in the other device; clear the plurality of heterogeneous card containers in the target device; and continuously collect the operating power of the other device again.
[0024] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory being used to store at least one computer program, the at least one computer program being loaded and executed by the processor to implement the power control method in the embodiments of this application.
[0025] On the other hand, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the power control method in the embodiments of this application.
[0026] On the other hand, a computer program product is provided, including a computer program that is executed by a processor to implement the power control method in the embodiments of this application.
[0027] This application provides a method for regulating operating power. By using the relationship between operating power and a power threshold as a basis, a target regulation strategy is executed to reduce the operating power of the target device, thereby preventing the target device from being continuously in a power overload state and causing damage to the heterogeneous card. This solution not only reduces the failure rate of heterogeneous cards and increases their service life to some extent, but also avoids increased costs and project delays caused by replacing heterogeneous cards. Attached Figure Description
[0028] 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.
[0029] Figure 1 This is a schematic diagram of the implementation environment of a power control method according to an embodiment of this application;
[0030] Figure 2 This is a flowchart of a method for regulating operating power according to an embodiment of this application;
[0031] Figure 3 This is a flowchart of another method for regulating operating power according to an embodiment of this application;
[0032] Figure 4 This is a schematic diagram of a target control strategy provided according to an embodiment of this application;
[0033] Figure 5 This is a schematic diagram of a multi-level control strategy provided according to an embodiment of this application;
[0034] Figure 6 This is a schematic diagram of a target device provided according to an embodiment of this application;
[0035] Figure 7 This is a schematic diagram of a network communication according to an embodiment of this application;
[0036] Figure 8 This is a schematic diagram of device management according to an embodiment of this application;
[0037] Figure 9 This is a schematic diagram of an overall process provided according to an embodiment of this application;
[0038] Figure 10 This is a block diagram of a power control device according to an embodiment of this application;
[0039] Figure 11 This is a block diagram of another power control device according to an embodiment of this application;
[0040] Figure 12 This is a schematic diagram of the structure of a terminal according to an embodiment of this application;
[0041] Figure 13 This is a schematic diagram of the structure of a server according to an embodiment of this application. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0043] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor are there any restrictions on quantity or execution order.
[0044] In this application, the term "at least one" means one or more, and "multiple" means two or more.
[0045] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the operating power involved in this application was obtained with full authorization.
[0046] It should be noted that this application relates to cloud technology. Cloud technology refers to a hosting technology that unifies hardware, software, network, and other resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology encompasses network technology, information technology, integration technology, management platform technology, and application technology based on cloud computing. It can form resource pools, providing flexible and convenient on-demand access. In a broader sense, cloud computing refers to a service delivery and usage model, meaning obtaining required services through a network in an on-demand and easily scalable manner. These services can be IT (information technology) and software, internet-related services, and others. Cloud computing is a product of the development and integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing. In this application, the collected operating power of the target device is uploaded to a cloud server for recording and management, involving cloud computing and other cloud technologies.
[0047] Figure 1This is a schematic diagram illustrating the implementation environment of a power control method according to an embodiment of this application. See also... Figure 1 The implementation environment includes terminal 101 and server 102. Terminal 101 and server 102 can be connected directly or indirectly via wired or wireless communication, which is not limited herein.
[0048] In some embodiments, terminal 101 may be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The embodiments of this application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving. An application may be installed and run on terminal 101. This application can acquire operating power and, when the operating power exceeds a power threshold, execute a target control strategy. This application is associated with server 102, which provides background services to terminal 101.
[0049] In some embodiments, server 102 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0050] In some embodiments, server 102 undertakes the main computing work and terminal 101 undertakes the secondary computing work; or, server 102 undertakes the secondary computing work and terminal 101 undertakes the main computing work; or, server 102 and terminal 101 collaborate on computing using a distributed computing architecture.
[0051] Figure 2 This is a flowchart of a method for regulating operating power according to an embodiment of this application. The method is executed by the target device. See also... Figure 2 The method includes the following steps:
[0052] 201. Obtain the operating power of the target device. The computing power container of the target device includes multiple heterogeneous card containers. These heterogeneous card containers are used to perform various data processing tasks, including model training tasks, image processing tasks, and data analysis tasks.
[0053] In this application embodiment, the target device refers to an electronic device configured with a heterogeneous card. A heterogeneous card refers to a chip that combines the architectures of two or more different types of microprocessors or microcontrollers. Heterogeneous cards are beneficial for the development of advanced embedded systems and can be used to produce high-performance embedded devices. This application embodiment does not limit the architecture and functions of the target device and the heterogeneous card. For example, a heterogeneous card can simultaneously integrate multiple processors such as a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), and a FPGA (Field Programmable Gate Array), thereby performing various types of tasks such as operating system management, model training, graphics processing, and data analysis, improving computing power and efficiency. Containerization refers to encapsulating applications and their dependencies into portable units. Therefore, computing containers enable applications to run consistently in different operating environments, avoiding the impact of differences between underlying operating systems. Heterogeneous card containers are used to provide a unified operating environment for the various types of computing tasks processed by heterogeneous cards.
[0054] It should be noted that the target device's operating power is acquired systematically at a preset sampling frequency. Due to the high performance and low latency characteristics of heterogeneous cards, close monitoring of the target device's operating power is necessary. Typically, the target device's operating power is acquired multiple times per second. The target device's operating power refers to the electrical energy consumed during operation, and this includes the operating power of the heterogeneous card.
[0055] 202. When the operating power of the target device exceeds the power threshold, execute the target control strategy. The target control strategy is used to reduce the operating power of the target device through control methods in at least one dimension. The at least one dimension includes the program execution dimension, the network communication dimension, and the device management dimension. The program execution dimension is used to indicate control based on the time slice of the heterogeneous computing core. The network communication dimension is used to indicate control based on the communication load of multiple heterogeneous card containers. The device management dimension is used to indicate control by scheduling multiple heterogeneous card containers.
[0056] In this embodiment, after obtaining the operating power of the target device, the target device compares the operating power with a power threshold. When the target device detects that the operating power is greater than the power threshold, it indicates that the target device is in a power overload state. When the target device remains in a power overload state, it may cause damage to the heterogeneous card. Therefore, the target device begins to execute a target control strategy. Since the operating efficiency of the target device is affected by many factors such as operating status, workload, and device configuration, the target control strategy can be adjusted from these multiple aspects to reduce the operating power of the target device. It should be noted that the target device can adjust its operating power sequentially according to a preset dimension control strategy, or the target device can prioritize different dimension control strategies to adjust its operating power based on actual conditions. This embodiment does not impose any restrictions on this. The heterogeneous computing core is used to execute instructions in the computer program to complete various computing tasks. The time slice indicates the time period corresponding to the execution of each computing task. The communication load indicates the amount of data transmitted and processed.
[0057] 203. Continuously acquire the operating power of the target device while ensuring that the operating power of the target device does not exceed the power threshold.
[0058] In this embodiment, after obtaining the operating power of the target device, the target device compares the operating power with a power threshold. When the operating power is not greater than the power threshold, it indicates that the target device is in normal working condition and there is no power overload problem. At this time, the target device does not need to execute the target control strategy and can continue to monitor the operating power of the target device.
[0059] This application provides a method for regulating operating power. By using the relationship between operating power and a power threshold as a basis, a target regulation strategy is executed to reduce the operating power of the target device, thereby preventing the target device from being continuously in a power overload state and causing damage to the heterogeneous card. This solution not only reduces the failure rate of heterogeneous cards and increases their lifespan to some extent, but also avoids increased costs and project delays caused by replacing heterogeneous cards.
[0060] Figure 3 This is a flowchart of another method for regulating operating power according to an embodiment of this application. This method is executed by the target device. See [link to flowchart]. Figure 3 The method includes the following steps:
[0061] 301. Obtain the operating power of the target device. The computing power container of the target device includes multiple heterogeneous card containers. These heterogeneous card containers are used to perform various data processing tasks, including model training tasks, image processing tasks, and data analysis tasks.
[0062] In this application embodiment, the target device refers to an electronic device configured with a heterogeneous card. A heterogeneous card refers to an electronic device that integrates multiple different types of processor cores on the same chip. These processor cores can have different instruction set architectures, different microarchitectures, different manufacturing processes, or different packaging technologies, enabling the heterogeneous card to handle multiple types of computing tasks simultaneously, thereby improving overall computing efficiency. This application does not limit the architecture and functions of the heterogeneous card. For example, typically, CPUs are used to handle general computing tasks, including operating system management tasks and application execution tasks; GPUs are used to handle graphics processing tasks and parallel computing tasks, including image rendering tasks and large-scale data processing; FPGAs can be programmed and configured according to actual needs to implement specific computing tasks. Heterogeneous cards can simultaneously integrate multiple processor cores such as CPUs, GPUs, and FPGAs, thereby achieving parallel computing and data processing, improving overall computing power and efficiency. Containerization refers to encapsulating applications and their dependencies into portable units. Therefore, computing containers enable applications to run consistently in different operating environments, avoiding the impact of differences between underlying operating systems. Heterogeneous card containers are used to provide a unified operating environment for the various types of computing tasks handled by the heterogeneous card.
[0063] It should be noted that the target device's operating power is acquired systematically at a preset sampling frequency. Due to the high performance and low latency characteristics of heterogeneous cards, close monitoring of the target device's operating power is necessary. Typically, the target device's operating power is acquired multiple times per second. The target device's operating power refers to the electrical energy consumed during operation, and this includes the operating power of the heterogeneous card.
[0064] In some embodiments, a data acquisition program is deployed in the target device. This program collects the operating power of the target device in real time at a preset acquisition frequency. It should be noted that the acquisition program can also simultaneously collect multiple indicators such as temperature, voltage, and current to help determine the operating status of the target device. This embodiment does not limit the content of the indicator data. The acquisition program can periodically report the operating power of the target device and these multiple indicator data to a server for data recording and management. It should be noted that when collecting operating power and multiple indicator data from multiple target devices simultaneously, each target device has a data acquisition program deployed in it. Multiple target devices can report the collected data to the same server or to different servers. That is, the server can be an independent physical server, a server cluster consisting of multiple servers, or a distributed system. This embodiment does not limit this.
[0065] For a clearer description of the target device's configuration, please refer to [link / reference]. Figure 6 As shown, Figure 6 This is a schematic diagram of a target device according to an embodiment of this application. The target device is configured with a heterogeneous card, which is used to simultaneously process multiple types of computing tasks. A data acquisition program is deployed in the target device to continuously collect the operating power of the target device, including the operating power of the heterogeneous card. A heterogeneous card container is deployed in the target device to provide a runtime environment for the various types of computing tasks processed by the heterogeneous card.
[0066] 302. Continuously acquire the operating power of the target device while ensuring that the operating power of the target device does not exceed the power threshold.
[0067] In this embodiment, after acquiring the operating power of the target device, the target device continuously compares the operating power with a power threshold. When the operating power is not greater than the power threshold, it indicates that the target device is in normal working condition and there is no power overload problem. At this time, the target device does not need to execute the target control strategy and can continue to continuously collect the operating power of the target device. For example, the power threshold can be set to 80% of the rated power of the target device. Here, the rated power of the target device refers to the maximum power that the target device can stably operate for a long time under normal working conditions. It should be noted that the power threshold can also be determined based on indicators such as the number of components, component types, and model of the heterogeneous card, and this embodiment does not impose any restrictions on this.
[0068] It should be noted that when the target device detects that the operating power exceeds the power threshold, it indicates that the target device is in a power overload state. When the target device remains in a power overload state, it may cause damage to the heterogeneous card. Therefore, the target device begins to implement a target control strategy to reduce the operating power of the target device.
[0069] In some embodiments, the target device can select one or more control strategies to adjust its operating power based on actual conditions. These control strategies have different dimensions. Accordingly, when the target device's operating power exceeds a power threshold, a first control strategy is executed. This first control strategy reallocates time slices corresponding to multiple programs in the program execution dimension, with each time slice indicating the time period of the heterogeneous card processing program. Alternatively, when the target device's operating power exceeds the power threshold, a second control strategy is executed. This second control strategy adjusts the amount of data input to the target device through the network card based on a data volume threshold in the network communication dimension. The data volume threshold indicates the maximum amount of data allowed to be input to the target device through the network card per unit time. Alternatively, when the target device's operating power exceeds the power threshold, a third control strategy is executed. This third control strategy migrates multiple heterogeneous card containers to other devices in the device management dimension. Other devices refer to other electronic devices with heterogeneous cards installed. By employing one or more control strategies, the operating power of the target device can be controlled in conjunction with its actual operating conditions, thereby reducing the target device's operating power more efficiently and decreasing the failure rate of the heterogeneous cards.
[0070] For a clearer description of the target control strategy, see [link to relevant documentation]. Figure 4 As shown, Figure 4 This is a schematic diagram of a target control strategy provided according to an embodiment of this application. At the overall product level, the target device can be used to perform training tasks for various models, including visual models, speech models, game models, medical models, and NLP (Natural Language Processing) models. At the computing power container level, the target device's computing power container includes a heterogeneous card container, facilitating the simultaneous processing of multiple types of computing tasks. At the power control level, the target device can optionally execute one or more control strategies based on actual conditions. For example, the target device can execute control strategies from the program execution dimension, controlling the time slices of the heterogeneous card for processing various types of computing tasks. The target device can also execute control strategies from the network communication dimension, implementing rate limiting of the target device's communication load. The target device can also execute control strategies from the device management dimension, realizing the migration and replacement of heterogeneous card containers. By executing one or more of the above control strategies, the target device can control its operating power, extend the lifespan of the heterogeneous card, and thus support the training and computing of various types of models at the overall product level.
[0071] It should be noted that the target device's operating power can be adjusted sequentially according to preset dimension control strategies. Different dimension control strategies operate at different levels. The execution priority of control strategies at different levels differs, and the degree and effect of power control also vary. For example, the program execution dimension control strategy is at the first level, the network communication dimension control strategy is at the second level, and the device management dimension control strategy is at the third level. Generally, executing the first-level control strategy results in a smaller degree and effect of power control; executing the third-level control strategy results in a larger degree and effect. However, since executing the third-level control strategy usually impacts actual business operations at the product level, it is preferable to achieve power control of the target device while executing the first and second-level control strategies.
[0072] For ease of description, see Figure 5 As shown, Figure 5 This is a schematic diagram of a multi-level control strategy provided according to an embodiment of this application. First, when the operating power of the target device exceeds a power threshold, the target device executes a first-level program execution dimension control strategy to reallocate time slices for heterogeneous cards to process various types of computing tasks, see step 303. If the operating power of the target device still does not decrease below the power threshold after executing the above control strategy, the target device executes a second-level network communication dimension control strategy to perform rate limiting control on the communication load of the target device, see step 304. If the operating power of the target device still does not decrease below the power threshold after executing the above control strategy, the target device executes a third-level device management dimension control strategy to realize the migration and replacement of heterogeneous card containers, see step 305.
[0073] 303. When the operating power of the target device is greater than the power threshold, execute the first control strategy. The first control strategy is used to reallocate the time slices corresponding to multiple programs in the program execution dimension.
[0074] In this embodiment, the first control strategy refers to a control strategy at the program execution level. Since the first control strategy involves reallocating time slices, the heterogeneous card continues to perform various types of computing tasks, thus not affecting actual business operations at the product level. At a micro level, a time slice refers to a segment of CPU time allocated by the heterogeneous card to each running program. When the heterogeneous card processes multiple programs simultaneously, the scheduler in the operating system divides the CPU time into several time slices and allocates them sequentially to each running program. After each running program obtains a time slice, it runs for a period of time until the corresponding time slice is used up or preempted. Then, the scheduler in the operating system allocates the CPU time to the next running program. Here, each time slice indicates the time period during which the heterogeneous card processes a program.
[0075] In some embodiments, a first control strategy is implemented by interspersing idle time slices among the time slices corresponding to multiple programs. The idle time slices are used to implement delayed calculations for multiple programs. Typically, idle time slices are millisecond-level time slices. See also Figure 5 As shown, time slices 501 and 502 are used to process computational tasks of different programs. By inserting idle time slices 503 into time slices 501 and 502, the program's computation is delayed, thereby avoiding excessive power consumption caused by the heterogeneous card processing too much data in a short period of time, thus preventing damage to the heterogeneous card and reducing its failure rate.
[0076] In some embodiments, the relationship between the operating power and a power threshold within a preset duration is used to determine whether the operating power control target has been achieved after executing the first control strategy. Accordingly, the operating power of the target device is collected at first preset intervals; if the operating power is less than the power threshold at any time within a second preset duration, the operating power of the target device is continuously collected again, where the second preset duration is an integer multiple of the first preset duration; if the operating power at the end of the second preset duration is greater than the power threshold, a second control strategy is executed. The second control strategy is used to adjust the amount of data input to the target device through the network card based on a data volume threshold in the network communication dimension. The data volume threshold indicates the maximum amount of data allowed to be input to the target device through the network card per unit time. The control target refers to reducing the operating power of the target device below the power threshold. By determining whether the control target has been achieved within a preset duration after executing the first control strategy, it is possible to determine whether the next level of the second control strategy needs to be executed, facilitating multi-level control of the operating power of the target device.
[0077] For example, the target device continuously collects its operating power through a data acquisition program. Typically, a first preset duration reflects the acquisition frequency; this is set to milliseconds, meaning the acquisition frequency is set to collect operating power multiple times per second. After the target device executes the first control strategy, it reports the collected data to the server every minute. Typically, a second preset duration is set to minutes, corresponding to a target number of reporting cycles. If, within the target number of reporting cycles, the target device's operating power in any reported data is not greater than the power threshold, the target device determines that the operating power control target has been achieved after executing the first control strategy. At this point, the target device's operating power is continuously monitored again. If, after the target number of reporting cycles, the target device's operating power is still greater than the power threshold, the target device determines that the operating power control target has not been achieved after executing the first control strategy. At this point, the second control strategy is executed.
[0078] 304. If the operating power control target is not achieved after executing the first control strategy, the second control strategy is executed. The second control strategy is used to adjust the amount of data input to the target device through the network card based on the data volume threshold in the network communication dimension.
[0079] In this embodiment, the second control strategy refers to a control strategy at the network communication layer. Since the second control strategy adjusts the amount of data passing through the network interface card (NIC), and the heterogeneous card continues to perform various types of computing tasks, it will not affect the actual business at the product level. The data volume threshold is used to indicate the maximum amount of data allowed to be input to the target device through the NIC per unit time. In other words, the data volume threshold is a pre-set NIC bandwidth threshold.
[0080] For a clearer description of the network communication process, see [link to relevant documentation]. Figure 7 As shown, Figure 7 This is a schematic diagram of network communication according to an embodiment of this application. Network data is input to the target device through its network card (NIC), stored on the target device's disk via a disk interface, and then used for computing tasks on heterogeneous cards via PCIe (Peripheral Component Interconnect Express). PCIe is used to connect internal hardware devices of a computer device, such as chips, disks, and network adapters. The real-time data volume of the NIC can be adjusted by changing the data volume threshold.
[0081] In some embodiments, the second control strategy is implemented by adjusting the data volume threshold of the network interface card (NIC). Accordingly, the data volume threshold is lowered to obtain an adjusted data volume threshold. When the real-time data volume of the NIC is not greater than the adjusted data volume threshold, the real-time data volume of the NIC is continuously monitored; the real-time data volume of the NIC is the amount of data input to the target device through the NIC that is detected in real time. When the real-time data volume of the NIC exceeds the adjusted data volume threshold, the real-time data volume of the NIC is reduced to below the adjusted data volume threshold. Typically, the data volume threshold is adjusted by configuring kernel parameters in the operating system; these kernel parameters are the data volume threshold. When the real-time data volume through the NIC exceeds the data volume threshold, the target device will quickly perform rate limiting to reduce the amount of data consumed by the heterogeneous card for various types of computing tasks per unit time, thereby limiting the operating power of the heterogeneous card.
[0082] It should be noted that since the target device typically uses the acquired data to process various types of computing tasks on heterogeneous cards, and primarily processes these tasks by containerizing the relevant programs within the heterogeneous card container, adjusting the network interface card's (NIC) data volume threshold can regulate the amount of data processed by the heterogeneous card container within the target device, thus adjusting the communication load of the heterogeneous card container. See also... Figure 5 As shown, after lowering the data volume threshold, the amount of data input to the target device is reduced, thereby limiting the communication load of the target device. The communication load of heterogeneous card container 504 and heterogeneous card container 505 is also reduced accordingly.
[0083] In some embodiments, the target device can lower the data volume threshold multiple times. Accordingly, the data volume threshold is lowered; the value of an adjustment parameter, which indicates the number of times the data volume threshold has been adjusted, is incremented; and the data volume threshold is lowered repeatedly if the value of the adjustment parameter is not greater than the number of times it has been adjusted. It should be noted that before the first adjustment of the data volume threshold, the value of the adjustment parameter is cleared to zero; after the first adjustment, the value of the adjustment parameter is set to 1. In subsequent processing, if the value of the adjustment parameter does not exceed the number of times it has been adjusted, the value of the adjustment parameter is incremented by 1 after each adjustment. By repeatedly adjusting the data volume threshold of the network card, thereby limiting the real-time data volume of the network card, the operating power of the target device can be reduced as much as possible, minimizing the failure rate of heterogeneous cards without affecting actual business operations at the product level.
[0084] In some embodiments, the relationship between the operating power and the power threshold within a preset duration is used to determine whether the data volume threshold needs to be adjusted again. Accordingly, if the value of the adjustment parameter is not greater than the number of times threshold is set, the operating power of the target device is collected at first preset intervals. If the operating power is less than the power threshold at any time within a third preset duration, the operating power of the target device is continuously collected again. The third preset duration is an integer multiple of the first preset duration. If the operating power at the end of the third preset duration is greater than the power threshold, the data volume threshold is lowered again, and the value of the adjustment parameter is incremented by one. By determining whether the control target is reached within a preset duration after the current data volume threshold adjustment, it is possible to determine whether the next data volume threshold adjustment is needed, thus limiting the real-time data volume of the network card and maximizing the reduction of the target device's operating power.
[0085] For example, the target device continuously collects its operating power data through a data acquisition program. Typically, the acquisition frequency is set to multiple times per second. After the target device executes the second control strategy, it reports the collected data to the server every minute. Typically, the third preset duration is set to 1 minute, meaning the third preset duration corresponds to one reporting cycle. After one reporting cycle, if the target device's operating power in the reported data is not greater than the power threshold, the target device determines that the operating power control target has been achieved after adjusting the data volume threshold. At this point, the target device's operating power is continuously monitored again. If, after one reporting cycle, the target device's operating power in the reported data is still greater than the power threshold, the target device determines that the operating power control target has not been achieved after adjusting the data volume threshold. At this point, the data volume threshold is adjusted again.
[0086] In some embodiments, the decision to execute a third control strategy is determined by assessing the relationship between the value of the adjustment parameter and a threshold number of times. Accordingly, if the value of the adjustment parameter is not greater than the threshold number of times, the data volume threshold is repeatedly lowered; if the value of the adjustment parameter is greater than the threshold number of times, the third control strategy is executed. This third control strategy is used to migrate multiple heterogeneous card containers to other devices at the device management level. By assessing the relationship between the value of the adjustment parameter and the threshold number of times, it is possible to determine whether executing the second control strategy within preset conditions achieves the control objective, facilitating the determination of whether the next level of the third control strategy needs to be executed, thereby achieving multi-level control of the target device's operating power.
[0087] 305. If the operating power control target is not achieved after executing the second control strategy, the third control strategy is executed. The third control strategy is used to migrate multiple heterogeneous card containers to other devices in the device management dimension.
[0088] In this embodiment, the third control strategy refers to the control strategy at the device management level. Since the third control strategy involves migrating the heterogeneous card container to other devices, the target device is in a downtime state during the migration process, and the heterogeneous card cannot perform various types of computing tasks, thus impacting actual business operations at the product level. The heterogeneous card container is used to provide an independent operating environment for multiple programs, and other devices refer to other electronic devices equipped with heterogeneous cards.
[0089] In some embodiments, the third control strategy is implemented by migrating heterogeneous card containers. Accordingly, the configuration files of multiple heterogeneous card containers are copied to other devices; multiple heterogeneous card containers are started on the other devices; multiple heterogeneous card containers are cleared from the target device; and the operating power of the other devices is continuously collected again. It should be noted that the third control strategy can also instruct at least one of the multiple heterogeneous containers to be migrated to other devices; this application embodiment does not limit this. See also Figure 5 As shown, when the operating power of the target device is continuously higher than the power threshold, by clearing the heterogeneous card container 506 with excessive communication load in the target container and starting a new heterogeneous card container 507 with lower communication load in other devices, it is possible to prevent the heterogeneous card in the target device from being continuously overloaded, thereby preventing damage to the heterogeneous card and reducing the overall failure rate of the heterogeneous card.
[0090] For a clearer description of the migration process of heterogeneous card containers, see [link to relevant documentation]. Figure 8 As shown, Figure 8 This is a schematic diagram of device management according to an embodiment of this application. The data acquisition program reports the collected data to the server every minute to facilitate subsequent judgment of the operating power and power threshold. In other words, the target device determines the detection result every minute, which indicates whether the operating power has dropped below the power threshold. This detection result reflects whether the target device has achieved the control target after implementing the control strategy. It should be noted that the above-mentioned reporting cycle of every minute is only an example, and this embodiment of the application does not limit it. When the detection result indicates that the control target has not been reached after several reporting cycles (i.e., the number of times threshold) following the execution of the second control strategy, a new resource node is matched, and a heterogeneous card container is started in the new resource node to provide an independent operating environment for the heterogeneous card to perform various types of computing tasks. At the same time, the data in the original heterogeneous card container in the high-power target device is cleared. The new resource node refers to other electronic devices with heterogeneous cards installed.
[0091] For a clearer description of the overall process, please refer to [link / reference]. Figure 9 As shown, Figure 9This is a schematic diagram of an overall process provided according to an embodiment of this application. First, a power threshold corresponding to the target device is preset, and the operating power of the target device is collected through a data acquisition program. Then, it is determined whether the operating power exceeds the power threshold. When the operating power of the target device exceeds the power threshold, a first control strategy is executed; when the operating power of the target device does not exceed the power threshold, the operating power of the target device is continuously monitored again. After executing the first control strategy, it is determined whether the operating power of the target device has decreased below the power threshold. When the operating power of the target device decreases below the power threshold, it is determined that the control of the operating power of the target device is complete, and the operating power of the target device is continuously monitored again; when the operating power of the target device does not decrease below the power threshold, a second control strategy is executed, lowering the data volume threshold. After each lowering of the data volume threshold, it is determined whether the operating power of the target device has decreased below the power threshold. When the operating power of the target device decreases below the power threshold, it is determined that the control of the operating power of the target device is complete, and the operating power of the target device is continuously monitored again; when the operating power of the target device does not decrease below the power threshold, the value of the adjustment parameter is incremented by 1, and the data volume threshold is lowered again, while simultaneously determining whether the value of the adjustment parameter exceeds the number of times threshold. When the value of the adjusted parameter exceeds the threshold number of times, the third control strategy is executed, and the control of the operating power is determined to be completed, while the operating power is continuously monitored.
[0092] The following example illustrates a scenario where a game model and a speech model are trained simultaneously on a target device. During training, if the target device's operating power exceeds a power threshold, the target device can optionally reallocate the time slices for game model training and speech model training; it can also restrict the input of various types of training data via the network card during the data retrieval process for game and speech model training; and it can migrate the computational containers related to the game and speech model training programs to other resource nodes. By employing one or more of these control methods, the target device can regulate its operating power and prevent damage to heterogeneous cards.
[0093] This application provides a method for regulating operating power. By using the relationship between operating power and a power threshold as a basis, a target regulation strategy is executed to reduce the operating power of the target device, thereby preventing the target device from being continuously in a power overload state and causing damage to the heterogeneous card. This solution not only reduces the failure rate of heterogeneous cards and increases their lifespan to some extent, but also avoids increased costs and project delays caused by replacing heterogeneous cards.
[0094] Figure 10This is a block diagram of an operating power regulation device according to an embodiment of this application. The device is used to execute the steps of the above-described operating power regulation method, see [link to relevant documentation]. Figure 10 The power control device includes: an acquisition module 1001, a control module 1002, and a detection module 1003.
[0095] The acquisition module 1001 is used to acquire the operating power of the target device. The computing power container of the target device includes multiple heterogeneous card containers. The multiple heterogeneous card containers are used to perform various data processing tasks, including model training tasks, image processing tasks, and data analysis tasks.
[0096] The control module 1002 is used to execute a target control strategy when the operating power of the target device is greater than the power threshold. The target control strategy is used to reduce the operating power of the target device through control methods in at least one dimension. The at least one dimension includes a program execution dimension, a network communication dimension, and a device management dimension. The program execution dimension is used to instruct control based on the time slice of the heterogeneous computing core. The network communication dimension is used to instruct control based on the communication load of multiple heterogeneous card containers. The device management dimension is used to instruct control by scheduling multiple heterogeneous card containers.
[0097] The detection module 1003 is used to continuously acquire the operating power of the target device when the operating power of the target device is not greater than the power threshold.
[0098] In some embodiments, the control module 1002 is configured to: execute a first control strategy when the operating power of the target device exceeds a power threshold, wherein the first control strategy is configured to reallocate time slices corresponding to multiple programs in the program execution dimension, and each time slice is configured to indicate the time period of the heterogeneous card processing program; or / and, execute a second control strategy when the operating power of the target device exceeds a power threshold, wherein the second control strategy is configured to adjust the amount of data input to the target device through the network card in the network communication dimension based on a data volume threshold, wherein the data volume threshold is configured to indicate the maximum amount of data allowed to be input to the target device through the network card per unit time; or / and, execute a third control strategy when the operating power of the target device exceeds a power threshold, wherein the third control strategy is configured to migrate multiple heterogeneous card containers to other devices in the device management dimension, wherein other devices refer to other electronic devices with heterogeneous cards installed.
[0099] In some embodiments, Figure 11 This is a block diagram of another power control device according to an embodiment of this application. See also... Figure 11 As shown, the control module 1002 includes:
[0100] The first control unit 1101 is used to execute a first control strategy when the operating power of the target device is greater than the power threshold. The first control strategy is used to reallocate time slices corresponding to multiple programs in the program running dimension. Each time slice is used to indicate the time period of the heterogeneous card processing program.
[0101] The acquisition unit 1102 is used to acquire the operating power of the target device at intervals of a first preset time period;
[0102] The acquisition unit 1102 is also used to continuously acquire the operating power of the target device again when the operating power is less than the power threshold within any of the second preset durations, wherein the second preset duration is an integer multiple of the first preset duration.
[0103] The second control unit 1103 is used to execute a second control strategy when the operating power at the end of the second preset time period is greater than the power threshold. The second control strategy is used to adjust the amount of data input to the target device through the network card based on the data volume threshold in the network communication dimension. The data volume threshold is used to indicate the maximum amount of data allowed to be input to the target device through the network card per unit time.
[0104] In some embodiments, the second control unit 1103 is configured to: lower the data volume threshold when the operating power at the end of the second preset duration is greater than the power threshold; increment the value of the adjustment parameter by one, wherein the adjustment parameter is used to indicate the number of times the data volume threshold has been adjusted; and repeatedly lower the data volume threshold when the value of the adjustment parameter is not greater than the number of times threshold.
[0105] In some embodiments, the second control unit 1103 is further configured to: collect the operating power of the target device at first preset intervals when the value of the adjustment parameter is not greater than the number of times threshold; collect the operating power of the target device again when the operating power is less than the power threshold at any time within a third preset interval, wherein the third preset interval is an integer multiple of the first preset interval; and lower the data volume threshold again and increment the value of the adjustment parameter by one when the operating power at the end of the third preset interval is greater than the power threshold.
[0106] In some embodiments, the second control unit 1103 is further configured to execute a third control strategy when the value of the adjustment parameter is greater than the number of times threshold. The third control strategy is configured to migrate multiple heterogeneous card containers to other devices in the device management dimension. Other devices refer to other electronic devices that have heterogeneous cards installed.
[0107] In some embodiments, the control module 1002 is further configured to interleave idle time slices in the time slices corresponding to multiple programs, and the idle time slices are used to implement the delay calculation of multiple programs.
[0108] In some embodiments, the control module 1002 is further configured to lower the data volume threshold to obtain an adjusted data volume threshold; when the real-time data volume of the network card is not greater than the adjusted data volume threshold, the real-time data volume of the network card is continuously detected, wherein the real-time data volume of the network card is the amount of data input to the target device through the network card in real time; when the real-time data volume of the network card is greater than the adjusted data volume threshold, the real-time data volume of the network card is reduced to below the adjusted data volume threshold.
[0109] In some embodiments, the control module 1002 is further configured to copy the configuration files of multiple heterogeneous card containers to other devices; start multiple heterogeneous card containers in other devices; clear multiple heterogeneous card containers in the target device; and continuously collect the operating power of other devices again.
[0110] This application provides a power control device that, based on the relationship between operating power and a power threshold, executes a target control strategy to reduce the operating power of the target device. This prevents the target device from being continuously under power overload, which could lead to damage to the heterogeneous card. This device not only reduces the failure rate of heterogeneous cards and increases their lifespan to some extent, but also avoids increased costs and project delays caused by replacing heterogeneous cards.
[0111] It should be noted that the power control device provided in the above embodiments is only illustrated by the division of the above functional modules when running the application. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal can be divided into different functional modules to complete all or part of the functions described above. In addition, the power control device and the power control method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0112] Figure 12 This is a schematic diagram of a terminal according to an embodiment of this application. The terminal 1200 can be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The terminal 1200 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.
[0113] Typically, terminal 1200 includes a processor 1201 and a memory 1202.
[0114] Processor 1201 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1201 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1201 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1201 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1201 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0115] The memory 1202 may include one or more computer-readable storage media, which may be non-transitory. The memory 1202 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1202 are used to store at least one computer program, which is executed by the processor 1201 to implement the power control method provided in the method embodiments of this application.
[0116] In some embodiments, the terminal 1200 may also optionally include a peripheral device interface 1203 and at least one peripheral device. The processor 1201, memory 1202, and peripheral device interface 1203 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1203 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: radio frequency circuitry 1204, display screen 1205, camera assembly 1206, audio circuitry 1207, and power supply 1208.
[0117] Peripheral device interface 1203 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1201 and memory 1202. In some embodiments, processor 1201, memory 1202 and peripheral device interface 1203 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1201, memory 1202 and peripheral device interface 1203 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0118] The radio frequency (RF) circuit 1204 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1204 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1204 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. In some embodiments, the RF circuit 1204 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1204 can communicate with other terminals via at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1204 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0119] Display screen 1205 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1205 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1201 for processing. In this case, display screen 1205 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1205, disposed on the front panel of terminal 1200; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 1200 or in a folded design; in still other embodiments, display screen 1205 may be a flexible display screen, disposed on a curved or folded surface of terminal 1200. Furthermore, display screen 1205 may also be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1205 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0120] The camera assembly 1206 is used to acquire images or videos. In some embodiments, the camera assembly 1206 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1206 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash is a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0121] The audio circuit 1207 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 1201 for processing, or input to the radio frequency circuit 1204 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each positioned at a different location on the terminal 1200. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 1201 or the radio frequency circuit 1204 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 1207 may also include a headphone jack.
[0122] Power supply 1208 is used to power the various components in terminal 1200. Power supply 1208 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1208 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0123] In some embodiments, the terminal 1200 further includes one or more sensors 1209. The one or more sensors 1209 include, but are not limited to: an acceleration sensor 1210, a gyroscope sensor 1211, a pressure sensor 1212, an optical sensor 1213, and a proximity sensor 1214.
[0124] Accelerometer 1210 can detect the magnitude of acceleration on the three coordinate axes of a coordinate system established with terminal 1200. For example, accelerometer 1210 can be used to detect the components of gravitational acceleration on the three coordinate axes. Processor 1201 can control display screen 1205 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 1210. Accelerometer 1210 can also be used for games or for acquiring user motion data.
[0125] The gyroscope sensor 1211 can detect the orientation and rotation angle of the terminal 1200. The gyroscope sensor 1211 can work in conjunction with the accelerometer sensor 1210 to collect the user's 3D movements on the terminal 1200. Based on the data collected by the gyroscope sensor 1211, the processor 1201 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0126] The pressure sensor 1212 can be disposed on the side bezel of the terminal 1200 and / or on the lower layer of the display screen 1205. When the pressure sensor 1212 is disposed on the side bezel of the terminal 1200, it can detect the user's grip signal on the terminal 1200, and the processor 1201 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 1212. When the pressure sensor 1212 is disposed on the lower layer of the display screen 1205, the processor 1201 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 1205. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0127] Optical sensor 1213 is used to collect ambient light intensity. In one embodiment, processor 1201 can control the display brightness of display screen 1205 based on the ambient light intensity collected by optical sensor 1213. Optionally, when the ambient light intensity is high, the display brightness of display screen 1205 is increased; when the ambient light intensity is low, the display brightness of display screen 1205 is decreased. In another embodiment, processor 1201 can also dynamically adjust the shooting parameters of camera assembly 1209 based on the ambient light intensity collected by optical sensor 1213.
[0128] The proximity sensor 1214, also known as a distance sensor, is installed on the front panel of the terminal 1200. The proximity sensor 1214 is used to detect the distance between the user and the front of the terminal 1200. In one embodiment, when the proximity sensor 1214 detects that the distance between the user and the front of the terminal 1200 is gradually decreasing, the processor 1201 controls the display screen 1205 to switch from a screen-on state to a screen-off state; when the proximity sensor 1214 detects that the distance between the user and the front of the terminal 1200 is gradually increasing, the processor 1201 controls the display screen 1205 to switch from a screen-off state to a screen-on state.
[0129] Those skilled in the art will understand that Figure 12 The structure shown does not constitute a limitation on terminal 1200 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0130] Figure 13This is a schematic diagram of a server structure according to an embodiment of this application. The server 1300 can vary considerably due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1301 and one or more memories 1302. The memory 1302 stores at least one computer program, which is loaded and executed by the processor 1301 to implement the power control method provided in the above-described method embodiments. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated here.
[0131] This application also provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to implement the power control method described in the above embodiments. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, or optical data storage device, etc.
[0132] This application also provides a computer program product, including a computer program that is executed by a processor to implement the power control method in this application embodiment.
[0133] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0134] The above are merely optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for regulating operating power, characterized in that, The method includes: The operating power of the target device is obtained. The computing power container of the target device includes multiple heterogeneous card containers. The multiple heterogeneous card containers are used to perform various data processing tasks, including model training tasks, image processing tasks, and data analysis tasks. When the operating power of the target device exceeds a power threshold, a target control strategy is executed. The target control strategy is used to reduce the operating power of the target device through control methods in at least one dimension. The at least one dimension includes a program execution dimension, a network communication dimension, and a device management dimension. The program execution dimension is used to indicate control based on the time slice of the heterogeneous computing core. The network communication dimension is used to indicate control based on the communication load of the multiple heterogeneous card containers. The device management dimension is used to indicate control by scheduling the multiple heterogeneous card containers. The operating power of the target device is continuously acquired if the operating power of the target device is not greater than the power threshold.
2. The method according to claim 1, characterized in that, When the operating power of the target device is greater than the power threshold, the target control strategy is executed, including: When the operating power of the target device exceeds a power threshold, a first control strategy is executed. This first control strategy is used to reallocate time slices corresponding to multiple programs along the program execution dimension, with each time slice indicating a time period for the heterogeneous card processing program; or / and, When the operating power of the target device exceeds a power threshold, a second control strategy is executed. This second control strategy adjusts the amount of data input to the target device via the network interface card (NIC) based on a data volume threshold in the network communication dimension. The data volume threshold indicates the maximum amount of data allowed to be input to the target device via the NIC per unit time; or / and If the operating power of the target device is greater than the power threshold, a third control strategy is executed. The third control strategy is used to migrate the multiple heterogeneous card containers to other devices in the device management dimension. The other devices refer to other electronic devices with heterogeneous cards installed.
3. The method according to claim 1, characterized in that, When the operating power of the target device is greater than the power threshold, the target control strategy is executed, including: When the operating power of the target device is greater than the power threshold, a first control strategy is executed. The first control strategy is used to reallocate time slices corresponding to multiple programs in the program running dimension. Each time slice is used to indicate the time period of the heterogeneous card processing program. The operating power of the target device is collected at each first preset time interval; If the operating power is less than the power threshold at any time within the second preset time period, the operating power of the target device will be continuously collected again, where the second preset time period is an integer multiple of the first preset time period. If the operating power at the end of the second preset duration is greater than the power threshold, a second control strategy is executed. The second control strategy is used to adjust the amount of data input to the target device through the network card based on a data volume threshold in the network communication dimension. The data volume threshold is used to indicate the maximum amount of data allowed to be input to the target device through the network card per unit time.
4. The method according to claim 3, characterized in that, When the operating power at the end of the second preset duration is greater than the power threshold, the second control strategy is executed, including: If the operating power at the end of the second preset duration is greater than the power threshold, the data volume threshold is lowered. Increment the value of the adjustment parameter by one, the adjustment parameter being used to indicate the number of times the data volume threshold has been adjusted; If the value of the adjustment parameter is not greater than the number of times threshold, the data volume threshold is repeatedly lowered.
5. The method according to claim 4, characterized in that, The step of repeatedly lowering the data volume threshold when the value of the adjustment parameter is not greater than the number of times threshold includes: If the value of the adjustment parameter is not greater than the number of times threshold, the operating power of the target device is collected at each first preset time interval; If the operating power is less than the power threshold at any time within the third preset time period, the operating power of the target device will be continuously collected again, and the third preset time period is an integer multiple of the first preset time period. If the operating power at the end of the third preset duration is greater than the power threshold, the data volume threshold is lowered again, and the value of the adjustment parameter is incremented by one.
6. The method according to claim 4, characterized in that, The method further includes: If the value of the adjustment parameter is greater than the number of times threshold, a third control strategy is executed. The third control strategy is used to migrate the multiple heterogeneous card containers to other devices in the device management dimension. The other devices refer to other electronic devices with heterogeneous cards installed.
7. The method according to claim 2 or claim 3, characterized in that, The execution of the first control strategy includes: Interspersed time slices are used in the time slices corresponding to the multiple programs to implement delayed calculations for the multiple programs.
8. The method according to claim 2 or claim 3, characterized in that, The implementation of the second control strategy includes: Lower the data volume threshold to obtain the adjusted data volume threshold; When the real-time data volume of the network card is not greater than the adjusted data volume threshold, the real-time data volume of the network card is continuously detected. The real-time data volume of the network card is the amount of data input to the target device through the network card that is detected in real time. When the real-time data volume of the network card exceeds the adjusted data volume threshold, the real-time data volume of the network card is reduced to below the adjusted data volume threshold.
9. The method according to claim 2 or claim 6, characterized in that, The implementation of the third regulatory strategy includes: Copy the configuration files of the multiple heterogeneous card containers to the other devices; The plurality of heterogeneous card containers are activated in the other devices; Remove the plurality of heterogeneous card containers from the target device; Continue to collect the operating power of the other devices.
10. A power control device, characterized in that, The device includes: The acquisition module is used to acquire the operating power of the target device. The computing power container of the target device includes multiple heterogeneous card containers. The multiple heterogeneous card containers are used to perform various data processing tasks, including model training tasks, image processing tasks, and data analysis tasks. The control module is used to execute a target control strategy when the operating power of the target device is greater than a power threshold. The target control strategy is used to reduce the operating power of the target device through control methods in at least one dimension. The at least one dimension includes a program execution dimension, a network communication dimension, and a device management dimension. The program execution dimension is used to indicate control based on the time slice of the heterogeneous computing core. The network communication dimension is used to indicate control based on the communication load of the multiple heterogeneous card containers. The device management dimension is used to indicate control by scheduling the multiple heterogeneous card containers. The detection module is used to continuously acquire the operating power of the target device when the operating power of the target device is not greater than the power threshold.
11. A computer device, characterized in that, The computer device includes a processor and a memory, the memory being used to store at least one computer program, the at least one computer program being loaded by the processor and executed as the power control method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store at least one computer program for executing the power control method according to any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the power control method according to any one of claims 1 to 9.