CN111913855A - Method and device for determining target task calculation amount - Google Patents
Method and device for determining target task calculation amount Download PDFInfo
- Publication number
- CN111913855A CN111913855A CN202010997587.3A CN202010997587A CN111913855A CN 111913855 A CN111913855 A CN 111913855A CN 202010997587 A CN202010997587 A CN 202010997587A CN 111913855 A CN111913855 A CN 111913855A
- Authority
- CN
- China
- Prior art keywords
- target
- cpu core
- target task
- target cpu
- utilization rate
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 62
- 238000004364 calculation method Methods 0.000 title abstract description 33
- 230000015654 memory Effects 0.000 claims description 17
- 238000012545 processing Methods 0.000 claims description 11
- 230000004044 response Effects 0.000 claims description 10
- 230000008569 process Effects 0.000 claims description 9
- 230000009286 beneficial effect Effects 0.000 abstract 1
- 238000001514 detection method Methods 0.000 description 14
- 238000010586 diagram Methods 0.000 description 10
- 238000004422 calculation algorithm Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 7
- 238000004590 computer program Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000011156 evaluation Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002787 reinforcement Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3024—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3409—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Mathematical Physics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The method for determining the target task calculation amount comprises the steps of responding to the obtained target task and setting the main frequency of a target CPU core as a preset fixed frequency value; controlling the target CPU core to operate the target task according to the fixed frequency value, and acquiring the utilization rate of the target CPU core by the target task; and determining the calculated amount of the target task according to the utilization rate, the fixed frequency value and the calculated power-frequency ratio corresponding to the fixed frequency value. The method fully ensures the stability of the CPU operation environment, and is beneficial to improving the accuracy and reliability of the obtained target task calculation amount.
Description
Technical Field
The application relates to the technical field of computers, in particular to the technical field of calculation evaluation, and particularly relates to a method and a device for determining target task calculation amount.
Background
The amount of computation of an application program using a CPU (Central Processing Unit) resource is an important index for measuring its performance. In many commercial software delivery projects, the amount of consumption of this calculation directly determines whether the application product can be accepted by the customer and finally delivered successfully. Accurate evaluation of the CPU computation load of the application becomes a prerequisite for delivery of the application product.
In the prior art, a method for evaluating the calculated amount of an application program mainly comprises the steps of directly running each application program on a target software and hardware system, and calculating the calculated amount of the application program by counting the overall utilization rate of a CPU within a period of time.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for determining target task calculation amount.
In a first aspect, an embodiment of the present application provides a method for determining a target task computation amount, where the method includes: setting the main frequency of a target CPU core as a preset fixed frequency value in response to the acquisition of the target task; controlling the target CPU core to operate the target task according to the fixed frequency value, and acquiring the utilization rate of the target CPU core by the target task; and determining the calculated amount of the target task according to the utilization rate, the fixed frequency value and the calculated power-frequency ratio corresponding to the fixed frequency value.
In some embodiments, the target task is used for processing an image frame and/or an audio frame, and controlling the target CPU core to run the target task according to a fixed frequency value, and obtaining the usage rate of the CPU core by the target task comprises: and controlling the target CPU core to run the target task according to the fixed frequency value and the fixed frame rate value, and acquiring the utilization rate of the target CPU core by the target task.
In some embodiments, the usage rate of the target CPU core by the target task is determined according to a difference between a first usage rate of the target CPU core immediately before the target task is executed and a second usage rate of the target CPU core during the target task is executed.
In some embodiments, the first usage and the second usage are both average usage, and the average usage is determined by: acquiring the utilization rate of target CPU cores of a first preset number of fixed interval time; executing the operation of removing noise points on the utilization rate of the target CPU cores with the first preset number of fixed intervals to obtain the utilization rate of the target CPU cores with the second preset number of fixed intervals after the noise point data are removed; and determining the average utilization rate according to the utilization rates of the target CPU cores of the second preset number of fixed interval time.
In some embodiments, the preset fixed frequency value is the maximum value of the tunable range of the dominant frequency of the target CPU core.
In a second aspect, an embodiment of the present application provides an apparatus for determining a target task computation amount, where the apparatus includes: a setting module configured to set the dominant frequency of the target CPU core to a preset fixed frequency value in response to acquiring the target task; the control module is configured to control the target CPU core to operate the target task according to the fixed frequency value and obtain the utilization rate of the target CPU core by the target task; and the determining module is configured to determine the target task calculation amount according to the utilization rate, the fixed frequency value and the calculation power frequency ratio corresponding to the fixed frequency value.
In some embodiments, the target task is for processing image frames and/or audio frames, and the control module is further configured to: and controlling the target CPU core to run the target task according to the fixed frequency value and the fixed frame rate value, and acquiring the utilization rate of the target CPU core by the target task.
In some embodiments, the usage rate of the target CPU core by the target task is determined according to a difference between a first usage rate of the target CPU core immediately before the target task is executed and a second usage rate of the target CPU core during the target task is executed.
In some embodiments, the first usage and the second usage are both average usage, and the average usage is determined by: acquiring the utilization rate of target CPU cores of a first preset number of fixed interval time; executing the operation of removing noise points on the utilization rate of the target CPU cores with the first preset number of fixed intervals to obtain the utilization rate of the target CPU cores with the second preset number of fixed intervals after the noise point data are removed; and determining the average utilization rate according to the utilization rates of the target CPU cores of the second preset number of fixed interval time.
In some embodiments, the preset fixed frequency value is the maximum value of the tunable range of the dominant frequency of the target CPU core.
In a third aspect, an embodiment of the present application provides an electronic device, which includes one or more processors; a storage device having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to implement a method of determining a target task computation volume as in any embodiment of the first aspect.
In a fourth aspect, the present application provides a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for determining a target task computation amount according to any one of the embodiments of the first aspect.
The method comprises the steps that in response to the target task, the main frequency of a target CPU core is set to be a preset fixed frequency value; controlling the target CPU core to operate the target task according to the fixed frequency value, and acquiring the utilization rate of the target CPU core by the target task; and determining the target task calculated amount according to the utilization rate, the fixed frequency value and the calculated power-frequency ratio corresponding to the fixed frequency value, fully ensuring the stability of the CPU operation environment, eliminating the phenomenon of deviation of the obtained utilization rate caused by a plurality of adjustable frequencies of the CPU core, and further contributing to improving the accuracy and reliability of the obtained target task calculated amount.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method of determining a target task computation load according to the present application;
FIG. 3 is a schematic diagram of an application scenario of a method of determining a target task computation load according to the present application;
FIG. 4 is a flow diagram of yet another embodiment of a method of determining a target task computation load according to the present application;
FIG. 5 is a schematic diagram of one embodiment of an apparatus to determine a target task computation volume according to the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
FIG. 1 illustrates an exemplary system architecture 100 to which embodiments of the present method of determining a target task computation load may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a voice recognition type application, an image processing type application, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen, including but not limited to a mobile phone and a notebook computer. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as a plurality of software or software modules (e.g., to provide a service that determines the amount of the target task computation) or as a single software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, for example, in response to acquiring the target task, setting the dominant frequency of the target CPU core to a preset fixed frequency value; controlling a target CPU core to run a target task according to a fixed frequency value, and acquiring the utilization rate of the target CPU core by the target task; and determining the calculated amount of the target task according to the utilization rate, the fixed frequency value and the calculated power-frequency ratio corresponding to the fixed frequency value.
The method for determining the target task computation amount provided by the embodiment of the present application is generally executed by the server 105, and accordingly, the device for determining the target task computation amount is generally disposed in the server 105.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules (e.g., to provide a service to determine the computational load of the target task), or as a single software or software module. And is not particularly limited herein.
It should be noted that the terminal devices 101, 102, and 103 may also be installed with an application for determining the calculation amount of the target task, in this case, the method for determining the calculation amount of the target task may also be executed by the terminal devices 101, 102, and 103, and accordingly, the device for determining the calculation amount of the target task may also be installed in the terminal devices 101, 102, and 103. At this point, the exemplary system architecture 100 may also not include the server 105 and the network 104.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
FIG. 2 illustrates a flow diagram 200 of an embodiment of a method of determining a target task computation volume. The method for determining the target task calculation amount comprises the following steps:
In this embodiment, the execution subject (for example, the server 105 or the terminal devices 101, 102, 103 in fig. 1) may set the dominant frequency of the selected target CPU core to a preset fixed frequency value after acquiring the target task of which the calculation amount is to be determined from the local or other terminal devices.
The target CPU core is a CPU core selected by the execution subject from a plurality of CPU cores (i.e., physical cores) of the CPU, and the CPU core may be a large core or a small core, which is not limited in the present application.
Specifically, after the execution main body obtains the target task, the target task can be bound to the selected target CPU core, so that the target task is guaranteed to be only operated in the target CPU core, and not operated in other CPU cores. Here, the method of binding the target task to the target CPU core may be to implement the binding of the CPU core by a command "echo" 0 ">/systems/devices/systems/CPU N/online" in an Android (Android) system, where N refers to the CPU core to be prohibited.
The main frequency of the target CPU core refers to the clock frequency of the target CPU core, the operation of the computer is executed step by step under the control of the clock signal, one step of operation is completed in each clock signal period, and the speed of the CPU is reflected to a great extent by the height of the clock frequency.
Because the same CPU core may have a plurality of adjustable frequencies, in order to ensure the stability of the CPU operation environment, the execution subject can set the target CPU core to a preset fixed frequency value. Here, the preset fixed frequency value may be set according to experience, actual requirements, and a specific application scenario, which is not limited in this application.
Here, the method of setting the target CPU core dominant frequency may be implemented by a command "/systems/devices/system/CPU freq" in an Android (Android) system.
It should be understood that the preset fixed frequency value should be greater than the minimum frequency value satisfying the running task of the current CPU core and less than or equal to the maximum value of the CPU core dominant frequency.
Further, it is to be noted that the target task may be an image detection task using an image detection algorithm, and the calculation amount of the target task may be a calculation amount of the image detection algorithm, and more specifically, the calculation amount of the target task may be a calculation amount of image detection using the image detection algorithm. In a specific application, the image detection tasks may include human face detection, human face recognition, gesture recognition, lane line detection, pedestrian and vehicle detection, text recognition, object classification, object segmentation, and other tasks.
The target task may also be a speech recognition task using a speech recognition algorithm, and the calculation amount of the target task may be a calculation amount of the speech recognition algorithm, and more specifically, the calculation amount of the target task may be a calculation amount of speech recognition using the speech recognition algorithm. In a specific application, the voice recognition task may include voice wake-up, voice understanding, language translation, voice synthesis, and other tasks.
The target task may also be a task using a planning and control algorithm, and the calculation amount of the target task may be a calculation amount of the planning and control algorithm. In a specific application, the tasks using the planning and control algorithm may include path planning, trajectory prediction, reinforcement learning, and the like.
In some optional manners, the preset fixed frequency value is the maximum value of the tunable range of the target CPU core dominant frequency.
In this implementation, the preset fixed frequency value is the maximum value of the target CPU dominant frequency adjustable range. Here, the method of setting the target CPU core dominant frequency as the maximum value of the adjustable range may be implemented by setting performance in the grandroller in the command "/systems/devices/system/CPU freq" in an Android (Android) system.
The method can guarantee the stability of the CPU operation environment while realizing the high-efficiency operation of the target task.
In the implementation mode, after the main frequency of the target CPU core is set, the execution main body controls the CPU core to run the target task according to the fixed frequency value, and the utilization rate of the target CPU core by the target task is obtained.
Here, the execution subject may obtain the usage rate of the target CPU core by obtaining the usage rate of the target CPU core when the target CPU core is idle and the usage rate of the target CPU core when the target CPU core runs the target task, respectively, and then obtaining the usage rate of the target task to the CPU core according to a difference between the usage rate of the target CPU core when the target CPU core runs the task and the usage rate of the target CPU core when the target CPU core is idle.
The usage rate of the CPU core when the target CPU core is idle may be a usage rate of the CPU core at any time before the target task is executed by the target CPU core, for example, the usage rate of the CPU core before the execution main body acquires the target task, the usage rate of the CPU core before the execution main body immediately executes the target task after the execution main body acquires the target task, and the like, which is not limited in the present application.
It should be noted that, at present, an operating system (such as Windows, Linux, Mac, etc.) allows a plurality of processes to be run simultaneously, that is, a target CPU core may run other tasks besides a target task in the process of running the target task. Preferably, the execution subject should minimize the operation of other tasks except the target task before and during the process of controlling the target CPU core to operate the target task, so as to ensure the accuracy of the obtained usage rate of the CPU core.
In some optional manners, the usage rate of the target task to the CPU core is determined according to a difference between a first usage rate of the target CPU core immediately before the target task is executed and a second usage rate of the target CPU core during the target task is executed.
In this implementation, the first usage rate may be a usage rate at a certain time before the target CPU core is to run the target task, or may be an average usage rate in a certain time period, which is not limited in this application. The second usage rate may be a usage rate of the target CPU core at a certain time in the process of running the target task, or may be an average usage rate in a certain time period, which is not limited in the present application.
According to the method, the utilization rate of the target task to the CPU core is determined according to the difference value of the first utilization rate of the target CPU core before the target task is about to run and the second utilization rate of the target CPU core in the process of running the target task, so that the accuracy of the first utilization rate is effectively improved, and the accuracy of the determined utilization rate of the target task to the CPU core is further improved.
In some alternatives, the first usage rate and the second usage rate are both average usage rates, and the average usage rate is determined by: acquiring the utilization rate of target CPU cores of a first preset number of fixed interval time; executing operation of removing noise points on the utilization rate of the target CPU cores in the first preset number of fixed time periods to obtain the utilization rate of the target CPU cores in the second preset number of fixed time periods after noise point data are removed; and determining the average utilization rate according to the utilization rates of the target CPU cores in the second preset number of fixed time periods.
In this implementation, the first usage rate and the second usage rate are both average usage rates, and the execution subject may first obtain a first preset number, for example, 20, 10, etc., fixed interval time, for example, 100ms, 10ms, etc., usage rate of the target CPU core; then, the operation of removing noise is executed for the utilization rate of the target CPU core with the first preset number of fixed intervals.
Here, the operation of removing noise performed on the utilization rate of the target CPU core for the first preset number of fixed intervals may adopt a data processing operation of removing noise in the prior art or a future development technology, for example, an averaging method, a local weighted replacement method, a 3 σ detection method, and the like, which is not limited in this application.
Finally, the execution subject may determine an average of the utilization rates of the target CPU cores at fixed intervals of a second preset number, for example, 18, 8, etc., after the noise is removed, as the average utilization rate.
According to the implementation mode, the utilization rate of the target CPU cores in the first preset number of fixed interval time is obtained, the operation of removing noise points is executed, the first average utilization rate and the second average utilization rate are determined according to the utilization rate of the target CPU cores in the second preset number of fixed interval time after the noise points are removed, and the accuracy of the utilization rate of the target tasks determined according to the first average utilization rate and the second average utilization rate on the CPU cores is further improved.
And step 203, determining the calculated amount of the target task according to the utilization rate, the fixed frequency value and the calculated power-frequency ratio corresponding to the fixed frequency value.
In this embodiment, the execution subject may determine the calculation amount of the target task directly according to the product of the usage rate, the fixed frequency value, and the calculation power-frequency ratio corresponding to the fixed frequency value.
The unit of the calculated force-frequency ratio is DMIPS (Dhrystone Million Instructions executed Per Second, Million Dhrystone Instructions Per Second)/MHz, and is used for representing how many DMIPSs can be executed by the CPU core at the operating speed of each MHz. The computation frequency ratio helps compare the results of CPU cores running Dhrystone (integer arithmetic) at different clock frequencies, typically referred to in official documentation from the CPU manufacturer.
Specifically, the utilization rate of the target CPU core by the target task is 10%, the fixed frequency value is 2MHz, and the computational power-frequency ratio is 1.1DMIPS/MHz, so that the computational cost M of the target task is 10% × 2MHz × 1.1 DMIPS/MHz.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for determining a target task computation amount according to the present embodiment.
In the application scenario of fig. 3, in a specific example, the execution subject 301 sets the dominant frequency of the selected target CPU core to a fixed frequency value 302, for example, 2.2MHz, in response to acquiring a target task, for example, a face recognition task; and controlling the target CPU core to operate the target task according to the fixed frequency value 302, and acquiring the utilization rate 303 of the target task to the CPU core, wherein the utilization rate 303 is determined by the difference value of the utilization rate of the CPU core when the target CPU core is idle and stably operates and the utilization rate of the target CPU core when the target task operates, for example, 10%. Finally, the calculation amount 305 of the target task is determined based on the usage rate 303, the fixed frequency value 302, and the calculation power-frequency ratio 304 corresponding to the fixed frequency value.
The method for determining the target task calculation amount provided by the embodiment of the disclosure sets the dominant frequency of a target CPU core as a preset fixed frequency value by responding to the obtained target task; controlling the target CPU core to run the target task according to the fixed frequency value, and acquiring the utilization rate of the target task to the CPU core; and determining the calculated amount of the target task according to the utilization rate, the fixed frequency value and the calculated power-frequency ratio corresponding to the fixed frequency value, thereby effectively improving the accuracy and reliability of the calculated amount of the obtained target task.
With further reference to FIG. 4, a flow 400 of yet another embodiment of a method of determining a target task computation load is illustrated. In this embodiment, the process 400 of the method for processing image frames and/or audio frames by a target task to determine the calculation amount of the target task may include the following steps:
In this embodiment, step 401 is substantially the same as step 201 in the corresponding embodiment of fig. 2, and is not described here again.
In this embodiment, if the target task is a task for processing an image frame and/or an audio frame, for example, the target task is an image detection task or a voice recognition task, before the execution subject controls the target CPU core to execute the target task, the execution frame rate may be set to be a fixed frame rate value, and then the target CPU core is controlled to execute the target task according to the fixed frame rate value.
The frame rate is used for representing the efficiency of image detection or voice detection, and under the condition of different frame rates, the calculation amount consumed by the target CPU for checking the same target task may be different.
Here, the fixed frame rate value may be set according to experience, actual requirements, and a specific application scenario, for example, the face recognition scenario may be set to 10FPS (Frames Per Second), the gesture recognition scenario may be set to 20FPS, and the like, which is not limited in this application.
And 403, determining the calculated amount of the target task according to the utilization rate, the fixed frequency value and the calculated power-frequency ratio corresponding to the fixed frequency value.
In this embodiment, step 403 is substantially the same as step 203 in the corresponding embodiment of fig. 2, and is not described herein again.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the process 400 of the method for determining a target task computation amount in this embodiment highlights controlling the target CPU core to run the target task according to the fixed frequency value and the fixed frame rate value, and obtaining the usage rate of the target task to the CPU core. Therefore, the execution main body can acquire the utilization rate of the target task to the CPU core under the conditions of the fixed frequency value and the fixed frame rate value, the accuracy and the reliability of the acquired utilization rate are further improved, and the accuracy and the reliability of the calculated amount of the determined target task are further improved.
With further reference to fig. 5, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for determining a target task computation amount, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 1, and the apparatus may be applied to various electronic devices.
As shown in fig. 5, the apparatus 500 for determining the target task calculation amount of the present embodiment includes: a setting module 501, a control module 502, and a determination module 503.
Wherein the setting module 501 may be configured to set the dominant frequency of the target CPU core to a preset fixed frequency value in response to acquiring the target task.
The control module 502 may be configured to control the target CPU core to run the target task according to the fixed frequency value, and obtain a utilization rate of the target CPU core by the target task.
The determining module 503 may be configured to determine the target task computation amount according to the usage rate, the fixed frequency value, and the computation power-frequency ratio corresponding to the fixed frequency value.
In some alternatives of the embodiment, the target task is for processing image frames and/or audio frames, and the control module is further configured to: and controlling the target CPU core to run the target task according to the fixed frequency value and the fixed frame rate value, and acquiring the utilization rate of the target CPU core by the target task.
In some optional manners of this embodiment, the usage rate of the target task for the CPU core is determined according to a difference between a first usage rate of the target CPU core immediately before the target task is executed and a second usage rate of the target CPU core during the target task is executed.
In some optional manners of this embodiment, the first usage rate and the second usage rate are both average usage rates, and the average usage rate is determined by: acquiring the utilization rate of target CPU cores of a first preset number of fixed interval time; executing the operation of removing noise points on the utilization rate of the target CPU cores with the first preset number of fixed intervals to obtain the utilization rate of the target CPU cores with the second preset number of fixed intervals after the noise point data are removed; and determining the average utilization rate according to the utilization rates of the target CPU cores of the second preset number of fixed interval time.
In some optional manners of this embodiment, the preset fixed frequency value is a maximum value of the target CPU core dominant frequency adjustable range.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 6, the electronic device is a block diagram of an electronic device for determining a target task computation amount according to an embodiment of the present application.
600 is a block diagram of an electronic device in accordance with a method of determining a target task computation volume according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 6, the electronic apparatus includes: one or more processors 601, memory 602, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 6, one processor 601 is taken as an example.
The memory 602 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the method of determining a target task computation load provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the method of determining a target task computation amount provided herein.
The memory 602 is used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules (for example, the setting module 501, the control module 502, and the determination module 503 shown in fig. 5) corresponding to the human body key point identification method in the embodiment of the present application, and the processor 601 executes various functional applications and data processing of the server by executing the non-transitory software programs, instructions, and modules stored in the memory 602, that is, the method for determining the target task computation amount in the above method embodiment is implemented.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by use of the electronic device for face tracking, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 602 may optionally include memory located remotely from the processor 601, which may be connected to lane line detection electronics over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the method for determining the target task computation amount may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected by a bus or other means, and fig. 6 illustrates the connection by a bus as an example.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the lane line detecting electronic apparatus, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input devices. The output devices 604 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, the stability of the running environment of the CPU is fully guaranteed, and the accuracy and the reliability of the obtained target task calculated amount are improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims (12)
1. A method of determining a target task computation load, the method comprising:
setting the main frequency of a target CPU core as a preset fixed frequency value in response to the acquisition of the target task;
controlling a target CPU core to operate the target task according to the fixed frequency value, and acquiring the utilization rate of the target CPU core by the target task;
and determining the calculated amount of the target task according to the utilization rate, the fixed frequency value and the calculated power-frequency ratio corresponding to the fixed frequency value.
2. The method of claim 1, wherein the target task is for processing image and/or audio frames, and the controlling the target CPU core to run the target task at the fixed frequency value and obtain a usage rate of the target CPU core by the target task comprises:
and controlling the target CPU core to run the target task according to the fixed frequency value and the fixed frame rate value, and acquiring the utilization rate of the target CPU core by the target task.
3. The method as claimed in claim 1, wherein the target CPU core usage rate of the target task is determined according to a difference between a first usage rate of the target CPU core immediately before the target task is executed and a second usage rate of the target CPU core during the target task is executed.
4. The method of claim 3, wherein the first and second usage rates are both average usage rates, and the average usage rate is determined by:
acquiring the utilization rate of target CPU cores of a first preset number of fixed interval time;
executing the operation of removing noise points on the utilization rate of the target CPU cores with the first preset number of fixed intervals to obtain the utilization rate of the target CPU cores with the second preset number of fixed intervals after the noise point data are removed;
and determining the average utilization rate according to the utilization rates of the target CPU cores of the second preset number of fixed interval time.
5. The method according to any one of claims 1 to 4, wherein the predetermined fixed frequency value is the maximum value of the tunable range of the dominant frequency of the target CPU core.
6. An apparatus to determine a target task computation volume, the apparatus comprising:
a setting module configured to set the dominant frequency of the target CPU core to a preset fixed frequency value in response to acquiring the target task;
the control module is configured to control a target CPU core to operate the target task according to the fixed frequency value and obtain the utilization rate of the target CPU core by the target task;
a determination module configured to determine a target task computation amount according to the usage rate, the fixed frequency value, and a computation power-frequency ratio corresponding to the fixed frequency value.
7. The apparatus of claim 6, wherein the target task is to process an image frame and/or an audio frame, and the control module is further configured to:
and controlling the target CPU core to run the target task according to the fixed frequency value and the fixed frame rate value, and acquiring the utilization rate of the target CPU core by the target task.
8. The apparatus according to claim 6, wherein the usage rate of the target task for the CPU core is determined according to a difference between a first usage rate of the target CPU core immediately before the target task is executed and a second usage rate of the target CPU core during the target task is executed.
9. The apparatus of claim 8, wherein the first usage rate and the second usage rate are both average usage rates, and the average usage rates are determined by:
acquiring the utilization rate of target CPU cores of a first preset number of fixed interval time;
executing the operation of removing noise points on the utilization rate of the target CPU cores with the first preset number of fixed intervals to obtain the utilization rate of the target CPU cores with the second preset number of fixed intervals after the noise point data are removed;
and determining the average utilization rate according to the utilization rates of the target CPU cores of the second preset number of fixed interval time.
10. The apparatus according to any one of claims 6 to 9, wherein the preset fixed frequency value is a maximum value of a tunable range of a target CPU core dominant frequency.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory is stored with instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010997587.3A CN111913855A (en) | 2020-09-21 | 2020-09-21 | Method and device for determining target task calculation amount |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010997587.3A CN111913855A (en) | 2020-09-21 | 2020-09-21 | Method and device for determining target task calculation amount |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111913855A true CN111913855A (en) | 2020-11-10 |
Family
ID=73265333
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010997587.3A Withdrawn CN111913855A (en) | 2020-09-21 | 2020-09-21 | Method and device for determining target task calculation amount |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111913855A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103246340A (en) * | 2012-02-06 | 2013-08-14 | 索尼公司 | Device and method for dynamically adjusting frequency of central processing unit |
CN104820618A (en) * | 2015-04-24 | 2015-08-05 | 华为技术有限公司 | Task scheduling method, task scheduling device and multi-core system |
CN110069325A (en) * | 2018-09-05 | 2019-07-30 | 西南民族大学 | The mobile edge calculations method for scheduling task of task based access control classification |
CN111427758A (en) * | 2020-03-17 | 2020-07-17 | 北京百度网讯科技有限公司 | Task calculation amount determining method and device and electronic equipment |
-
2020
- 2020-09-21 CN CN202010997587.3A patent/CN111913855A/en not_active Withdrawn
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103246340A (en) * | 2012-02-06 | 2013-08-14 | 索尼公司 | Device and method for dynamically adjusting frequency of central processing unit |
CN104820618A (en) * | 2015-04-24 | 2015-08-05 | 华为技术有限公司 | Task scheduling method, task scheduling device and multi-core system |
CN110069325A (en) * | 2018-09-05 | 2019-07-30 | 西南民族大学 | The mobile edge calculations method for scheduling task of task based access control classification |
CN111427758A (en) * | 2020-03-17 | 2020-07-17 | 北京百度网讯科技有限公司 | Task calculation amount determining method and device and electronic equipment |
Non-Patent Citations (1)
Title |
---|
张帆: "基于网格计算的 SAR 回波分布式仿真", 系统仿真学报, vol. 20, no. 12, 23 June 2008 (2008-06-23), pages 3168 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111694646A (en) | Resource scheduling method and device, electronic equipment and computer readable storage medium | |
CN111738446A (en) | Scheduling method, device, equipment and medium of deep learning inference engine | |
CN114298322A (en) | Federal learning method, device, system, electronic equipment and computer readable medium | |
CN112965903A (en) | Test method, test device, electronic equipment and computer readable storage medium | |
CN114417780B (en) | State synchronization method and device, electronic equipment and storage medium | |
CN112052185A (en) | Applet exception handling method and device, electronic device and storage medium | |
CN114970883A (en) | Model quantization method and device, electronic equipment and storage medium | |
CN113765734A (en) | Method and device for detecting network access amount | |
CN112486644A (en) | Method, apparatus, device and storage medium for generating information | |
CN115481594B (en) | Scoreboard implementation method, scoreboard, electronic equipment and storage medium | |
CN111913855A (en) | Method and device for determining target task calculation amount | |
CN115391158A (en) | Time delay determination method, system and device and electronic equipment | |
CN114281469A (en) | Distributed simulation method and system | |
CN113655906A (en) | Folding screen control method and device | |
CN113535020A (en) | Method, apparatus, device, medium and product for generating application icons | |
CN113361575A (en) | Model training method and device and electronic equipment | |
CN112346512A (en) | Time synchronization method and device | |
CN110737696A (en) | Data sampling method, device, electronic equipment and storage medium | |
CN113961405B (en) | State switching instruction verification method and device, electronic equipment and storage medium | |
CN115145730B (en) | Operation monitoring method and device, electronic equipment and storage medium | |
CN114118356B (en) | Neural network processor verification method and device, electronic equipment and storage medium | |
CN114816758B (en) | Resource allocation method and device | |
CN114218069B (en) | Regression testing method, regression testing device, electronic equipment and storage medium | |
CN115277713B (en) | Load balancing method and device | |
CN114721895B (en) | Verification method, platform, equipment and medium for design to be tested |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20211012 Address after: 100176 101, floor 1, building 1, yard 7, Ruihe West 2nd Road, Beijing Economic and Technological Development Zone, Daxing District, Beijing Applicant after: Apollo Intelligent Connectivity (Beijing) Technology Co., Ltd. Address before: 2 / F, baidu building, 10 Shangdi 10th Street, Haidian District, Beijing 100085 Applicant before: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY Co.,Ltd. |
|
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20201110 |