Computing power processing method, apparatus and device

By monitoring the runtime of processes or threads on multi-core CPUs and combining it with core computing power weights, the problem of distorted computing power consumption estimation in existing technologies has been solved, achieving more accurate reflection of computing power consumption and system optimization.

CN123178203APending Publication Date: 2026-11-27ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611378616.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies cannot accurately reflect the actual computing power consumption on a central processing unit (CPU), especially in multi-core heterogeneous CPU environments, as they ignore the differences in computing power between different cores, leading to distorted computing power estimates.

Method used

By monitoring the running time of processes or threads on each CPU core and combining it with the computing power weight of each core, the actual computing power consumption can be calculated.

Benefits of technology

It accurately reflects the actual computing power consumption of each process or thread, avoiding misjudgments and underestimations caused by core differences, and provides a more accurate basis for resource scheduling and optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178203A_ABST
    Figure CN123178203A_ABST
Patent Text Reader

Abstract

The application provides a computing power processing method, device and equipment, comprising: monitoring a statistical object, obtaining running time of the statistical object on each core of a central processing unit (CPU), the statistical object being a process or a thread; obtaining a computing power weight of each core; and determining computing power consumption data of the statistical object according to each running time and the computing power weight of each core. The actual computing power consumption of each process or thread is more accurately reflected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of performance testing technology, and in particular to a computing power processing method, apparatus and device. Background Technology

[0002] When analyzing the CPU resource usage of applications, the `top` tool (system task manager) is often used to count the runtime of each process or thread within a process to determine the CPU usage percentage. However, this method cannot accurately reflect the actual computing power consumption of the application. Summary of the Invention

[0003] This application provides a computing power processing method, apparatus, and device that can more accurately reflect the actual computing power consumption of each process or thread.

[0004] In a first aspect, this application provides a computing power processing method, comprising: monitoring a statistical object, obtaining the running time of the statistical object on each core of a central processing unit (CPU), wherein the statistical object is a process or a thread; obtaining the computing power weight of each core; and determining the computing power consumption data of the statistical object based on the running time and the computing power weight of each core.

[0005] Secondly, this application provides a computing power processing device, comprising: a time acquisition module for monitoring a statistical object and acquiring the running time of the statistical object on each core of the central processing unit (CPU), wherein the statistical object is a process or a thread; a weight acquisition module for acquiring the computing power weight of each core; and a processing module for determining the computing power consumption data of the statistical object based on each running time and the computing power weight of each core.

[0006] Thirdly, this application provides an electronic device, including: a processor and a memory, the memory for storing a computer program, and the processor for calling and running the computer program stored in the memory to perform the methods as described in the first aspect or its various implementations.

[0007] Fourthly, this application provides a computer-readable storage medium for storing a computer program that causes a computer to perform the methods described in the first aspect or its various implementations.

[0008] Fifthly, this application provides a computer program product including computer program instructions that cause a computer to perform the methods as described in the first aspect or its various implementations.

[0009] Sixthly, this application provides a computer program that causes a computer to perform the methods described in the first aspect or its various implementations.

[0010] The technical solution of this application allows for the monitoring of statistical objects, obtaining the runtime of the statistical object on each core of the central processing unit (CPU), where the statistical object is a process or thread; obtaining the computing power weight of each core; and determining the computing power consumption data of the statistical object based on the runtime of each runtime and the computing power weight of each core. In this process, because this application considers the differences in computing power between different CPU cores and the impact of core type on actual processing power, it can differentiate the runtime of the statistical object on each core, distinguishing the time spent running on higher-performance cores from the time spent running on lower-performance cores. This avoids misjudging lightweight tasks running on smaller cores for extended periods as high-computing-power-consuming tasks, and also avoids underestimating the computing power consumption of heavy-computing tasks running on larger cores for short periods. Furthermore, by combining the computing power weight of each core to determine the computing power consumption data of the statistical object, it can more accurately reflect the actual computing power consumption of each process or thread.

[0011] Other technical features and effects involved in the technical solution of this application will be described in subsequent embodiments, and will not be repeated here to avoid repetition. Attached Figure Description

[0012] The accompanying drawings used in the following description of the embodiments are introduced.

[0013] Figure 1 A flowchart illustrating a computing power processing method provided in this application embodiment; Figure 2A A schematic diagram illustrating a computing power processing method provided in an embodiment of this application; Figure 2B A schematic diagram illustrating another computing power processing method provided in an embodiment of this application; Figure 2C A schematic diagram illustrating another computing power processing method provided in an embodiment of this application; Figure 2D A schematic diagram illustrating another computing power processing method provided in an embodiment of this application; Figure 3 A schematic diagram of the computing power processing device provided in the embodiments of this application; Figure 4 A schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0015] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0016] In one embodiment, the technical solution of this application can be used in computing power processing scenarios. For example, it can be applied to computing power processing scenarios in vehicle environments, where the vehicle system can simultaneously run multiple tasks such as navigation applications, multimedia playback applications, and vehicle status monitoring background services. These tasks can be scheduled to execute on different types of large cores, medium cores, or small cores. Using the solution of this application, the running time of each task on different types of cores can be distinguished, thereby accurately calculating the actual computing power consumption of each task (or the corresponding process and / or thread), avoiding distortion in computing power estimation caused by ignoring core differences, and providing a reliable basis for resource scheduling, power consumption optimization, and functional deployment of vehicle systems.

[0017] For example, it can also be applied to mobile terminal scenarios, such as smartphones or tablets. These devices can employ multi-core heterogeneous CPUs (such as ARM's big.LITTLE or DynamIQ architecture) to simultaneously run foreground interactive applications (such as social media apps and video playback) and background services (such as push notifications and data synchronization). This solution can accurately track the runtime of each application process or thread on the large, medium, and small cores, and combine this with core computing power weights to calculate the actual computing power consumption. This helps the operating system perform more reasonable thread scheduling, heat management, and power consumption management, avoiding unnecessary overheating or performance degradation caused by distorted computing power statistics.

[0018] For example, it can also be applied to cloud computing or containerized deployment scenarios. Cloud servers or physical machine clusters can include multi-core heterogeneous CPUs (such as Intel P-core / E-core architecture). The cloud platform can accurately measure the computing power of containers or virtual machines for different tenants. Using the solution in this application, the runtime of each container can be statistically analyzed by core type, and the actual computing power consumption can be obtained by weighting the computing power, thereby achieving fairer resource measurement, more accurate performance isolation, and more efficient quality of service assurance.

[0019] For example, it can also be applied to edge computing nodes or industrial control equipment. Through the solution presented in this application, the computing power distribution of various business processes on different cores can be analyzed periodically, guiding automated optimization strategies and improving system energy efficiency and task response speed.

[0020] In one embodiment, the solution provided in this application can be executed by any electronic device with data processing capabilities. For example, the electronic device can be a server, specifically a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Alternatively, the electronic device can be a terminal device, specifically a tablet computer, laptop computer, or desktop computer. Furthermore, the electronic device can be a combination of a server and a terminal device, wherein the server and terminal device in the combination can communicate wirelessly or via wired means. This application does not impose specific limitations on the electronic device.

[0021] In one embodiment, the solution provided in this application can be executed through an in-vehicle system, such as an intelligent cockpit system, an autonomous driving computing platform, a domain controller (such as an intelligent cockpit domain, a body control domain), or an in-vehicle infotainment system (IVI) integrated into a vehicle. This in-vehicle system may include a multi-core heterogeneous processor (such as an ARM big.LITTLE architecture or a DynamIQ architecture), run a Linux or Android Automotive operating system, and support a CPU Accounting cgroup subsystem (cpuacct) or a CPU Accounting Control Group (cpuacct cgroup) to provide kernel support for process or thread-level computing power statistics in this application.

[0022] It should be noted that all technical solutions in this application can be combined in any way to form optional embodiments of this application. To avoid repetition, these will not be elaborated upon.

[0023] Furthermore, the specific embodiments of this application involve data, information, or instructions such as running time and computing power consumption. When the embodiments of this application are applied to specific products or technologies, user permission, consent, or authorization is required, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards.

[0024] The technical solution of this application will be described in detail below: In some embodiments, Figure 1 This is a flowchart illustrating a computing power processing method provided in an embodiment of this application. This method can be executed by the aforementioned electronic device, but is not limited thereto. Figure 1 As shown, the method may include S110-S130.

[0025] S110: Monitor the statistical object and obtain the running time of the statistical object on each core of the central processing unit (CPU). The statistical object is a process or thread.

[0026] For example, a process or thread can be a process or thread in a navigation application, such as a map rendering thread, a route planning thread, a GPS data acquisition thread, etc.

[0027] For example, a CPU can adopt a multi-core heterogeneous architecture, and its core types can be divided according to the actual hardware design. For instance, a CPU can include three types: large cores, medium cores, and small cores. Large cores can have the highest computing performance and are suitable for handling complex computational tasks; medium cores can balance performance and power consumption and handle routine tasks; and small cores can run in a low-power mode and handle lightweight background tasks. Alternatively, CPU cores can also be divided into power-efficient cores, medium cores, and large cores according to their functional roles. While the naming conventions differ, they essentially serve to distinguish cores with different computing power levels. Alternatively, a CPU can also contain multiple different large cores (such as different frequencies or microarchitecture versions), multiple different small cores, or multiple different medium cores.

[0028] For example, the CPU accounting subsystem cpuacct can be used to monitor statistical objects and obtain the runtime on each core. For instance, the cpuacct cgroup can be used to monitor statistical objects and obtain the runtime on each core. cpuacct is a subsystem within the Linux kernel cgroup architecture that can be used to calculate the cumulative runtime of processes or threads on different CPU cores, providing fine-grained, high-precision kernel-level time data.

[0029] For example, each process or thread that needs to be monitored can be assigned to a cgroup control group. The cpuacct subsystem can automatically record the runtime of all statistical objects within that group on each CPU core. For instance, when a process is scheduled to execute on a large core, cpuacct can start accumulating the process's runtime on the large core; when the process switches to a small core or is suspended, cpuacct can record the segmented time on different cores. The runtime data of each process or thread on each CPU core can be obtained by reading the interface file provided by the cpuacct subsystem.

[0030] For example, when the system running the statistical object starts up, the computing power statistics and analysis program of the executing subject of this application (such as the aforementioned electronic device or vehicle system, but not limited to these) can first start the cpuacct cgroup module, enabling it to begin comprehensive monitoring of all running and subsequently started processes and threads in the system. During system operation, the cpuacct cgroup module can record the running time of each process and thread on each CPU core in real time. Specifically, this module can rely on the scheduling mechanism of the operating system kernel to update the corresponding running time record whenever a process or thread starts or ends running on a certain core. For example, when a new navigation application process starts and is scheduled to run on a large core, the cpuacct cgroup module can immediately start timing; when the process switches to another core or ends running, it can stop timing and record the duration of this run. Through the above mechanism, the cpuacct cgroup module can provide a precise and fine-grained time data foundation for subsequent computing power calculations.

[0031] In the above-described embodiment of S110, the running time of each process or thread in the system on different CPU cores can be accurately collected, providing a data foundation for subsequent weighted computing power calculation and evaluation of the remaining computing power of the system.

[0032] S120: Obtain the computing power weight of each core.

[0033] For example, computing power weight can be a coefficient used to measure the relative processing power of different types of CPU cores, and its value can reflect the effective workload that a core can complete per unit of runtime. For example, computing power weight is determined based on at least one of the following: the performance test results of the corresponding core, the usage of the corresponding core in the system corresponding to the statistical object, and the hardware characteristics of the CPU.

[0034] For example, a test program can be run to measure the throughput or processing power of each core under the same conditions, and the ratio of the test results can be used as the weighting basis. For example, if the performance score of the large core is 300, the medium core is 200, and the small core is 100, then the weighting ratio of the three can be set to 3:2:1.

[0035] For example, the weights of each core can be dynamically adjusted based on the resource utilization patterns of each core during actual system operation, making computing power statistics more closely reflect the actual operating environment. For instance, if a medium-sized core runs high-priority tasks for a long time with a stable frequency, its relative weight can be increased; if a large core frequently reduces its frequency due to thermal constraints, its current weight can be dynamically reduced.

[0036] For example, the hardware characteristics of a CPU can include inherent hardware attributes such as the core microarchitecture design, operating frequency range, instructions per clock cycle (IPC), cache size and hierarchy, and supported instruction set extensions.

[0037] For example, based on at least one of the following: performance test results for the corresponding core, the usage of the corresponding core in the system corresponding to the statistical object, and the hardware characteristics of the CPU, determine the computing power weight of each core, including: running preset performance test cases for each core (such as test cases that test the comprehensive processing capability of the core under different computing loads, such as test cases that measure integer and floating-point throughput, test cases that measure memory bandwidth and cache performance), recording the performance score of each core, and obtaining the basic computing power weight of each core; collecting load utilization data of each core within a preset statistical period (such as the percentage of CPU core utilization sampled per second), and calculating the computing power weight of each core based on the load utilization data of each core. The average utilization and peak utilization (representing the overall busyness and instantaneous load peak of each core within the statistical period) are used to adjust the corresponding basic computing power weights. The average utilization and peak utilization are positively correlated with the adjustment range. The adjusted basic computing power weights are then adjusted according to the CPU's hardware characteristics (e.g., the ratio of the operating frequencies of each core is used as the frequency adjustment coefficient, the ratio of the cache capacity of each core is used as the cache adjustment coefficient, the weighted product of the frequency adjustment coefficient and the cache adjustment coefficient is used as the comprehensive adjustment coefficient, and the adjusted basic computing power weights are multiplied by the comprehensive adjustment coefficients) to obtain the computing power weight of each core.

[0038] S130: Determine the computing power consumption data of the statistical object based on the computing power weight of each runtime and each core.

[0039] For example, computing power consumption data can be determined based on the weighted summation of each computing power weight and each runtime (i.e., a corresponding weighted summation for each runtime and each computing power weight). The computing power consumption data can be directly determined as the weighted summation result, and can be a computing power consumption value. Furthermore, based on the weighted summation, the calculation result can be further processed or transformed to adapt to different application requirements or statistical granularities. For instance, the weighted summation result can be divided by the total available computing power of the system or a certain benchmark computing power value to obtain a normalized computing power consumption ratio (e.g., a percentage between 0 and 100%). Alternatively, the weighted summation result obtained from multiple consecutive sampling periods can be processed by moving average or exponential smoothing to reduce statistical noise caused by instantaneous jitter.

[0040] For example, the runtime of the statistical object on all CPU cores can be summed, and the total runtime obtained can be directly determined as the computing power consumption data of the statistical object. Alternatively, the runtime of the statistical object on each CPU core can be recorded separately to form a multi-dimensional vector, and this vector can be used as the computing power consumption data. Alternatively, the runtime of the statistical object on each core can be counted within a fixed time window (e.g., 5 seconds or 10 seconds), and the time data within the window can be used as the computing power consumption data for that period.

[0041] For example, when the system running the statistics object starts up, the computing power statistics and analysis program can read the pre-set configuration file of different core computing power weights. The computing power weights can be determined based on the performance test results of different cores and can be dynamically adjusted according to the actual usage and hardware characteristics of the system to adapt to different hardware platforms and application scenarios. For instance, because different cores have different performance, their computing power weights can also be different. For example, because large cores have strong computing power and high efficiency in handling complex tasks, their computing power weights can be higher; medium cores, next; and power-consuming cores, which mainly operate with low power consumption, can have lower computing power weights. By assigning reasonable weight values ​​to each type of core, runtime can be converted into a more meaningful metric for computing power consumption.

[0042] During system operation, the computing power statistics and analysis program can periodically (e.g., every 3 seconds) obtain the runtime data of each process and thread on each core from the cpuacctcgroup module. For each process or thread, the program can perform a weighted sum based on the pre-read core computing power weights to obtain the CPU computing power consumption value. For example, assuming the system contains three core types: large cores, medium cores, and power cores, a process runs on a large core for t1 seconds (large core computing power weight w1), runs on a medium core for t2 seconds (medium core computing power weight w2), and runs on a power core for t3 seconds (power core computing power weight w3), then the computing power consumption value of this process is w1×t1 + w2×t2 + w3×t3. Taking specific values ​​as an example: If the computing power weight of the large core is 3, and a process runs on the large core for 10 seconds; the computing power weight of the medium core is 2, and it runs on the medium core for 20 seconds; and the computing power weight of the power core is 1, and it runs on the power core for 30 seconds, then the CPU computing power consumption of this process is: 3×10 + 2×20 + 1×30 = 30 + 40 + 30 = 100.

[0043] It should be noted that the above weight values ​​and calculation methods are merely illustrative examples. In actual applications, the weight values ​​can be adjusted based on the performance test results of the specific hardware platform, and the calculation logic can also be extended according to actual needs (for example, a non-linear correction factor or a dynamic weight adjustment mechanism can be introduced). This application does not impose any restrictions on this.

[0044] In the above embodiments, a quantitative value reflecting the actual computing power consumption of each process or thread can be determined, providing an accurate data foundation for subsequent summarization of total system computing power, assessment of remaining computing power, and optimization of business modules.

[0045] In some embodiments, the technical solution of this application may further include: dividing all statistical objects of the target system corresponding to the statistical objects into modules according to business logic to obtain multiple business modules; and for each of the multiple business modules, analyzing the computing power consumption data of the statistical objects corresponding to the business module and generating a computing power consumption report.

[0046] For example, the target system can be the overall system environment running the technical solution of this application, such as an in-vehicle operating system, a mobile terminal system, or a cloud computing platform.

[0047] For example, the basis for dividing modules can be process name, thread name, startup relationship, user configuration, or mapping relationship specified through configuration file.

[0048] For example, the computing power consumption report may include information such as the running time of each process / thread on each core, the computing power consumption value, the computing power ratio within the module, and the total computing power consumption of the module. This provides a data foundation for subsequent optimization analysis.

[0049] In some embodiments, the technical solution of this application may further include: determining a target statistical object that meets a preset computing power consumption condition based on a computing power consumption report; determining a running optimization strategy based on the running logic (e.g., whether the thread really needs to be executed at high frequency) and running algorithm (e.g., whether there are inefficient loops or redundant calculations) of the target statistical object; optimizing the target statistical object according to the running optimization strategy; determining the optimized computing power consumption data of the optimized target statistical object (similar to S110-130), and determining whether to adjust the running optimization strategy based on the optimized computing power consumption data.

[0050] For example, the preset computing power consumption conditions can be that the computing power consumption value exceeds the preset threshold, the computing power consumption accounts for an abnormally high proportion within the module, or the running time on a specific core (such as a large core) is too long and the nature of the task is not compatible.

[0051] For example, optimization strategies may include, but are not limited to: adjusting task core binding (migrating non-core tasks from large cores to small cores), optimizing algorithm logic, reducing task execution frequency, and merging redundant tasks.

[0052] For example, the optimized computing power consumption data can be compared with the computing power consumption data before optimization. If the optimized computing power consumption is significantly reduced (the reduction is greater than or equal to the threshold) and the business functions are not affected, the optimization strategy is confirmed to be effective; otherwise, the optimization strategy needs to be adjusted and verified again to form a closed-loop optimization mechanism.

[0053] For example, determining an optimization strategy based on the execution logic and algorithm of the target statistical object may include: analyzing the execution logic of the target statistical object to determine whether it is a time-sensitive or computationally intensive task. If the object is a non-core task or a background task with low latency requirements, but is currently scheduled to run on a large core, the optimization strategy is to bind the task to a medium or small core, freeing up large core resources for more critical tasks. For example, a log compression thread may run on a large core for a long time, but its task is a background non-real-time task; it can be forcibly bound to a small core for execution. Alternatively, analyzing the execution algorithm of the target statistical object to identify inefficient calculations, redundant calculations, or unnecessary precision redundancy. The optimization strategy is to replace or improve the algorithm implementation. Alternatively, analyzing the execution frequency of the target statistical object to determine whether there is an excessively high polling frequency or unnecessary periodic wake-ups. The optimization strategy is to reduce the task execution frequency or use event-driven execution instead of polling. Alternatively, analyzing the priority of the target statistical object in the business module to determine whether there is a priority mismatch. The optimization strategy is to adjust the task priority or scheduling strategy. For example, if the map rendering thread of a navigation application has a lower priority than the background data synchronization thread, causing rendering tasks to be frequently preempted, the priority of the rendering thread can be increased.

[0054] For example, optimizing a target statistics object according to a runtime optimization strategy can include: binding the target statistics object to a specified core or core type for operation. For example, binding the log compression thread to a small core and the navigation rendering thread to a large core. Alternatively, modifying the source code of the target statistics object to optimize the algorithm implementation, reduce redundant calculations, reduce loop complexity, or introduce a caching mechanism. For example, merging repetitive memory copy operations in the software decoding loop of the video decoding thread into a single copy.

[0055] In some embodiments, the computing power statistics and analysis program can divide processes and threads into modules based on business logic. For example, for an in-vehicle system, it can be divided into a navigation business module, a multimedia business module, a vehicle status monitoring business module, etc. For each business module, the program can analyze the computing power consumption of each process and thread and generate a detailed computing power consumption report. The report may include information such as the running time of each process and thread on each core, the computing power consumption value, and the proportion of computing power it occupies in the entire business module.

[0056] Next, based on the computing power consumption report, processes and threads with excessively high (above the threshold) or unreasonable (difference from the preset value greater than the threshold) computing power consumption can be identified. For these target objects, their operating logic and algorithms can be analyzed to formulate corresponding optimization strategies. For example, if it is found that the video decoding thread in a multimedia playback business module runs on the big core for too long, and the tasks it processes are not core tasks, then the video decoding algorithm can be optimized to reduce its dependence on big core resources, or some tasks of this thread can be distributed to medium cores for execution, thereby reducing unnecessary computing power consumption.

[0057] Finally, the optimized strategies can be applied to the corresponding processes and threads. After optimization, computing power statistics and analysis can be performed again to verify the optimization effect. If the optimized computing power consumption is significantly reduced (e.g., the reduction is greater than or equal to the threshold) and the business functions are not negatively affected, the optimization strategy is effective; otherwise, the optimization strategy can be readjusted and verified again until the expected optimization goal is achieved.

[0058] In the above embodiments, the computing power utilization efficiency of business modules can be effectively improved, computing power waste can be reduced, and strong support can be provided for the overall performance optimization of the system.

[0059] In some embodiments, the technical solution of this application may further include: summarizing the computing power consumption data of all statistical objects under the target system corresponding to the statistical object to obtain the total computing power consumption data of the target system; determining the remaining computing power data of the target system based on the total available computing power data of the target system (e.g., which can be obtained through hardware specification documents, system configuration files, or hardware detection interfaces) and the total computing power consumption data (e.g., calculating the difference between the two to determine the remaining computing power data of the target system, where the remaining computing power data can reflect the additional computing power capacity that the current system can bear while maintaining normal operation); and determining the remaining computing power data based on at least one of the following of the function to be deployed: business logic (e.g., which sub-tasks the function includes, and the dependencies between tasks), expected performance requirements (e.g., response latency, throughput indicators), and algorithm complexity (e.g., business logic, sub-tasks, and dependencies between tasks), expected performance requirements (e.g., response latency, throughput indicators), and algorithm complexity (e.g., business logic, sub-tasks, and dependencies between tasks), based on the function to be deployed. The process involves considering time and space complexity, the amount of data to be processed (e.g., the size or frequency of expected input data), and determining the estimated computing power required for the deployed function (the estimated computing power can be a specific value or a range, such as minimum estimated computing power to maximum estimated computing power). Based on the remaining computing power and the estimated computing power, it is determined whether the target system can be in the target operating state when the deployed function is running. Based on the determination result, at least one of the following is performed: determining the deployment decision for the deployed function (e.g., deciding to deploy, postpone, or cancel deployment), evaluating the design of the deployed function (e.g., determining whether the function needs to be simplified or the computing power requirement reduced), and determining the optimization of the target system (e.g., deciding whether to optimize the existing system first to free up more computing power before considering deploying the new function).

[0060] For example, the total statistical object could be all running processes and threads in the system.

[0061] For example, the target operating state can refer to a state in which the system can maintain smooth operation without significant performance degradation (e.g., significant performance degradation can refer to a degradation value less than a threshold and / or a degradation degree greater than a threshold) or functional abnormalities. If the remaining computing power data is greater than or equal to the estimated computing power data (or the maximum value of the estimated computing power), then the system is determined to be in the target operating state; otherwise, the system is determined to be unable to be in the target operating state, that is, deploying new functions may lead to system overload or performance degradation.

[0062] For example, a computing power statistics and analysis program can aggregate the computing power consumption values ​​of all processes and threads to obtain the total computing power consumption of the current system. Simultaneously, the program can obtain the total available computing power information of the system, which can be obtained from the system hardware configuration file or through a specific hardware detection interface. Subtracting the total computing power consumption from the total available computing power yields the actual remaining computing power value of the current system.

[0063] The current system's actual remaining computing power can be used to assess how many new features can be deployed while maintaining smooth operation. For example, when planning to add a new intelligent voice interaction function to an in-vehicle system, comparing the estimated computing power requirement of the new function with the system's actual remaining computing power can determine whether the new function can be successfully deployed without affecting system smoothness. For instance, when planning to deploy a new function, the development team can estimate its required computing power based on the new function's business logic and expected performance requirements. For a new intelligent voice interaction function, the computing power requirement range under different usage scenarios can be estimated based on the algorithm complexity and expected data volume of modules such as speech recognition, semantic understanding, and speech synthesis. Then, the computing power statistics and analysis program can compare the estimated computing power requirement of the new function with the current system's actual remaining computing power. If the remaining computing power is greater than the estimated maximum computing power requirement of the new function, it means that the new function can be deployed without affecting the system's smooth operation under the current system state; otherwise, the design of the new function needs to be re-evaluated, or the existing system needs further optimization to release more computing power.

[0064] Furthermore, to more accurately assess the feasibility of deploying new features, simulations can be conducted in a test environment. For example, the actual operation of the new feature can be simulated in a test environment, while also considering the current system's computing power usage and overall performance. Through simulation, the impact of deploying the new feature on the overall system performance can be further confirmed, providing a more reliable basis for actual deployment.

[0065] In some embodiments, the system architecture of this application can be designed from both hardware and software levels. At the hardware level, the system can be based on a multi-core CPU architecture, possessing different types of cores, such as multiple power-efficient cores, medium-sized cores, and large cores, to support heterogeneous computing power scheduling. Simultaneously, sufficient memory can be configured to store intermediate data during process and thread execution, and non-volatile storage devices such as hard disks can be equipped to record relevant statistical data and persistent configuration files. At the software level, the operating system can have a built-in module supporting cpuacct cgroup functionality. This module can achieve accurate computing power statistics, recording the runtime of each process or thread on different cores at the kernel level. Furthermore, it can include an independent computing power statistics and analysis program that can interact with the cpuacct cgroup module to obtain real-time runtime data for each process and thread on each CPU core, and perform subsequent operations such as weighted computing power calculation, result aggregation, and remaining computing power analysis. Through the synergy of the aforementioned hardware and software system architecture, a foundation can be laid for subsequent accurate computing power statistics, business optimization, and new feature evaluation.

[0066] The technical solution of this application is illustrated below with diagrams: In some embodiments, such as Figure 2A As shown, the system architecture of this application's technical solution can include a hardware layer and a software layer. At the hardware level, the system can be based on a multi-core heterogeneous CPU architecture, containing multiple cores of different types (such as large cores, medium cores, and small cores), and includes RAM and storage devices (such as SSDs or eMMC) for data storage and persistence of statistical results. At the software level, the system can include a cpuacct cgroup module and a computing power statistics and analysis program. The cpuacct cgroup module can run at the operating system kernel level, responsible for monitoring all processes and threads, recording the running time of each statistical object, such as processes and threads, on each CPU core in real time. The computing power statistics and analysis program can act as a user-level component, reading time data from the cpuacct cgroup module, performing weighted calculations based on pre-configured core computing power weights to obtain the computing power consumption value of each process or thread, and summarizing the total system computing power consumption and remaining computing power value. Data transfer between the hardware and software layers can be completed through kernel scheduling and statistics interfaces.

[0067] In some embodiments, such as Figure 2B As shown, after system startup, the initialization steps are performed first: reading the pre-defined core computing power weight configuration files and simultaneously starting the cpuacct cgroup module to enable monitoring of all processes and threads. Then, the runtime recording phase begins. The cpuacct cgroup module, relying on the operating system kernel's scheduling mechanism, records the cumulative runtime of each process or thread on each CPU core in real time. This time data can be periodically (e.g., every 3 seconds) retrieved from the cpuacct cgroup module, and computing power calculations are performed for each statistical object: the runtime of the statistical object on each core is multiplied by the computing power weight corresponding to that core, and the calculation results for all cores are summed to obtain the CPU computing power consumption value of that process or thread. Based on this, the computing power consumption values ​​of all statistical objects are summarized to obtain the current total computing power consumption of the system; then, the total available computing power is subtracted from the total computing power consumption to calculate the current actual remaining computing power value of the system. Finally, a computing power report is output as the basis for subsequent resource scheduling and decision-making.

[0068] In some embodiments, such as Figure 2CAs shown, the process can begin with module partitioning and analysis: Processes and threads within the system are partitioned into modules based on business logic. For example, in an automotive scenario, this could be divided into navigation, multimedia, and vehicle status monitoring modules. Subsequently, a detailed analysis of the computational power consumption of each process and thread within each module can be performed, generating a computational power consumption report. This report can include the runtime of each core, computational power consumption value, and its proportion within the module. Next, the optimization strategy formulation phase can begin: Based on the computational power consumption report, processes or threads with excessively high computational power consumption (e.g., consumption values ​​greater than or equal to a threshold) or unreasonable consumption (e.g., non-core tasks consuming large core resources for extended periods) are identified, and targeted optimization strategies are developed, including but not limited to: adjusting task core binding, optimizing algorithm logic, and reducing runtime frequency. Finally, the optimization implementation and verification phase can begin: The optimization strategies are applied to the target processes or threads, and computational power statistics and analysis are performed again after optimization, comparing the computational power consumption data before and after optimization. If computing power consumption is significantly reduced (e.g., the reduction is greater than or equal to the threshold) and business functions are not affected, the optimization strategy is confirmed to be effective; if the expected effect is not achieved, the strategy can be readjusted back to the optimization strategy formulation stage until the optimization goal is met.

[0069] In some embodiments, such as Figure 2D As shown, when planning to deploy a new feature to the system (i.e., the feature to be deployed), the first step is to perform a requirement estimation step: the development team estimates the range of computing power requirements needed for the feature based on at least one of the following: the business logic, algorithm complexity, and expected data volume (e.g., including minimum and maximum computing power requirements). Then, a comparative evaluation step is performed: the actual remaining computing power value of the current system is obtained (this value can be derived from the remaining computing power calculation results shown in Figure 2), and the estimated computing power requirement of the new feature is compared with the system's remaining computing power value. If the remaining computing power value is greater than or equal to the estimated maximum computing power requirement of the new feature, it is determined that the new feature can be deployed without affecting the smooth operation of the system; if the remaining computing power value is less than the estimated minimum computing power requirement of the new feature, it is determined that it is not suitable to directly deploy the feature. For boundary cases where the remaining computing power is between the minimum and maximum requirements, or scenarios requiring a more precise assessment of whether it is suitable to directly deploy the feature, an optional simulation verification step can be performed: the actual operation of the new feature is simulated in a test environment, and the impact of the new feature deployment on the system is confirmed through simulation verification, taking into account the current computing power usage of the system and the overall system performance. Based on the results of comparative evaluation or simulation verification, the final decision conclusion is "deployable" or "deployment postponed / deployed after optimization of the existing system", providing a scientific and quantitative evaluation basis for system function iteration.

[0070] In addition, this application can also display the above data, such as the total available computing power of the system, total computing power consumption, computing power consumption data of each core, and remaining computing power value, through a graphical display interface.

[0071] The technical solution of this application can accurately count the running time of the statistical object (process or thread) on each CPU core, and calculate the actual computing power consumption data of the statistical object by combining the computing power weight of different cores. Since it takes into account the computing power differences between different cores (large cores, medium cores, and small cores have different computing capabilities and processing speeds), compared with the traditional top tool that only counts CPU usage based on the running time and ignores the differences in core types, the technical solution of this application can achieve the following technical effects: it can accurately reflect the actual computing power consumption of each process or thread, avoid the distortion of computing power estimation caused by core differences, and thus provide a reliable basis for system resource scheduling, business module optimization, and new function deployment evaluation. For example, a navigation application that runs briefly on a large core but handles complex graphics rendering tasks, and a background service that runs for a long time on a low-power core but only handles simple data recording, can be compared using the technical solution of this application. The former will receive a reasonable computing power estimate because it contributes a higher computing power weight per unit time when running on the large core, while the latter will not be overestimated because it contributes a lower computing power weight per unit time when running on the small core. This will truly reflect the actual processing power consumed by both applications, avoiding the misjudgment of traditional top tools that "overestimate light tasks and underestimate heavy tasks," and providing accurate data support for the rational allocation of resources and optimization of system performance in automotive scenarios.

[0072] Figure 3 This is a schematic diagram of a computing power processing device provided in an embodiment of this application. Figure 3 As shown, the computing power processing device 300 includes: The time acquisition module 310 is used to monitor the statistical object and acquire the running time of the statistical object on each core of the central processing unit CPU. The statistical object is a process or a thread. The weight acquisition module 320 is used to acquire the computing power weight of each core; The processing module 330 is used to determine the computing power consumption data of the statistical object based on each running time and each computing power weight.

[0073] In some embodiments, the processing module 320 is specifically used for: The computing power consumption data is determined by weighted summation for each runtime and each computing power weight.

[0074] In some embodiments, the computing power weight is determined based on at least one of the following: The corresponding core's performance test results, the statistical objects' usage of the corresponding core in the corresponding system, and the CPU's hardware characteristics.

[0075] In some embodiments, the processing module 330 is further configured to: Based on the business logic, all statistical objects in the target system corresponding to the statistical objects are divided into modules, resulting in multiple business modules; For each of the multiple business modules, analyze the computing power consumption data of the corresponding statistical objects and generate a computing power consumption report.

[0076] In some embodiments, the processing module 330 is further configured to: Based on the computing power consumption report, identify the target statistical objects that meet the preset computing power consumption conditions; Based on the operating logic and algorithm of the target statistical object, determine the operation optimization strategy; Optimize the target statistical objects according to the operation optimization strategy; Determine the optimized computing power consumption data of the target statistical object after optimization, and determine whether to adjust the running optimization strategy based on the optimized computing power consumption data.

[0077] In some embodiments, the processing module 330 is further configured to: The computing power consumption data of all statistical objects under the target system corresponding to the statistical objects are summarized to obtain the total computing power consumption data of the target system. Based on the total available computing power data and total computing power consumption data of the target system, determine the remaining computing power data of the target system; Based on at least one of the following factors for the function to be deployed: business logic, expected performance requirements, algorithm complexity, and amount of data to be processed, determine the preliminary performance data required for the function to be deployed. Based on the remaining computing power data and the estimated computing power data, determine whether the target system can be in the target running state when running the functions to be deployed; Based on the judgment results, perform at least one of the following: determine the deployment decision for the function to be deployed, assess the design of the function to be deployed, and determine the optimization of the target system.

[0078] In some embodiments, the acquisition module 310 is specifically used for The CPU accounting subsystem cpuacct monitors the statistical objects and obtains the runtime of each core.

[0079] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be found in the method embodiments. To avoid repetition, further details are omitted here. Specifically, Figure 3The apparatus 300 shown can execute the above-described method embodiments, and the aforementioned and other operations and / or functions of each module in the apparatus 300 are respectively for implementing the corresponding processes in the above-described methods. For the sake of brevity, they will not be described in detail here.

[0080] The apparatus 300 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.

[0081] Figure 4 A schematic diagram of an electronic device provided in an embodiment of this application.

[0082] like Figure 4 As shown, the electronic device 400 may include: The system includes a memory 410 and a processor 420. The memory 410 stores computer programs and transfers the program code to the processor 420. In other words, the processor 420 can retrieve and run the computer program from the memory 410 to implement the methods described in the embodiments of this application.

[0083] For example, the processor 420 can be used to execute the above-described method embodiments according to instructions in the computer program.

[0084] In some embodiments of this application, the processor 420 may include, but is not limited to: General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0085] In some embodiments of this application, the memory 410 includes, but is not limited to: Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0086] In some embodiments of this application, the computer program may be divided into one or more modules, which are stored in the memory 410 and executed by the processor 420 to perform the method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.

[0087] like Figure 4 As shown, the electronic device may further include: Transceiver 430, which can be connected to processor 420 or memory 410.

[0088] The processor 420 can control the transceiver 430 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 430 may include a transmitter and a receiver. The transceiver 430 may further include antennas, and the number of antennas may be one or more.

[0089] It should be understood that the various components in the electronic device are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.

[0090] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.

[0091] When implemented using software, it can be implemented entirely or partially as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, the computer can perform all or part of the corresponding processes in the methods of the embodiments of this application, producing the functions achievable by the methods of the embodiments of this application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid state disks (SSDs)).

[0092] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0093] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0094] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0095] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A computing power processing method, characterized in that, include: Monitor the statistical object and obtain the running time of the statistical object on each core of the central processing unit (CPU). The statistical object is a process or a thread. Obtain the computing power weight of each core; The computing power consumption data of the statistical object is determined based on each of the said running times and each of the said computing power weights.

2. The method according to claim 1, characterized in that, The computing power weight is determined based on at least one of the following: The corresponding core's performance test results, the usage of the statistical object in the corresponding system for the corresponding core, and the CPU's hardware characteristics.

3. The method according to claim 1, characterized in that, The step of determining the computing power consumption data of the statistical object based on each of the running times and each of the computing power weights includes: The computing power consumption data is determined by performing a weighted summation on each of the running times and each of the computing power weights.

4. The method according to any one of claims 1-3, characterized in that, After determining the computing power consumption data of the statistical object based on each running time and each computing power weight, the method further includes: Based on the business logic, all statistical objects in the target system corresponding to the statistical objects are divided into modules to obtain multiple business modules; For each of the multiple business modules, analyze the computing power consumption data of the statistical object corresponding to the business module, and generate a computing power consumption report.

5. The method according to claim 4, characterized in that, Also includes: Based on the computing power consumption report, target statistical objects that meet the preset computing power consumption conditions are identified; Based on the operating logic and algorithm of the target statistical object, determine the operation optimization strategy; The target statistical object is optimized according to the aforementioned operational optimization strategy; Determine the optimized computing power consumption data of the target statistical object after optimization, and determine whether to adjust the operation optimization strategy based on the optimized computing power consumption data.

6. The method according to any one of claims 1-3, characterized in that, After determining the computing power consumption data of the statistical object based on each running time and each computing power weight, the method further includes: The computing power consumption data of all statistical objects under the target system corresponding to the statistical object are summarized to obtain the total computing power consumption data of the target system. Based on the total available computing power data and the total computing power consumption data of the target system, the remaining computing power data of the target system is determined; Based on at least one of the following factors for the function to be deployed: business logic, expected performance requirements, algorithm complexity, and amount of data to be processed, determine the estimated performance data required for the function to be deployed. Based on the remaining computing power data and the estimated computing power data, it is determined whether the target system can be in the target operating state when the function to be deployed is running; Based on the judgment result, perform at least one of the following: determine the deployment decision for the function to be deployed, evaluate the design of the function to be deployed, and determine the optimization of the target system.

7. The method according to any one of claims 1-3, characterized in that, The monitoring of the statistical object, and obtaining the running time of the statistical object on each core of the central processing unit (CPU), includes: The CPU accounting subsystem cpuacct monitors the statistical objects and obtains the running time on each core.

8. A computing power processing device, characterized in that, include: The time acquisition module is used to monitor the statistical object and acquire the running time of the statistical object on each core of the central processing unit (CPU). The statistical object is a process or a thread. The weight acquisition module is used to acquire the computing power weight of each core; The processing module is used to determine the computing power consumption data of the statistical object based on each of the running times and each of the computing power weights.

9. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1-7 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-7.