CN115858147A - Cost modeling method and device - Google Patents

Cost modeling method and device Download PDF

Info

Publication number
CN115858147A
CN115858147A CN202211432200.5A CN202211432200A CN115858147A CN 115858147 A CN115858147 A CN 115858147A CN 202211432200 A CN202211432200 A CN 202211432200A CN 115858147 A CN115858147 A CN 115858147A
Authority
CN
China
Prior art keywords
cost
resource
key
application type
unit
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.)
Pending
Application number
CN202211432200.5A
Other languages
Chinese (zh)
Inventor
张静
张宪波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202211432200.5A priority Critical patent/CN115858147A/en
Publication of CN115858147A publication Critical patent/CN115858147A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a cost modeling method and device, and relates to the technical field of computers. One embodiment of the method comprises: for a plurality of servers belonging to the same application type in a server cluster, determining a key resource item associated with the application type from resource items of the servers; for any key resource item, acquiring the utilization rate data and resource allocation data of a plurality of servers in a plurality of historical time periods to establish a use-allocation function corresponding to the application type and the key resource item, and forming a cost control coefficient based on the use-allocation function; and constructing a unit resource cost model of the application type in the key resource item according to the cost control coefficient, the current installation rate data of the plurality of servers and the physical cost and the later cost corresponding to the unit resource of the key resource item in the plurality of servers. This embodiment is able to perform cost accounting in each application type and each resource item dimension by building a unit resource cost model.

Description

Cost modeling method and device
Technical Field
The invention relates to the technical field of computers, in particular to a cost modeling method and device.
Background
In practical application, generally, only the overall cost of a server cluster can be estimated, for example, the total cost of resources is divided by the total amount of orders to obtain the cost of each order, or the total cost of resources is divided by the total number of CPU cores to obtain the cost of each CPU core.
Disclosure of Invention
In view of this, embodiments of the present invention provide a cost modeling method and apparatus, which can perform cost accounting in each application type and each resource item dimension by establishing a unit resource cost model.
To achieve the above objects, according to one aspect of the present invention, there is provided a cost modeling method.
The cost modeling method of the embodiment of the invention comprises the following steps: for a plurality of servers belonging to the same application type in a server cluster, determining at least one key resource item associated with the application type from a plurality of resource items of the servers; for any key resource item, obtaining the usage rate data of the key resource item of the multiple servers in multiple historical time periods and the resource allocation data of the multiple servers in the multiple historical time periods, establishing a usage-allocation function corresponding to the application type and the key resource item according to the usage rate data and the resource allocation data, and forming a cost control coefficient based on the usage-allocation function; obtaining the current installation rate data of the plurality of servers and the physical cost and the later cost corresponding to the unit resource of the key resource item in the plurality of servers, and constructing a unit resource cost model of the application type in the key resource item according to the current installation rate data, the physical cost, the later cost and the cost control coefficient.
Optionally, the use-allocation function is configured to determine corresponding resource allocation data according to the current usage rate data of the key resource item; and, said forming cost control coefficients based on said use-allocation function comprises: determining the reciprocal of the product of the usage-allocation function and a preset standard value of the resource allocation rate and the available resource ratio as the cost control coefficient; and the available proportion is a difference value between 1 and a preset reserved resource proportion.
Optionally, the current installation rate data is an average installation proportion of the cabinets where the servers are located at the current moment, and the installation proportion of any cabinet is a ratio of an actual installation quantity of the cabinet to a rated installation quantity; and constructing a unit resource cost model of the application type in the key resource item according to the current installation rate data, the physical cost, the later cost and the cost control coefficient, wherein the unit resource cost model comprises the following steps: adding the quotient of the later cost and the current installation rate data to the physical cost to obtain the theoretical cost of the unit resource of the application type in the key resource item; and combining the theoretical cost of the unit resource with the cost control coefficient to form the actual cost of the unit resource of the application type in the key resource item.
Optionally, the forming the actual cost of the unit resource of the application type in the key resource item by combining the theoretical cost of the unit resource and the cost control coefficient includes: and multiplying the theoretical cost of the unit resource by the cost control coefficient to form the actual cost of the unit resource of the application type in the key resource item.
Optionally, the application type includes: a database; and, the method further comprises: multiplying the actual cost of the unit resource of the database in the key resource item by a preset multiple to obtain the single-instance cost of the database in the key resource item; wherein, the preset multiple is the unit resource quantity of the key resource item contained in one instance in the database.
Optionally, the application type comprises at least one of: virtual machine, container, database, buffer; the resource items include at least one of: CPU, memory, magnetic disc, network bandwidth.
To achieve the above object, according to another aspect of the present invention, there is provided a cost modeling apparatus.
The cost modeling apparatus of the embodiment of the present invention may include: a key resource item extraction unit to: for a plurality of servers belonging to the same application type in a server cluster, determining at least one key resource item associated with the application type from a plurality of resource items of the servers; a control coefficient determination unit for: for any key resource item, obtaining the usage rate data of the key resource item of the multiple servers in multiple historical time periods and the resource allocation data of the multiple servers in the multiple historical time periods, establishing a usage-allocation function corresponding to the application type and the key resource item according to the usage rate data and the resource allocation data, and forming a cost control coefficient based on the usage-allocation function; and the modeling unit is used for acquiring the current installation rate data of the servers and the physical cost and the later cost corresponding to the unit resource of the key resource item in the servers, and constructing a unit resource cost model of the application type in the key resource item according to the current installation rate data, the physical cost, the later cost and the cost control coefficient.
Optionally, the use-allocation function is configured to determine corresponding resource allocation data according to current usage rate data of the key resource item, where the current installation rate data is an average installed proportion of the cabinets where the multiple servers are located at the current time, and an installed proportion of any cabinet is a ratio of an actual installed quantity to a rated installed quantity of the cabinet; and the control coefficient determination unit is further configured to: determining the reciprocal of the product of the usage-allocation function and a preset standard value of the resource allocation rate and the available resource ratio as the cost control coefficient; wherein, the available proportion is the difference value between 1 and the preset reserved resource proportion; the modeling unit is further configured to: adding the quotient of the later cost and the current installation rate data to the physical cost to obtain the theoretical cost of the unit resource of the application type in the key resource item; and multiplying the theoretical cost of the unit resource by the cost control coefficient to form the actual cost of the unit resource of the application type in the key resource item.
To achieve the above object, according to still another aspect of the present invention, there is provided an electronic apparatus.
An electronic device of the present invention includes: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the cost modeling method provided by the present invention.
To achieve the above object, according to still another aspect of the present invention, there is provided a computer-readable storage medium.
A computer-readable storage medium of the present invention has stored thereon a computer program which, when executed by a processor, implements the cost modeling method provided by the present invention.
According to the technical scheme of the invention, the embodiment of the invention has the following advantages or beneficial effects:
firstly, for a plurality of servers belonging to the same application type in a server cluster, determining a key resource item associated with the application type from resource items of the servers. For any key resource item, obtaining the utilization rate data and the resource allocation data of the key resource item of a plurality of servers in a plurality of historical time periods, establishing a use-allocation function corresponding to the application type and the key resource item according to the utilization rate data and the resource allocation data to represent the mapping relation between the resource utilization rate and the allocation rate, and further forming a cost control coefficient based on the use-allocation function. And finally, constructing a unit resource cost model of the application type in the key resource item according to the current installation rate data of the server, the physical cost, the later cost and the cost control coefficient corresponding to the unit resource of the key resource item. Therefore, fine-grained cost accounting can be performed on different server application types and different resource items, so that the cost occupation conditions of specific application types and specific resource items are quantized, the cost accounting is connected with the resource utilization rate of each application type, the influence of the change of the resource utilization rate on the cost is mastered, the optimization can be pertinently performed, the optimization effect can be evaluated from the aspect of cost, and the fine operation of a website can be realized by reducing the resource cost.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a cost modeling method in an embodiment of the present invention;
FIG. 2 is a diagram illustrating specific steps performed by the cost modeling method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the components of a cost modeling apparatus in an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
FIG. 5 is a schematic structural diagram of an electronic device for implementing the cost modeling method in the embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. 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 invention. 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 of the present invention and the technical features of the embodiments may be combined with each other without conflict.
FIG. 1 is a schematic diagram of the main steps of a cost modeling method according to an embodiment of the present invention.
As shown in fig. 1, the cost modeling method according to the embodiment of the present invention may be specifically executed according to the following steps:
step S101: for a plurality of servers belonging to the same application type in the server cluster, at least one key resource item associated with the application type is determined from a plurality of resource items of the servers.
In the embodiment of the present invention, the application type refers to a type of a service component borne by a server and a function thereof, and in actual application, the application type may include a virtual machine, a container, a database, a cache, and the like. The resource items refer to running resource items of the server, such as a CPU, a memory, a hard disk, a network bandwidth, and the like. In the prior art, only the cost under a single order or a single core can be calculated for a server cluster as a whole, the cost calculation granularity is coarse, and a cost estimation model for application type dimensions and resource items cannot be established. In this step, a key resource item, that is, one or more resource items that most affect the running cost of the server, is first obtained from a plurality of resource items of the server. Specifically, first, monitoring index data of each resource item in a plurality of statistical periods in a certain historical period is obtained to form a vector, then distribution condition data of the server in the same statistical period in the same historical period is obtained to form another vector, similarity (for example, cosine similarity and the like) or correlation coefficient (for example, pearson correlation coefficient and the like) between each resource item vector and the server vector is calculated, and a preset number of resource items with the maximum similarity or correlation coefficient are found out to serve as key resource items. For example, the maximum usage rate (monitoring index data) of each resource item per day (one statistical period per day) in the last half year (historical period) and the server allocation condition data per day in the half year are acquired to calculate the similarity or correlation coefficient. In this document, the allocation, resource allocation and resource allocation data refer to a process of deploying various resources of the server in an actual service, the resource allocation data (e.g. resource allocation rate) can characterize utility of the server resource converted into the actual service, each resource item has corresponding resource allocation data, for example, the resource allocation data of the CPU may be resource allocation rate of a CPU core, if the application type is a virtual machine and a container, the number of CPU cores generated by the allocation may be greater than the number of original cores, and the resource allocation rate of the CPU is greater than 1 at this time, which may be referred to as a super allocation rate.
Step S102: and aiming at any key resource item, acquiring the utilization rate data of the key resource item of a plurality of servers in a plurality of historical time periods and the resource allocation data of the plurality of servers in a plurality of historical time periods, establishing a use-allocation function corresponding to the application type and the key resource item according to the utilization rate data and the resource allocation data, and forming a cost control coefficient based on the use-allocation function.
In order to reflect the influence of the resource utilization rate on the cost in the cost accounting process, it is necessary to establish a mapping relationship between the resource utilization rate and the resource allocation data. In this step, for any key resource item, first, the usage data of the key resource item in multiple historical time periods of multiple servers is obtained, for example, the average value of the maximum usage (usage data) of multiple servers in the last year (one historical time period is a day) is obtained, taking the key resource item as a CPU as an example, the above average value of the maximum usage may be a weighted average value of the maximum usage of each server in the same day with the number of CPU cores contained in the server as a weight. Resource allocation data of each server in the same historical time period is obtained, for example, an average value of CPU (central processing unit) of each server (the CPU is a weighted average value of the CPU overload rate of each server based on the number of CPU cores), a usage-allocation function determined by the usage data and the resource allocation data is determined by a polynomial fitting method, the mathematical form of the usage-allocation function can be determined in advance, for example, the usage-allocation function is determined as a unitary quadratic function, and the fitting can calculate three coefficients of the unitary quadratic function. The usage-allocation function can represent the mapping relation between the resource usage rate and the resource allocation data, and for any application type server cluster or any server, the resource usage rate at any moment is input into the expression of the usage-allocation function to obtain the corresponding resource allocation data.
Thereafter, cost control coefficients for the cost per resource model may be determined based on the use-allocation function. The unit resource cost model is a cost evaluation model finally obtained by the embodiment of the invention, and can present the cost accounting result of the unit resource. Illustratively, for a CPU, the above unit resource is a single core; for the memory, the above unit resource may be a 1G memory; for a disk, the above unit resource may be 1G disk space; the above unit resource may be 1Gbps for network bandwidth. The cost control coefficients are parameters in the unit resource cost model related to resource usage, and are used to adjust the theoretical cost to generate the actual cost.
Preferably, the inverse of the product of the usage-allocation function and the predetermined standard value of the resource allocation rate and the available resource ratio can be determined as the cost control coefficient, as shown in the following formula:
Figure BDA0003942288290000071
wherein K1 represents a cost control coefficient; m represents a resource allocation rate criterion value, and f (x) is a use-allocation function. F is the available resource ratio which is equal to the difference between 1 and the preset reserved resource ratio, and the reserved resource ratio represents the resource ratio which needs to be reserved for use in a specific situation.
The principle of the above formula is that the resource allocation data represented by f (x) generally needs to be normalized to be between zero and one, the theoretical resource allocation rate is obtained by multiplying the theoretical resource allocation rate by a preset resource allocation rate standard value, and the actual resource allocation rate is obtained by multiplying the actual resource allocation rate by an available resource proportion.
Step S103: obtaining current installation rate data of a plurality of servers and physical cost and later cost corresponding to the unit resource of the key resource item in the plurality of servers, and constructing a unit resource cost model of the application type in the key resource item according to the current installation rate data, the physical cost, the later cost and a cost control coefficient.
In this step, the current installation rate data of the plurality of servers is an average installation ratio of the cabinets where the plurality of servers are located at the current moment, the installation ratio of any cabinet is a ratio of an actual installation number of the cabinet to a rated installation number, and the current installation rate data can represent the overall load degree of the cabinet corresponding to the plurality of servers. The above physical cost may include the current cost of the server (i.e., the cost after the procurement cost calculation is depreciated), and the above later cost may be the cost of operating the website. As a preferred scheme, after obtaining the current installation rate data of the plurality of servers and the physical cost and the late cost corresponding to the unit resource of the key resource item in the plurality of servers, the quotient of the late cost and the current installation rate data (the quotient represents the unit resource operation cost formed after the installation proportion conversion) and the physical cost may be added to obtain the theoretical cost of the unit resource of the corresponding application type in the key resource item. And finally, combining the theoretical cost of the unit resource with the cost control coefficient to obtain the actual cost of the unit resource of the application type in the key resource item. The actual cost of the unit resource is a dependent variable of the unit resource cost model, and independent variables of the unit resource cost model are the utilization rate data and the current installation rate data of the key resource items.
In the above unit resource cost model, the theoretical cost of a unit resource may be multiplied by a cost control coefficient to form the actual cost of the unit resource of the corresponding application type in the key resource item, and then the expression of the unit resource cost model is as follows:
Figure BDA0003942288290000081
wherein, P represents the actual cost of the unit resource, N1 represents the physical cost corresponding to the unit resource, N2 represents the later cost corresponding to the unit resource, and K2 represents the current installation rate data.
In addition, for the case that the application type is the database, the actual cost of the unit resource of the database in a certain key resource item may be multiplied by a preset multiple to obtain the cost of the single instance of the database in the key resource item. The above example refers to a minimum unit composed of an IP address and its next port, and the above preset multiple is the unit resource quantity of the key resource item contained in an example in the database. In this way, cost estimation of a single instance in the database can be realized, and subsequent cost adjustment and task scheduling based on the database instance are facilitated.
Therefore, a unit resource cost model corresponding to each key resource item in each application type is obtained, and the model simultaneously reflects the influence of the utilization rate data and the current installation rate data on the actual cost of the unit resource. When the model is used subsequently, the actual cost of the unit resource corresponding to each key resource item of each application type can be obtained, so that the cost occupation condition can be mastered in the application type dimension and the key resource item dimension; secondly, the actual cost of any server or any server cluster under a certain resource item can be obtained by inputting the utilization rate data and the installation rate data of the server or any server cluster in the model, the actual cost of the whole machine can be obtained by carrying out weighted summation on all the resource items, in addition, the obtained cost of the server or the server cluster can be compared with the average cost of the whole system to judge the current cost situation, and the subsequent resource utilization rate adjustment direction is determined based on the use-allocation function in the unit resource cost model, so that the cost is reduced; finally, after the resource utilization rate is adjusted, the adjusted cost can be calculated by using a unit resource cost model, so that the cost change caused by the adjustment can be obtained. The comparison between the actual cost of the unit resource of each application type obtained by the unit resource cost model is also helpful for determining the quantity proportion of each application type server to be purchased under the condition of fixed budget so as to realize the lowest cost under the unit resource.
Fig. 2 is a schematic diagram of specific implementation steps of the cost modeling method in the embodiment of the present invention, and as shown in fig. 2, in step S201, usage data and resource allocation data of key resource items of a server in multiple historical time periods are obtained. In step S202, the usage data and the resource allocation data are fitted to obtain a usage-allocation function. In step S203, a cost control coefficient is constructed using the use-allocation function, the resource allocation rate standard value, and the reserved resource proportion. In step S204, the physical cost and the late cost of the unit resource under the key resource item are obtained. In step S205, the current load probability of the server is obtained. The steps S204 and S205 may be executed successively in any manner, or may be executed simultaneously. In step S206, the quotient of the late cost and the current loading rate is added to the physical cost to obtain the theoretical cost of unit resource. In step S207, the unit resource cost is multiplied by the cost control system to obtain the actual cost of the unit resource. In step S208, a unit resource cost model is formed using the actual cost of the unit resource as a dependent variable and using the current resource usage rate and the current installed rate as independent variables. In step S209, cost accounting is performed for each application type, each key resource item, and the whole machine using the unit resource cost model. In step S210, scheduling of each task on a server is performed according to the cost accounting result, for example, a computing task is migrated to a server with a high CPU cost, and a storage task is migrated to a server with a high memory or disk cost, so as to reduce the unit resource cost of each server. In step S211, cost accounting is performed on the server after task scheduling using the unit resource cost model, thereby quantifying the cost variation resulting from the above adjustment.
In the technical scheme of the embodiment of the invention, aiming at IDC (Internet Data Center) resources, fine-grained cost accounting is realized from the resource utilization rate and unit resource cost dimension, thereby realizing cost reduction and efficiency improvement. In practical application, a usage-allocation function is determined through a polynomial fitting method, a unit resource cost model is further established, and data support is provided for improving the resource utilization rate of a server and the utilization rate (installation proportion) of cabinets in a machine room, so that the operation cost is reduced.
It should be noted that, for the convenience of description, the foregoing method embodiments are described as a series of acts, but those skilled in the art will appreciate that the present invention is not limited by the order of acts described, and that some steps may in fact be performed in other orders or concurrently. Moreover, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no acts or modules are necessarily required to implement the invention.
To facilitate a better implementation of the above-described aspects of embodiments of the present invention, the following also provides relevant means for implementing the above-described aspects.
Referring to fig. 3, a cost modeling apparatus 300 according to an embodiment of the present invention may include: a key resource item extraction unit 301, a control coefficient determination unit 302, and a modeling unit 303.
Wherein, the key resource item extracting unit 301 is configured to: for a plurality of servers belonging to the same application type in a server cluster, determining at least one key resource item associated with the application type from a plurality of resource items of the servers; the control coefficient determination unit 302 may be configured to: aiming at any key resource item, acquiring the utilization rate data of the key resource item of the plurality of servers in a plurality of historical time periods and the resource allocation data of the plurality of servers in the plurality of historical time periods, establishing a use-allocation function corresponding to the application type and the key resource item according to the utilization rate data and the resource allocation data, and forming a cost control coefficient based on the use-allocation function; the modeling unit 303 may be configured to obtain current installation rate data of the multiple servers and a physical cost and a later cost corresponding to a unit resource of the key resource item in the multiple servers, and construct a unit resource cost model of the application type in the key resource item according to the current installation rate data, the physical cost, the later cost, and the cost control coefficient.
In the embodiment of the present invention, the use-allocation function is configured to determine corresponding resource allocation data according to current utilization data of the key resource item, where the current installation probability data is an average installed proportion of cabinets where the plurality of servers are located at a current time, and an installed proportion of any cabinet is a ratio of an actual installed quantity of the cabinet to a rated installed quantity of the cabinet; and, the control coefficient determination unit 302 may be further configured to: determining the reciprocal of the product of the usage-allocation function and a preset standard value of the resource allocation rate and the available resource ratio as the cost control coefficient; wherein, the available proportion is the difference value between 1 and the preset reserved resource proportion; the modeling unit 303 may be further configured to: adding the quotient of the later cost and the current installation rate data to the physical cost to obtain the theoretical cost of the unit resource of the application type in the key resource item; and multiplying the theoretical cost of the unit resource by the cost control coefficient to form the actual cost of the unit resource of the application type in the key resource item.
As a preferred solution, the application type includes a database; and, the modeling unit 303 may be further configured to: multiplying the actual cost of the unit resource of the database in the key resource item by a preset multiple to obtain the single-instance cost of the database in the key resource item; wherein, the preset multiple is the unit resource quantity of the key resource item contained in one instance in the database.
Furthermore, in an embodiment of the present invention, the application type includes at least one of: virtual machine, container, database, buffer; the resource items include at least one of: CPU, memory, disk, network bandwidth.
According to the technical scheme of the embodiment of the invention, firstly, a use-allocation function of each key resource item is established for each application type according to historical operation data of the server so as to form a cost control coefficient in a unit resource cost model, and then the unit resource cost model is established by combining current installation rate data of the server, physical cost corresponding to the unit resource of the key resource item and later cost so as to evaluate the occupation cost of the unit resource under the key resource item, so that the fine cost quantification of the application type and the resource item dimension is realized. Furthermore, the unit resource cost model represents the correlation between the resource utilization rate and the unit resource cost, and the unit resource cost model can be used for obtaining the utilization rate improvement direction for reducing the cost and quantifying the cost change corresponding to the improvement.
FIG. 4 illustrates an exemplary system architecture 400 to which the cost modeling method or apparatus of an embodiment of the invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405 (this architecture is merely an example, and the components included in a particular architecture may be adapted according to application specific circumstances). The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. Various communication client applications, such as cost accounting applications (for example only), may be installed on the terminal devices 401, 402, 403.
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server providing various services, such as a background server (for example only) providing support for cost accounting applications operated by users with the terminal devices 401, 402, 403. The backend server may process the received cost calculation request or the like and feed back the processing result (e.g., the calculated actual cost per resource-just an example) to the terminal devices 401, 402, 403.
It should be noted that the cost modeling method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the cost modeling apparatus is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The invention also provides the electronic equipment. The electronic device of the embodiment of the invention comprises: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the cost modeling method provided by the present invention.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use in implementing an electronic device of an embodiment of the present invention. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the computer system 500 are also stored. The CPU501, ROM 502, and RAM503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, the processes described in the main step diagrams above may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the main step diagram. In the above-described embodiment, the computer program can be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the central processing unit 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: 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 the present invention, 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. In the present invention, 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.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, which may be described as: a processor includes a key resource item extraction unit, a control coefficient determination unit, and a modeling unit. Where the names of these units do not in some cases constitute a limitation on the units themselves, for example, the key resource item extraction unit may also be described as a "unit that provides the key resource items to the control coefficient determination unit".
As another aspect, the present invention also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to perform steps comprising: for a plurality of servers belonging to the same application type in a server cluster, determining at least one key resource item associated with the application type from a plurality of resource items of the servers; for any key resource item, obtaining the usage rate data of the key resource item of the multiple servers in multiple historical time periods and the resource allocation data of the multiple servers in the multiple historical time periods, establishing a usage-allocation function corresponding to the application type and the key resource item according to the usage rate data and the resource allocation data, and forming a cost control coefficient based on the usage-allocation function; obtaining the current installation rate data of the plurality of servers and the physical cost and the later cost corresponding to the unit resource of the key resource item in the plurality of servers, and constructing a unit resource cost model of the application type in the key resource item according to the current installation rate data, the physical cost, the later cost and the cost control coefficient.
In the technical solution of the embodiment of the present invention, first, for a plurality of servers belonging to the same application type in a server cluster, a key resource item associated with the application type is determined from resource items of the servers. For any key resource item, obtaining the utilization rate data and the resource allocation data of the key resource item of a plurality of servers in a plurality of historical time periods, establishing a use-allocation function corresponding to the application type and the key resource item according to the utilization rate data and the resource allocation data to represent the mapping relation between the resource utilization rate and the allocation rate, and further forming a cost control coefficient based on the use-allocation function. And finally, constructing a unit resource cost model of the application type in the key resource item according to the current installation rate data of the server, the physical cost, the later cost and the cost control coefficient corresponding to the unit resource of the key resource item. Therefore, fine-grained cost accounting can be performed on different server application types and different resource items, so that the cost occupation conditions of specific application types and specific resource items are quantized, the cost accounting is connected with the resource utilization rate of each application type, the influence of the change of the resource utilization rate on the cost is mastered, the optimization can be pertinently performed, the optimization effect can be evaluated from the aspect of cost, and the fine operation of a website can be realized by reducing the resource cost.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A cost modeling method, comprising:
for a plurality of servers belonging to the same application type in a server cluster, determining at least one key resource item associated with the application type from a plurality of resource items of the servers;
for any key resource item, obtaining the usage rate data of the key resource item of the multiple servers in multiple historical time periods and the resource allocation data of the multiple servers in the multiple historical time periods, establishing a usage-allocation function corresponding to the application type and the key resource item according to the usage rate data and the resource allocation data, and forming a cost control coefficient based on the usage-allocation function;
obtaining the current installation rate data of the plurality of servers and the physical cost and the later cost corresponding to the unit resource of the key resource item in the plurality of servers, and constructing a unit resource cost model of the application type in the key resource item according to the current installation rate data, the physical cost, the later cost and the cost control coefficient.
2. A method according to claim 1, wherein the use-allocation function is arranged to determine corresponding resource allocation data from current usage data for the key resource item; and, said forming cost control coefficients based on said use-allocation function comprises:
determining the reciprocal of the product of the usage-allocation function and a preset standard value of the resource allocation rate and the available resource proportion as the cost control coefficient; wherein, the available proportion is the difference value between 1 and the preset reserved resource proportion.
3. The method according to claim 1, wherein the current installation probability data is an average installation proportion of cabinets where the plurality of servers are located at the current time, and the installation proportion of any cabinet is a ratio of an actual installation number of the cabinet to a rated installation number; and constructing a unit resource cost model of the application type in the key resource item according to the current installation rate data, the physical cost, the later cost and the cost control coefficient, wherein the unit resource cost model comprises the following steps:
adding the quotient of the later cost and the current installation rate data to the physical cost to obtain the theoretical cost of the unit resource of the application type in the key resource item;
and combining the theoretical cost of the unit resource with the cost control coefficient to form the actual cost of the unit resource of the application type in the key resource item.
4. The method according to claim 3, wherein said combining the theoretical cost per resource and the cost control coefficient to form the actual cost per resource of the application type in the key resource item comprises:
and multiplying the theoretical cost of the unit resource by the cost control coefficient to form the actual cost of the unit resource of the application type in the key resource item.
5. The method of claim 3, wherein the application type comprises: a database; and, the method further comprises:
multiplying the actual cost of the unit resource of the database in the key resource item by a preset multiple to obtain the single-instance cost of the database in the key resource item; wherein, the preset multiple is the unit resource quantity of the key resource item contained in one instance in the database.
6. The method according to any of claims 1-4, wherein the application type comprises at least one of: virtual machine, container, database, buffer;
the resource items include at least one of: CPU, memory, magnetic disc, network bandwidth.
7. A cost modeling apparatus, comprising:
a key resource item extraction unit to: for a plurality of servers belonging to the same application type in a server cluster, determining at least one key resource item associated with the application type from a plurality of resource items of the servers;
a control coefficient determination unit for: for any key resource item, obtaining the usage rate data of the key resource item of the multiple servers in multiple historical time periods and the resource allocation data of the multiple servers in the multiple historical time periods, establishing a usage-allocation function corresponding to the application type and the key resource item according to the usage rate data and the resource allocation data, and forming a cost control coefficient based on the usage-allocation function;
and the modeling unit is used for acquiring the current installation rate data of the servers and the physical cost and the later cost corresponding to the unit resource of the key resource item in the servers, and constructing a unit resource cost model of the application type in the key resource item according to the current installation rate data, the physical cost, the later cost and the cost control coefficient.
8. The apparatus according to claim 7, wherein the usage-allocation function is configured to determine corresponding resource allocation data according to current utilization data of the key resource item, the current installation probability data is an average installed proportion of the cabinets where the plurality of servers are located at the current time, and the installed proportion of any cabinet is a ratio of an actual installed quantity of the cabinet to a rated installed quantity of the cabinet; and (c) a second step of,
the control coefficient determination unit is further configured to: determining the reciprocal of the product of the usage-allocation function and a preset standard value of the resource allocation rate and the available resource ratio as the cost control coefficient; wherein, the available proportion is the difference value between 1 and the preset reserved resource proportion;
the modeling unit is further configured to: adding the quotient of the later cost and the current installation rate data to the physical cost to obtain the theoretical cost of the unit resource of the application type in the key resource item; and multiplying the theoretical cost of the unit resource by the cost control coefficient to form the actual cost of the unit resource of the application type in the key resource item.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202211432200.5A 2022-11-14 2022-11-14 Cost modeling method and device Pending CN115858147A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211432200.5A CN115858147A (en) 2022-11-14 2022-11-14 Cost modeling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211432200.5A CN115858147A (en) 2022-11-14 2022-11-14 Cost modeling method and device

Publications (1)

Publication Number Publication Date
CN115858147A true CN115858147A (en) 2023-03-28

Family

ID=85663625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211432200.5A Pending CN115858147A (en) 2022-11-14 2022-11-14 Cost modeling method and device

Country Status (1)

Country Link
CN (1) CN115858147A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116069513A (en) * 2023-04-04 2023-05-05 上海钐昆网络科技有限公司 Cost determination method, device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116069513A (en) * 2023-04-04 2023-05-05 上海钐昆网络科技有限公司 Cost determination method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111786895A (en) Method and apparatus for dynamic global current limiting
CN109408205B (en) Task scheduling method and device based on hadoop cluster
CN112527649A (en) Test case generation method and device
CN112445857A (en) Resource quota management method and device based on database
CN110706093A (en) Accounting processing method and device
CN113495779A (en) Task scheduling method and device and task execution system
CN111858040A (en) Resource scheduling method and device
CN115858147A (en) Cost modeling method and device
US11294930B2 (en) Resource scaling for distributed database services
CN115421922A (en) Current limiting method, device, equipment, medium and product of distributed system
CN115525400A (en) Method, apparatus and program product for managing multiple computing tasks on a batch basis
CN112685481B (en) Data processing method and device
CN113760982A (en) Data processing method and device
CN112667368A (en) Task data processing method and device
CN116541167A (en) System flow control method, device, electronic equipment and computer readable medium
CN115438007A (en) File merging method and device, electronic equipment and medium
CN114265692A (en) Service scheduling method, device, equipment and storage medium
CN114090247A (en) Method, device, equipment and storage medium for processing data
CN114612212A (en) Business processing method, device and system based on risk control
CN108683608B (en) Method and device for distributing flow
CN113626175A (en) Data processing method and device
CN114020469A (en) Edge node-based multi-task learning method, device, medium and equipment
CN112561301A (en) Work order distribution method, device, equipment and computer readable medium
CN111695984A (en) Account balance processing method and device
CN111125112A (en) Data processing method and device, electronic equipment and computer readable storage medium

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