Detailed Description
The present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Example one
Fig. 1 is a flowchart of a calculation force estimation method according to an embodiment of the present invention, which is applicable to a situation of estimating a calculation capability of a pressure applying machine, and especially applicable to a scenario of calculating a resource size of each pressure applying machine during resource scheduling in a performance pressure measurement platform. The method may be performed by a computational power estimation apparatus, which may be implemented by software and/or hardware, integrated in a device that can perform resource scheduling. The method specifically comprises the following steps:
and S110, acquiring target configuration information and resource consumption information of the target pressing machine.
The pressure applying machine is a machine capable of generating pressure measuring flow during system performance test, and may be a virtual machine or a physical machine, such as a server, a computer, a mobile phone, and the like. The target press is any press that requires an estimation of the calculated force. The target configuration information may refer to hardware configuration information of the target pressing machine, such as the core number and dominant frequency of a Central Processing Unit (CPU), the size of a memory, the access speed of a hard disk, and the like. Resource consumption information may refer to information of resources consumed by the target pressure applicator in performing one or more tasks. The resource consumption information may include, but is not limited to, CPU usage, memory usage, average load information, and the like.
Illustratively, S110 may include: when the target pressing machine is idle, acquiring target configuration information and resource consumption information of the target pressing machine through a system information collecting and reporting near interface according to a first preset frequency; and when the target pressing machine runs a task, acquiring target configuration information and resource consumption information of the target pressing machine through a Sigar interface according to a second preset frequency.
Wherein, the Sigar is a main data collecting component of hyper HQ, is compatible with a plurality of platforms, such as windows series platforms, linux series platforms, AIX series platforms, and the like, and can be used for collecting target configuration information and resource consumption information of a target press. The Sigar interface is an extremely convenient interface for collecting information from the applicator. The first preset frequency and the second preset frequency are both acquisition frequencies for acquiring information of the target pressing machine. The first predetermined frequency in this embodiment is greater than the second predetermined frequency.
Specifically, the present embodiment may acquire target configuration information and resource consumption information of the target press machine through the Sigar interface according to the current state of the target press machine. Exemplarily, if the target pressing machine is in an idle state, that is, when no pressure measurement task exists, information of the target pressing machine can be acquired every 5 s; if the target press is in a busy state, namely, when the pressure measurement task is running, the information of the target press can be collected once every 200 ms. When the target pressing machine runs a task, the resource consumption information of the target pressing machine changes rapidly, so that the acquisition time interval needs to be shortened to monitor the resource consumption condition of the current target pressing machine. In the performance pressure measurement platform, a long connection is established between the control center and each pressure applying machine, the acquired target configuration information and resource consumption information can be reported to the control center, and the control center can store the information into a redis storage system after receiving the target configuration information and the resource consumption information, so that a cluster of the control center can share the resource information of the pressure applying machines, and therefore resource scheduling can be carried out more conveniently.
And S120, determining a no-load force calculation value corresponding to the target pressing machine according to the reference force calculation value, the reference configuration information and the target configuration information of the reference pressing machine.
Wherein the reference press is a fixed press selected for uniform force criteria. The reference configuration information refers to the hardware configuration information of the selected reference pressing machine. The reference force value may be one preset based on the reference configuration information of the reference press. For example, a 2100MHz 4-core press may be selected as the reference press, and the reference force value of the reference press may be set to 100. The calculation force value in this embodiment is used to reflect the calculation capability of the current press, that is, to measure the size of the current press resource. The no-load calculation value refers to the maximum calculation capacity of the target pressing machine when the pressing task is not operated. If the no-load calculation force value of the target pressing machine is larger, the calculation capability of the target pressing machine is larger, and the number of the resources is larger. The reference force calculation value in this embodiment refers to a no-load force calculation value corresponding to the reference pressing machine.
Specifically, in this embodiment, the reference configuration information of the reference pressing machine may be compared with the target configuration information of the target pressing machine, and the no-load calculation force value corresponding to the target pressing machine may be determined according to the comparison result and the reference calculation force value of the reference pressing machine, so that the no-load resource of each pressing machine may be normalized. According to the embodiment, the size of the no-load resource of each pressure applying machine can be measured and compared more conveniently, more conveniently and more intuitively according to the no-load calculation value corresponding to each pressure applying machine, so that the overload condition of the pressure applying machine can be avoided by distributing the task with the calculation value smaller than the no-load calculation value when the resource scheduling is carried out on the target pressure applying machine.
And S130, determining a consumption force calculation value corresponding to the target pressing machine according to the resource consumption information and the no-load force calculation value.
The consumption calculation force value refers to a calculation force value consumed by the target pressing machine when the pressing task is operated.
Specifically, when the resource consumption information is the resource usage rate, the product of the resource usage rate of the target press and the empty load calculation force value may be determined as the consumption calculation force value of the target press. In the pressure measurement process of the performance pressure measurement platform, the parameter which has the greatest influence on the resource of the pressure applicator is the CPU utilization rate, so that the resource consumption condition of the pressure applicator can be represented by the CPU utilization rate. For example, if the CPU utilization of a certain target press machine T1 is 50% and the idle load calculation value is 200, the consumption calculation value corresponding to the target press machine T1 is 100. By calculating the consumption calculation force value of the press machine, the resource consumption condition of each press machine can be monitored more conveniently. The embodiment can also determine the residual force value corresponding to the target pressing machine according to the no-load force value and the consumption force value corresponding to the target pressing machine, so that a task matched with the residual force value can be distributed to the target pressing machine during resource scheduling, the resource utilization rate of the pressing machine is improved, and the overload condition is avoided.
According to the technical scheme of the embodiment, each target pressing machine needing to estimate the calculated force is subjected to normalization processing by setting the reference configuration information and the reference calculation force value of one reference pressing machine, and the no-load calculation force value and the consumption calculation force value corresponding to each pressing machine are determined, so that the resource size of each pressing machine can be uniformly measured and compared in a calculation force value mode, reasonable resource scheduling is facilitated, the resource utilization rate of the pressing machines is improved, and the overload condition is avoided.
On the basis of the above technical solution, S120 may include: determining a performance ratio between the target pressing machine and the reference pressing machine according to the reference configuration information and the target configuration information of the reference pressing machine; and determining a no-load force calculation value corresponding to the target pressing machine according to the reference force calculation value and the performance ratio of the reference pressing machine.
Specifically, the present embodiment may quantize the reference configuration information and the target configuration information, and determine a ratio between the quantized target configuration information and the quantized reference configuration information as a performance ratio between the target pressing machine and the participating pressing machine. And determining the product of the reference force calculation value of the reference press and the performance ratio as the corresponding no-load force calculation value of the target press.
In the pressure measurement process of the performance pressure measurement platform, the configuration information which has the greatest influence on the resource of the pressure applicator is the core number and the dominant frequency of the CPU, and other configuration information can be ignored, so that the configuration quantization can be performed based on the core number and the dominant frequency. For example, determining the performance ratio between the target press and the reference press according to the reference configuration information and the target configuration information of the reference press may include: determining a reference performance value corresponding to the reference pressing machine according to the reference core number and the reference main frequency of the reference pressing machine; determining a target performance value corresponding to the target pressing machine according to the target core number and the target main frequency of the target pressing machine; determining a ratio of the target performance value to the reference performance value as a performance ratio between the target press and the reference press.
Specifically, the present embodiment may determine a product of the reference core number of the reference pressing machine and the reference dominant frequency as a reference performance value corresponding to the reference pressing machine, and determine a product of the target core number of the target pressing machine and the target dominant frequency as a target performance value corresponding to the target pressing machine. For example, if the reference presser is 2100MHz per core and the target presser is 4200MHz per core for 8 cores, the reference performance value corresponding to the reference presser is 8400, the target performance value corresponding to the target presser is 33600, and the performance ratio between the target presser and the reference presser is 33600/8400=4, so that the performance ratio between each presser and the reference presser can be determined more conveniently for normalization processing based on the same manner.
Example two
Fig. 2 is a flowchart of a calculation force estimation method according to a second embodiment of the present invention, and in this embodiment, based on the above embodiment, a consumption calculation force value corresponding to an associated press machine associated with a target task is calculated according to a calculation manner of the consumption calculation force value of the press machine, so as to estimate a task calculation force value corresponding to the target task, where explanations of the same or corresponding terms as those in the above embodiment are not repeated herein.
Referring to fig. 2, the calculation power estimating method provided in this embodiment includes the following steps:
s210, when the task state of the target task is the running state, determining a related press machine related to the target task.
Specifically, when the task state of the target task is the running state, it indicates that the control center allocates the thread of the target task to the specified one or more pressure machines, and at this time, the specified pressure machine may be determined as an associated pressure machine, that is, the pressure machine associated with the running script of the target task is determined as an associated pressure machine. The number of the associated press machines in this embodiment may be one or more. When there are multiple associated presses, the associated presses may form a cluster of presses corresponding to the target task, and each associated press in the cluster of presses may load and execute the task thread of the assigned target task simultaneously.
The present embodiment may determine the consumption force value corresponding to the associated pressing machine based on the manner of determining the consumption force value corresponding to the target pressing machine in the above embodiments. Specifically, the consumption calculation force value corresponding to the associated press machine may be calculated by performing the following steps S220-S240. When there are a plurality of associated press machines, the consumption calculation force value corresponding to each associated press machine may be calculated by repeatedly performing steps S220-S240.
S220, collecting relevant configuration information and resource consumption information of the relevant press machines.
The related configuration information refers to the hardware configuration information of the related pressure applying machine. The resource consumption information refers to information of resources currently consumed by the associated press machine, such as CPU utilization rate.
And S230, determining a no-load force calculation value corresponding to the associated pressing machine according to the reference force calculation value, the reference configuration information and the associated configuration information of the reference pressing machine.
S240, determining the consumption force value corresponding to the associated pressure applicator according to the resource consumption information and the no-load force value corresponding to the associated pressure applicator.
It should be noted that, when calculating the task force value corresponding to the target task, it is necessary to assume that the consumption force values corresponding to the associated pressure applying machines are all consumed by the target task, and ignore the consumption situations of other processes such as the operating system.
And S250, determining a task force value corresponding to the target task according to the consumption force value corresponding to the associated pressure applying machine, the loading thread number and the target thread number of the target task.
The loading thread number refers to the number of threads in a target task currently loaded by the associated press. The number of loaded threads in this embodiment may also be obtained through a Sigar interface. The target thread number of the target task refers to the final concurrent thread number corresponding to the target task in the task pressure measurement scene. Illustratively, the task pressure measurement scenario is generally a gradient pressure application model, for example, the initial concurrent thread number is 10, 10 threads are added every 100 seconds, until the initial concurrent thread number is 1000 threads, the pressure application is stabilized for 1 hour, which is a pressure measurement scenario, and the target thread number corresponding to the target task in the pressure measurement scenario is 1000. When creating the target task, the target thread count may be set according to user requirements and actual conditions. The task force value can be used for measuring the size of the resource required by executing the target task, so that the capacity of the target task for consuming the resource can be reflected.
For example, the task force value corresponding to the target task may be determined according to the following formula:
wherein S is a task force calculation value corresponding to the target task; t is m Is the target thread number of the target task; n is the number of associated press machines; c i Is the consumption calculation force value corresponding to the ith associated pressure applicator; t is a unit of i Is the loading thread number corresponding to the ith associated pressure applicator.
Specifically, an average force value corresponding to each task thread in the target task is determined according to the consumption force value corresponding to each associated press and the number of loaded threads corresponding to each associated press, and then the product of the average force value and the number of the target threads can be determined as the task force value corresponding to the target task. By calculating the task force calculation value corresponding to the target task, the pressure applicator resource required to be consumed for executing the target task can be determined, so that the task can be reasonably scheduled, and the problems of overload of the pressure applicator or low resource utilization rate are avoided.
For example, if the target thread number of the target task is 100, the target thread number is allocated to two associated pressure applying machines, each associated pressure applying machine currently loads 20 threads, and the corresponding consumption calculation force values are 150 and 250, respectively, then the task calculation force value corresponding to the target task is:
according to the technical scheme of the embodiment, the consumption calculation force value corresponding to the associated press machine associated with the target task is calculated, and the task calculation force value corresponding to the target task is estimated according to the consumption calculation force value, the loading thread number and the target thread number, so that the press machine resources required to be consumed for executing the target task can be determined, the task can be reasonably scheduled, and the problems of overload of the press machine or low resource utilization rate are avoided.
The following is an embodiment of the calculation power estimating apparatus provided in the embodiment of the present invention, which belongs to the same inventive concept as the calculation power estimating method of each of the above embodiments, and details that are not described in detail in the embodiment of the calculation power estimating apparatus may refer to the embodiment of the calculation power estimating method described above.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a calculation power estimating apparatus according to a third embodiment of the present invention, which is applicable to estimating the calculation power of a press machine, and the apparatus specifically includes: a target press information acquisition module 310, a no-load calculation force value determination module 320, and a consumption calculation force value determination module 330.
The information acquisition module 310 of the target press machine is used for acquiring target configuration information and resource consumption information of the target press machine; the no-load force calculation value determining module 320 is configured to determine a no-load force calculation value corresponding to the target pressing machine according to the reference force calculation value, the reference configuration information, and the target configuration information of the reference pressing machine; and the consumption calculation force value determining module 330 is configured to determine a consumption calculation force value corresponding to the target pressure applicator according to the resource consumption information and the no-load calculation force value.
According to the technical scheme of the embodiment, the reference configuration information and the reference calculation value of one reference press machine are set, each target press machine needing to estimate the calculation force is subjected to normalization processing, and the no-load calculation value and the consumption calculation value corresponding to each press machine are determined, so that the resource size of each press machine can be uniformly measured and compared in a calculation value mode, reasonable resource scheduling is facilitated, the resource utilization rate of the press machine is improved, and the overload condition is avoided.
Optionally, the target press information collecting module 310 is specifically configured to:
when the target pressing machine is idle, acquiring target configuration information and resource consumption information of the target pressing machine through a system information collection and report near interface according to a first preset frequency;
when the target pressing machine runs a task, acquiring target configuration information and resource consumption information of the target pressing machine through a Sigar interface according to a second preset frequency;
the first preset frequency is greater than the second preset frequency.
Optionally, the no-load calculation force value determination module 320 includes:
the performance ratio determining unit is used for determining the performance ratio between the target pressing machine and the reference pressing machine according to the reference configuration information and the target configuration information of the reference pressing machine;
and the no-load calculation force value determining unit is used for determining a no-load calculation force value corresponding to the target pressing machine according to the reference calculation force value and the performance ratio of the reference pressing machine.
Optionally, the performance ratio determining unit is specifically configured to:
determining a reference performance value corresponding to the reference pressing machine according to the reference core number and the reference main frequency of the reference pressing machine;
determining a target performance value corresponding to the target pressing machine according to the target core number and the target main frequency of the target pressing machine;
determining a ratio of the target performance value to the reference performance value as a performance ratio between the target press and the reference press.
Optionally, the apparatus further comprises:
the related pressure applying machine determining module is used for determining a related pressure applying machine related to the target task when the task state of the target task is the running state;
the task force calculation value determining module is used for determining a task force calculation value corresponding to the target task according to the consumption force value, the loading thread number and the target thread number of the target task corresponding to the associated pressure applying machine;
accordingly, consumption calculation force value determination module 330 is configured to determine a corresponding consumption calculation force value for the associated pressure applicator.
Optionally, the task force value corresponding to the target task is determined according to the following formula:
wherein S is a task force calculation value corresponding to the target task; t is m Is the target thread number of the target task; n is the number of associated press machines; c i Is the consumption calculation force value corresponding to the ith associated pressure applicator; t is i Is the loading thread number corresponding to the ith associated pressure applicator.
Optionally, the resource consumption information includes central processor CPU usage.
The calculation power estimation device provided by the embodiment of the invention can execute the calculation power estimation method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects for executing the calculation power estimation method.
It should be noted that, in the embodiment of the computing power estimating apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
Example four
Fig. 4 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention. Referring to fig. 4, the apparatus includes:
one or more processors 410;
a memory 420 for storing one or more programs;
when executed by the one or more programs 410, cause the one or more processors 410 to implement a method of computing power estimation as provided in any of the embodiments above, the method comprising:
acquiring target configuration information and resource consumption information of a target press;
determining a no-load force calculation value corresponding to the target pressing machine according to the reference force calculation value, the reference configuration information and the target configuration information of the reference pressing machine;
and determining a consumption force value corresponding to the target pressing machine according to the resource consumption information and the no-load force value.
In FIG. 4, a processor 410 is illustrated as an example; the processor 410 and the memory 420 in the device may be connected by a bus or other means, as exemplified by the bus connection in fig. 4.
The memory 420, which is a computer-readable storage medium, may be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the calculation force estimation method in the embodiments of the present invention (e.g., the target press information collection module 310, the no-load calculation force value determination module 320, and the consumption calculation force value determination module 330 in the calculation force estimation apparatus). The processor 410 executes software programs, instructions and modules stored in the memory 420 to perform various functional applications of the device and data processing, i.e., to implement the above-described algorithm estimation method.
The memory 420 mainly includes a program storage area and a data storage area, wherein the program storage area can store an operating system and an application program required by at least one function; the storage data area may store data created according to use of the device, and the like. Further, the memory 420 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 420 may further include memory located remotely from processor 410, which may be connected to devices through 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 apparatus proposed in this embodiment is the same as the calculation power estimation method proposed in the above embodiment, and the technical details that are not described in detail in this embodiment can be referred to in the above embodiment, and this embodiment has the same beneficial effects as performing the calculation power estimation method.
EXAMPLE five
This fifth embodiment provides a computer-readable storage medium, on which a computer program is stored, the program, when executed by a processor, implementing a computational power estimation method as provided in any of the embodiments of the present invention, the method comprising:
acquiring target configuration information and resource consumption information of a target pressing machine;
determining a no-load force calculation value corresponding to the target pressing machine according to the reference force calculation value, the reference configuration information and the target configuration information of the reference pressing machine;
and determining a consumption force calculation value corresponding to the target pressure applicator according to the resource consumption information and the no-load force calculation value.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It will be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general purpose computing device, they can be centralized in a single computing device or distributed over a network of multiple computing devices, and they can alternatively be implemented by program code executable by a computing device, so that they can be stored in a storage device and executed by a computing device, or they can be separately fabricated into various integrated circuit modules, or multiple modules or steps thereof can be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It is to be noted that the foregoing description is only exemplary of the invention and that the principles of the technology may be employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.