CN120688761A - Resource allocation method and related equipment - Google Patents
Resource allocation method and related equipmentInfo
- Publication number
- CN120688761A CN120688761A CN202510105413.4A CN202510105413A CN120688761A CN 120688761 A CN120688761 A CN 120688761A CN 202510105413 A CN202510105413 A CN 202510105413A CN 120688761 A CN120688761 A CN 120688761A
- Authority
- CN
- China
- Prior art keywords
- resource
- demander
- server
- acquisition request
- usage
- 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
Links
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本申请公开一种资源分配方法及相关设备。方法包括:响应于需求方在第一时刻发送的资源获取请求,确定所述资源获取请求对应的资源用途;确定与所述资源用途对应的审核对象,并对所述审核对象进行审核;在审核通过的情况下,为所述需求方分配与所述资源获取请求对应的资源。采用本申请公开的方案,可以实现资源分配的合理性和准确性。
This application discloses a resource allocation method and related equipment. The method comprises: responding to a resource acquisition request sent by a requester at a first moment, determining a resource usage corresponding to the resource acquisition request; determining an audit object corresponding to the resource usage and auditing the audit object; and, if the audit passes, allocating the resource corresponding to the resource acquisition request to the requester. The solution disclosed in this application can achieve rational and accurate resource allocation.
Description
Technical Field
The present application relates to the field of testing technologies, and in particular, to a resource allocation method and related devices.
Background
The key steps involved in testing for purposes of business function verification, etc. generally include demand analysis and sorting, test case design, test environment set up, and performing tests and result analysis. In the link of setting up the test environment , an environment suitable for the test needs to be set up, comprises hardware, software, a network and the like, ensures the stability and reliability of the test environment, and ensures the accuracy of the test result.
According to the prior art, a resource demander (such as a business team responsible for performing business function verification) can apply for a required resource to a resource manager (such as a basic operation and maintenance team) by submitting a resource acquisition request online. How to determine whether a demander can be allocated resources that it requests to use is a challenge for the manager.
Disclosure of Invention
The embodiment of the application provides a resource allocation method and a related device, which are used for solving the problem of how to determine whether a demander can be allocated with resources which the demander requests to use in the prior art.
In one aspect, an embodiment of the present application provides a resource allocation method, including:
The method comprises the steps of responding to a resource acquisition request sent by a demand party at a first moment, determining a resource usage corresponding to the resource acquisition request, determining an auditing object corresponding to the resource usage, auditing the auditing object, and distributing resources corresponding to the resource acquisition request for the demand party under the condition that the auditing is passed.
In one aspect, an embodiment of the present application provides a resource allocation apparatus, including:
The system comprises an acquisition unit, an auditing unit and an allocation unit, wherein the acquisition unit is used for responding to a resource acquisition request sent by a demand side at a first moment to determine a resource usage corresponding to the resource acquisition request, the auditing unit is used for determining an auditing object corresponding to the resource usage and auditing the auditing object, and the allocation unit is used for allocating resources corresponding to the resource acquisition request for the demand side under the condition that the auditing is passed.
A computing device includes a memory and a processor, wherein,
The memory is used for storing a computer program;
the processor is coupled to the memory for executing the computer program stored in the memory for performing the method described above.
A computer readable storage medium having stored thereon a computer program which, when executed by a computer, is capable of carrying out the method described above.
A computer program product, characterized in that it stores instructions that, when executed by a computer, cause the computer to implement the above-mentioned method.
The above at least one technical scheme adopted by the embodiment of the application can achieve the following beneficial effects:
In the application, the auditing object corresponding to the resource usage is determined, the auditing image is audited, and the resource is allocated to the demand side under the condition that the auditing is passed, so that a more reasonable resource allocation scheme is provided, and the rationality and accuracy of the resource allocation are ensured.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a flowchart of a specific implementation of a resource allocation method according to an embodiment of the present application;
Fig. 2a is a schematic diagram of a system architecture for implementing the method provided by the embodiment of the present application in a practical application scenario;
fig. 2b is a schematic flow chart of the method provided by the present application applied to an actual scene;
Fig. 3 is a schematic diagram of a specific structure of a resource allocation device according to an embodiment of the present application;
fig. 4 is a schematic diagram of a specific structure of a computing device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
As one of ordinary skill in the art can know, with the development of technology and the appearance of new scenes, the technical scheme provided by the embodiment of the application is also applicable to similar technical problems.
The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances and are merely illustrative of the manner in which embodiments of the application have been described in connection with the description of the objects having the same attributes. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of elements is not necessarily limited to those elements, but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
The embodiment 1 of the application provides a resource allocation method, which is used for solving the problem of how to determine whether a demander can be allocated with resources requested to be used in the prior art.
The execution subject of the method can be any computing device that can implement the method, such as a server, a mobile phone, a personal computer, an intelligent wearable device, an intelligent robot, and the like.
Different steps of the method may be implemented by the same execution body or different execution bodies, and the embodiment of the application does not limit what execution body is adopted to implement the method.
In addition, the execution sequence of the different steps is not limited in the embodiment of the application. When the method provided by the embodiment of the application is used, the execution sequence of different steps can be adjusted according to actual requirements.
For convenience of description, the method provided by the embodiment of the present application will be described in detail below by taking a decision tool that can be installed on a user terminal of a manager and used for performing resource allocation as an execution subject of the method.
As shown in fig. 1, a specific implementation flowchart of a resource allocation method provided by an embodiment of the present application includes the following steps:
Step 11, responding to a resource acquisition request sent by a demand party at a first moment, and determining a resource purpose corresponding to the resource acquisition request;
The demander can be any party that demands resources. Such as may include, but not limited to, a test team or tester, etc. Those skilled in the art will appreciate that a demander may also refer to a terminal device or client for use by, for example, a test team or tester, etc.
The first time refers to a time when a resource acquisition request is issued from a demand side. For example, if the demand side issues a resource acquisition request at 2024, 12, 8, 12, 00, 2024, 12, 8, 12, 00 is the first time.
The resource acquisition request sent by the demander can be forwarded to the decision tool through the server, or can be directly sent to the decision tool by the demander.
And the resource acquisition request sent by the demand party is used for requesting to acquire the software resource and/or the resource.
Software resources, including but not limited to operating systems, applications, databases, middleware, and the like. These software resources may be used by the demanding party to perform various tasks such as testing, development, data analysis, etc.
A resource is generally a generic term for all physical devices in a computer system. In the embodiment of the present application, the physical devices within the scope of the resource concept may include, but are not limited to, a central processing unit (Central Processing Unit, CPU), a memory, a hard disk, a video card, a sound card, a network card, and various input/output devices. The servers required in the test environment, for example , are also resources described in embodiments of the present application, in the context of this concept.
In an alternative embodiment, the resource uses of the resource include, but are not limited to, at least one of business function verification, building a pre-release (stage) environment, performance stress testing, performance testing, security testing, compatibility testing, and user experience testing.
In an alternative embodiment, the resource acquisition request sent by the demander may include information about the resource usage of the resource requested to be used. The information of the resource usage is used to characterize the specific usage of the resource requested for use. The information about the use of the resource may be in the form of a character string. For example, the character string 000 is used for representing the resource usage as service function verification, the character string 001 is used for representing the resource usage as building a stage environment, and the like.
When the resource acquisition request contains information of the resource usage of the resource requested to be used, the decision tool can directly acquire the information of the resource usage of the resource from the application after receiving the resource acquisition request.
In another alternative embodiment, the resource acquisition request may not include information about the resource usage of the resource to be used. In such a case, the decision tool, upon receiving the resource acquisition request, may acquire information such as the usage of the resource entered into the decision tool by the manager's personnel.
Step 12, determining an audit object corresponding to the resource application, and auditing the audit object;
In an alternative embodiment, the correspondence between different resource uses of the resource and the corresponding auditing objects may be pre-established. In this case, by querying the correspondence relationship, it is possible to identify the audit object corresponding to the resource usage of the resource requested for use by the demander.
In a specific example, the pre-established correspondence may be as shown in table 1 below.
Table 1:
Taking table 1 as an example, for example, audit object 1, audit object 2, audit object 3, they may be a single audit object or a collection of audit objects formed by a plurality of audit objects (which may be referred to as sub audit objects).
In the embodiment of the application, the auditing object refers to a subject to be audited. For example, when the resource usage includes business function verification, the audit object corresponding to the resource usage may include, but is not limited to, at least one of:
The resource utilization information of the requiring party in the first time period comprises utilization conditions of resources applied by the requiring party in the first time period, any time in the first time period is earlier than the first time, namely, the first time period is historical time relative to the first time, resource allocation corresponding to the resource acquisition request, personnel of the requiring party, such as personnel sending the resource acquisition request, and retry (retransmission) times of the resource acquisition request. Accordingly, when the audit object includes resource usage information for the demander over the first period of time, auditing the audit object may include the sub-steps of:
a substep ① of determining an average consumption rate of the requested resource in case the requesting party has used the requested resource within a first time period;
And a substep ②, checking according to the magnitude relation between the average consumption rate and the consumption rate threshold.
In a specific example, a specific implementation of the above substeps is as follows:
Firstly, judging whether a resource historically allocated for the demand party is used by the demand party in a second time period;
If so, determining the average consumption rate of the resources applied by the demand side in the first time period, and obtaining a comparison result by comparing the average consumption rate of the resources which are historically allocated by the demand side in the first time period with a preset consumption rate threshold value;
And determining whether the auditing object passes the auditing according to the comparison result.
Wherein the second time period is also a historical time period, and the first time period falls within a time coverage of the second time period.
In an alternative embodiment, a specific implementation manner of the substep ② may include determining that the audit passes if the configuration difference is within a preset difference range in a case where the average consumption rate is greater than the consumption rate threshold;
And under the condition that the average consumption rate of the resources is smaller than or equal to the consumption rate threshold, if the personnel level of the requiring party is within the range of the preset level and the retry number of the resource acquisition request is within the range of the preset retry number, determining that the auditing is passed.
When the resource usage includes building a stage environment, the audit object corresponding to the resource usage may include, but is not limited to, a resource configuration corresponding to the resource acquisition request. In such a case, it may be determined whether the audit is passed according to whether the configuration difference is within a preset difference range. The configuration difference is the difference between the resource configuration corresponding to the resource acquisition request and the resource configuration of the applied resource in the first time period.
For example, if the resource configuration of the resource applied in the first period is "1 GB of the memory size of the server", and the resource configuration corresponding to the resource acquisition request is "2 GB of the memory size of the server", the difference in the memory size, i.e., the configuration difference, exceeds 20% compared to the two. If the preset difference range is [0,20% ], the condition belonging to the configuration non-compliance can be judged, and the verification is not passed.
When a resource use includes a performance stress test, the audit object corresponding to the resource use may include, but is not limited to, the type of resource use itself. In such a case, it may be determined whether the audit is passed based on whether the type of resource usage is a performance stress test. The audit is illustratively passed if the type of resource usage is a performance stress test, and is not passed otherwise.
And 13, under the condition that the auditing is passed, distributing resources corresponding to the resource acquisition request for the demander.
In an alternative embodiment, if the audit is passed, the decision tool may output a decision result that characterizes "resources corresponding to the resource acquisition request may be allocated to the demander" to indicate that it is determined that resources corresponding to the resource acquisition request may be allocated to the demander. If the management side of the resource knows the decision result, an operation of allocating the resource corresponding to the resource acquisition request to the demand side may be performed.
In a specific example, when the resource corresponding to the resource acquisition request is a server, the administrator may transmit the IP address of the server requested to be used and the account used by the login server to the demander, thereby realizing allocation of the server to the demander for use.
In a specific example, the resource corresponding to the resource acquisition request may also be allocated to the demander directly by the decision tool. For example, the decision tool may send the IP address of the server (the server is a resource) to which the resource acquisition request corresponds and the account used by the login server to the demander.
In the test scenario, the resource usage of the resource by the demander can be determined to a great extent how the resource should be allocated to the demander, for example, if the resource usage is a performance stress test, the performance stress test can be performed on a single auditing object to determine whether the resource can be allocated to the demander as soon as possible because the service usage is a performance stress test, and for example, if the resource usage is a service function verification, the quantity of the resources required by the service function verification is not too large, whether the allocated resources which are not fully used by the demander currently exist can be firstly audited, and then further judgment can be made according to the auditing situation. Therefore, in the application, by determining the auditing object corresponding to the resource usage, auditing the auditing object, and distributing the resource for the demand party under the condition that the auditing is passed, a more reasonable resource distribution scheme is provided, and the problem of how to determine whether the demand party can be distributed with the resource requested to be used or not in the prior art is solved.
In an alternative embodiment, when the usage of the resource is a performance pressure test, since the usage duration of the resource (such as a hardware resource) for the purpose of the test is short, the resource can be considered to be allocated as soon as possible and then recovered as soon as possible, so that after the audit passes and the resource corresponding to the resource acquisition request is allocated to the demander, the decision tool can also perform timing operation for the usage of the resource corresponding to the resource acquisition request by the demander, and further, when the timing duration of the timing operation reaches the preset usage limit duration, the resource corresponding to the resource acquisition request is recovered.
Illustratively, the decision tool can implement prohibiting the demander from logging into the server by modifying the account used by the logging server, thereby achieving the purpose of recycling the server.
In an alternative implementation manner, the method provided by the embodiment of the present application may further include:
Determining the resource utilization ratio of the demand side according to the resource information of the demand side, and determining the change trend of the resource utilization ratio of the demand side along with time;
And sending the change trend to the demand party so that the demand party can judge whether the resource needs to be supplemented or not based on the change trend.
Wherein the resource usage ratio is a resource usage ratio of a resource allocated to the demander. Resource information, including any one or more of the following:
the importance of the service corresponding to the demand side, the amount of resources allocated to the demand side, the resource utilization rate of the demand side and the resource consumption rate.
The resource usage rate of the demand party may specifically include a daily average usage rate of resources allocated to the demand party by the demand party. The resource consumption rate of the demand side may specifically include a daily average consumption rate of the resource of the demand side for the resource to which the demand side is allocated.
In an alternative implementation manner, the method provided by the embodiment of the present application may further include:
The target resource is the resource which is distributed for all the demand parties of the stage environment of the same application software for constructing the resource usage;
And outputting reference information related to market pricing of the application software according to the counted total amount of resources.
Example 2
Embodiment 2 mainly describes a specific implementation manner of applying the resource allocation method provided in embodiment 1 of the present application to a practical scenario.
It is assumed that an enterprise exists in the actual scenario, and each of the demanding parties of the hardware resources (such as a server, hereinafter the server is described in the embodiment by way of example) of the enterprise includes:
1. a business team A responsible for business function verification;
2. A business team B responsible for building a stage environment;
3. and C, a business team responsible for performance pressure testing.
Of course, these business teams, or members of these business teams, such as general research and development personnel, research and development team and the headquarters, may serve as the server's desirability party.
Meanwhile, a management party of a management server, specifically a basic operation and maintenance team, exists in the enterprise.
According to the related art, the allocation server for the desiring party can be implemented in the following manner:
The method comprises the steps that a demand party applies for a needed server from a management party of the server in an online server application submitting mode, wherein the application comprises the number of the servers and configuration information of the servers, such as the number of the CPUs, the memory size and the like, which are applied for by the demand party, wherein a single server comprises;
after receiving the server application, the management side judges whether the number and configuration of the currently idle servers can meet the requirements of the demander according to the number and configuration information of the servers contained in the server application and in combination with the number and configuration information of the idle servers in the servers managed by the management side;
if yes, the server application is approved, and the management side sends the IP address of the server meeting the requirement of the requiring side and the account password used for logging in the server to the requiring side, so that the server is distributed.
The above-described related art has been practically proven to have the following problems:
For the demanding party business team a, the resource usage of its currently applied server is business function verification. The resource usage is characterized in that the number and memory of the required CPUs are not too large, and the servers distributed to the team can be used as much as possible. In practice, however, it is very likely that the service team a has not been allocated enough before and has been re-allocated with a new server by the current application, resulting in excessive idle waste of resources.
For the business team B of the demand party, the resource usage of the server currently applied for is to build a stage environment. The resource usage is characterized in that the stage environments respectively built based on the servers of each application are independent of each other, for example, the stage environment 1 is built based on the server 1 of the first application, the stage environment 2 is built based on the server 2 of the second application, and the stage environment 1 and the stage environment 2 can be independent of each other because the IP address of the server 1 and the IP address of the server 2 belong to two completely different and isolated network segments. Therefore, for the situation that the resource application is to build the stage environment, the requiring party generally does not multiplex the server with the history allocated to ensure the independence of the newly built stage environment. Therefore, for the resource application, the application of the server passing through the demand side can be examined and approved as soon as possible without the need of inputting unnecessary resources, and the input of unnecessary resources is also a condition of resource waste.
For the demanding party business team C, the resource usage of its currently applied server is performance stress testing. The resource application is characterized in that the service time of the server is short, the server can be distributed as soon as possible, and then the server can be recovered as soon as possible. However, if the manager adopts a complex auditing policy to audit whether the server can be allocated to the service team C, it is equivalent to inputting unnecessary resources to audit, resulting in resource waste.
In order to solve the above-mentioned problem, in embodiment 2, based on the system architecture shown in fig. 2a, a flow shown in fig. 2b is adopted to implement a reasonable decision as to whether the server to which the application can be allocated for the demander, so as to avoid waste of various resources.
In the system architecture shown in fig. 2a, the system comprises a resource allocation decision platform, a client used by a demander and a plurality of servers used for testing. The servers comprise servers which are allocated to a certain demand party and servers which are not allocated to the demand party at present, and the servers are in communication connection with a resource allocation decision platform. In addition, the clients are in communication connection with the resource allocation decision platform.
Based on the system architecture shown in fig. 2a, embodiment 2 of the present application adopts the flow shown in fig. 2b to implement a decision as to whether the server that applies for can be allocated to the requesting party. Specifically, the process comprises the following steps:
Step 21, netdata installed on each server collects index values of CPU utilization rate and memory utilization rate of each server, and sends the index values to a resource allocation decision platform;
netdata is an open source distributed real-time performance and health monitoring tool, which can monitor performance indexes of servers, containers, virtual machines and internet of things equipment, such as CPU, memory, disk, network, etc. in real time.
In the embodiment of the application, netdata can be installed on each server, and Netdata is used for collecting index values of CPU utilization rate and memory utilization rate of the currently installed server.
In a specific example, for example, netdata index values can be collected every minute and reported to the resource allocation decision platform, and after the index values are received, the resource allocation decision platform stores the index values, the corresponding IP addresses of the servers and the index value collection time under the real-time index in the elastic search in a key-value manner. The elastesearch is a real-time distributed search and analysis engine, and can process data in a distributed manner on a plurality of nodes (such as servers and resource allocation decision platforms), for example, can perform real-time analysis, statistics and the like on input data.
The real-time index may be named infrasturct _live, for example, in the format of cpu. Busy:20, hostname:10.25.65.44, timestamp:2024:05:08. Wherein, CPU.busy:20 represents the value of CPU usage, the value 20 means CPU usage is 20%, hostName:10.25.65.44 represents the IP address of the server, the character string 10.25.65.44 is a specific IP address, and the time: 2024:05:08 12:24:56 represents the collection time of the value of CPU usage, 2024:05:08 12:24:56 means 12 points 24 minutes 56 seconds at 5.8.2024.
Similarly, memory usage may also be stored in the format described above.
Step 22, the resource allocation decision platform takes the day as a statistics period, and respectively counts the maximum value and the average value of the CPU utilization rate and the memory utilization rate of each server every day;
in a specific example, the resource allocation decision platform may initiate tasks that are executed at the time of day at 24 points in time, including:
Firstly, acquiring an index value stored in a key-value mode, an IP address of a corresponding server and an index value acquisition time from a real-time index in an elastic search;
then, for each server, based on the data acquired from the real-time index, the average value of CPU usage (denoted as CPU avg), the average value of memory usage (denoted as mem avg), the maximum value of CPU usage (denoted as CPU max), and the maximum value of memory usage (denoted as mem max) on the same day are counted;
Finally, each of the four index values of cpu avg、memavg、cpumax、memmax is stored under the index of the elastic search corresponding to the current day statistics in a key-value manner together with the IP address of the corresponding server and the index value acquisition time.
The index designation may be infrastruct _day, for example, in the format of cpu avg:15, hostname:10.25.65.44, timestamp:2024:05:08. Wherein CPU avg:15 represents the average value of the CPU utilization, and the value of 15 means that the average value of the CPU utilization is 15%. Similarly, the values of the three other indicators other than the average value of the CPU usage may also be stored in the above-described format.
In an alternative embodiment, since Netdata reports the CPU utilization value and the memory utilization value to the resource allocation decision platform once every minute, for any server, the CPU utilization value and the memory utilization value of the server received by the resource allocation decision platform in a day are 1440 respectively, so that for the server, the calculation formula of the corresponding CPU avg may be as follows:
[1]
Wherein CPU i refers to the CPU utilization of the server at the i-th minute of the day, 0< i <1441.
CPU utilization, also known as CPU load or CPU occupancy, is an important indicator for measuring the performance of a computer system. It reflects the activity level of the CPU at work, i.e. how much computing resources the currently executing task occupies. The higher the CPU utilization, the more tasks the system is handling or running more complex programs.
In an alternative embodiment, CPU usage may be calculated in the form of [ (total length of time the CPU is in a non-idle state at each sampling time point)/total sampling time ]. Times.100%.
For this server, the corresponding calculation formula of mem avg may be as follows:
[2]
Wherein mem i refers to the memory usage of the server at the i-th minute of the day, 0< i <1441.
In an alternative embodiment, the memory usage may be calculated as (total memory usage/total available memory) ×100%.
The calculation formula of cpu max、memmax is as follows:
[3]
[4]
Step 23, the resource allocation decision platform calculates the daily average utilization rate of resources of each server according to the average value (CPU avg) of the CPU utilization rate and the average value (mem avg) of the memory utilization rate of each server every day;
The resource utilization rate of the server represents the proportion of the resources used by the application running on the server in the total resources of the server when the application runs stably. The daily average utilization of the resources of the server means the average value of the proportion of the resources used by the application running on the server to the total resources of the server during the day when the application runs steadily.
In an alternative embodiment, the daily average utilization RS usage of the resources of each server may be obtained according to the following formula according to the daily average utilization of the CPU and the daily average utilization of the memory of the server:
[5]
Step 24, the resource allocation decision platform calculates the daily average consumption rate of resources of each server according to the maximum value (CPU max) of the daily CPU utilization rate and the maximum value (mem max) of the memory utilization rate of each server;
The average consumption rate of the resources of the server indicates the proportion of the server resources required to be consumed to the total resources of the server in the case that the application running on the server is at the limit. The average daily consumption rate of the resources of the server means that the server resources that need to be consumed are the proportion of the total resources of the server in the case that the application running on the server is at the limit in one day.
The daily maximum utilization rate of the CPU and the daily maximum utilization rate of the memory of each server are synthesized to obtain the daily average consumption rate RS cost of the resources of each server;
[6]
step 25, the resource allocation decision platform counts the use details of the test server managed by each requiring party (business team);
in an alternative embodiment, the implementation of step 25 may include the following sub-steps:
the resource allocation decision platform obtains the corresponding relation between the identification of the business team and the IP address of the server to which the business team has been allocated from a configuration management database (Configuration Management Database, CMDB);
The resource allocation decision platform determines IP addresses of all the servers which are already allocated by each business team based on the corresponding relation;
The resource allocation decision platform determines respective RS usage and RS cost of all the allocated servers from the calculated daily average utilization rate RS usage and daily average consumption rate RS cost of the resources according to the IP addresses of all the allocated servers;
Finally, the resource allocation decision platform correspondingly stores the identification of the service team, the IP addresses of all the servers to which each service team has been allocated, and the RS usage and RS cost of all the servers to which each service team has been allocated, into a Mysql database.
And 26, when the resource allocation decision platform receives a server application sent by a demand side, selecting an auditing strategy corresponding to the resource application according to the information of the resource application of the server, and auditing the server application according to the selected auditing strategy to obtain an auditing result.
The server application corresponds to the resource acquisition request in embodiment 1, and the audit policy corresponding to the resource usage contains audit objects corresponding to the resource usage of the resource in embodiment 1.
Step 26 will be described in detail below by taking, as an example, a business team a responsible for "business function verification", a business team B responsible for "building stage environment", and a business team C responsible for "performance stress test", respectively.
1. Taking a service team a responsible for service function verification as a request party initiating server application as an example:
since the number and memory of the required CPUs are not too large when the resource usage of the server is service function verification, the history can be used as much as possible to be allocated to the server of the requiring party, and thus, the audit policy corresponding to the resource usage may include:
1) Judging whether a server with the daily average utilization rate of resources or the daily average consumption rate of resources of 0 exists in the servers allocated to the demanding side within the last 10 days, refusing the server application if the judging result is that the server exists, returning the IP address of the server with the daily average utilization rate of resources or the daily average consumption rate of resources of 0 to the client of the demanding side, and checking personnel and job levels of the applicant if the judging result is that the server does not exist.
In an alternative embodiment, the server idle condition audit may include the sub-steps of:
The method comprises the following steps that 1, a resource allocation decision platform obtains an identifier of a requiring party and a sending time stamp of a server application from the server application;
Step 2, the resource allocation decision platform obtains the RS usage and RS cost of all the servers to which the demand party has been allocated by inquiring the identifiers of the business teams and the RS usage and RS cost of all the servers to which the business teams have been allocated correspondingly stored in the Mysql database based on the identifiers of the demand party;
In the sub-step 3, the resource allocation decision platform judges whether a server with RS usage (or RS cost) of 0 exists in the servers already allocated by the demand party within the last 10 days of the time of the transmission of the time stamp based on the transmission time stamp and the queried RS usage (or RS cost), if so, the server application is refused, the IP address of the server with RS usage (or RS cost) of 0 is returned to the client of the demand party, and if not, the sub-step 4 is executed:
And a sub-step 4 of comparing the size relation between the RS cost of the server which is allocated in the last 10 days and a preset consumption rate threshold (such as 50%), if the RS cost of each server which is allocated is greater than 50%, performing server configuration compliance checking, and if the RS cost of each server which is allocated is less than or equal to 50%, performing personnel level checking of the applicant.
2) Server configuration compliance auditing:
In a specific example, the resource allocation decision platform may obtain the configuration of the server currently applied by the demander and the configuration of the server applied by the history application, and determine that the configuration of the machine applied by the applicant is compliant if the configuration difference is within 20%, so as to determine that the audit applied by the server passes, and determine that the configuration of the machine applied by the applicant is non-compliant if the configuration difference is within 20%, so as to reject the application of the server.
For example, assume that the configuration of the server of the history application includes a memory size of 1GB, while the configuration of the server of the current application includes a memory size of 2GB. Then, the difference of the memory sizes exceeds 20%, which is the case of non-compliance.
3) Personnel job level review by applicant:
Taking the person X in the business team a as the applicant, and sending the server application to the resource allocation decision platform by himself using the client, for example, the personnel job level audit of the applicant may include the following sub steps:
A substep ①, acquiring target information from a server application, including the name, role, job level of the person X and configuration of the server of the application, and recording the target information into an application work form table established for the applicant;
The information in the application work list table comprises the target information and the retry times of the same server application resending by the applicant.
In a specific example, the applicant "role" may be a general developer, a research team or a general director, etc., the "job level" of the application may be P1 or P2, etc., the greater the number following P, the higher the representative job level.
In the substep ②, if the role of the applicant is a research and development group leader or a director, or the job level is greater than P6, and at the same time, the retry number of the server application is less than 2, the resource allocation decision platform may determine that the personnel job level of the applicant is approved and further determine that the server application is approved, and if the role of the applicant is a common research and development person and the job level is less than P7, and the retry number of the server application is greater than 1, which basically may indicate that the applicant has insufficient knowledge of the configuration of the hardware resource, the resource allocation decision platform may determine that the personnel job level of the applicant is approved and further determine that the server application is approved and further reject the server application.
Specifically, if the role of the applicant is that of a common research and development person and the job level is below P7, and the retry number of the server application is greater than 1, the resource allocation decision platform may acquire the identifier of the business team where the applicant is located from the server application, query the preset identifiers of the business teams and the address of the client of the responsible person (such as the research and development team organization) in the business teams according to the identifier, forward the server application to the client of the responsible person according to the queried address, if the audit passing notification sent by the client of the responsible person is received, the resource allocation decision platform may determine that the server application audit passes, and if the audit sent by the client of the responsible person is received, the resource allocation decision platform may determine that the server application audit does not pass, thereby rejecting the server application.
In the embodiment of the application, if the application audit of the server passes, the resource allocation decision platform can send the IP address of the server matched with the application of the server and the account number used by the login server to the client of the applicant, and if the application audit of the server does not pass, the resource allocation decision platform can send an application failure notification to the client of the applicant.
2. Taking a service team B responsible for building a stage environment as a request party to initiate a server application as an example:
because the resource usage of the server is that the requesting party will not reuse the server with history allocated when building the stage environment, the auditing policy corresponding to the resource usage may include server configuration compliance auditing.
In a specific example, the resource allocation decision platform may obtain the configuration of the server currently applied by the demander and the configuration of the server applied by the history application, and determine that the configuration of the machine applied by the applicant is compliant if the configuration difference is within 20%, so as to determine that the audit applied by the server passes, and determine that the configuration of the machine applied by the applicant is non-compliant if the configuration difference is within 20%, so as to reject the application of the server.
3. Taking a service team C responsible for "performance stress test" as an example of a request initiated server application:
because the service duration of the server is shorter when the resource use of the server is performance pressure test, the server can be allocated as soon as possible and then recovered as soon as possible, and thus, the auditing policy corresponding to the resource use can include that the direct auditing passes. That is, the resource allocation decision platform may directly determine that the server application audit passes according to the resource usage as the performance pressure test.
In particular, after the auditing passes and the server of the application is allocated to the demander, the resource allocation decision platform may also perform a timing operation for the duration of use of the server/servers—specifically, the timing may be started after the IP address of the server and the account number used by the login server are sent to the client of the applicant.
And when the timing duration reaches the preset use limit duration, the resource allocation decision platform recovers the server/servers. For example, the resource allocation decision platform can realize prohibition of the demander from logging in the server by modifying the account used by the logging in server, thereby achieving the purpose of recovering the server.
In embodiment 2, the resource allocation decision platform may further check, according to the resource usage ratio, the resource usage condition of each service team, and the specific implementation manner is as follows:
Firstly, a resource allocation decision platform acquires the daily average utilization rate RS usage and daily average consumption rate RS cost of the resources of all the servers allocated by each business team corresponding to and stored in the identity of each business team from a Mysql database;
Then, the resource allocation decision platform can calculate the monthly resource utilization rate GRSU and the monthly resource average consumption rate GRSC of each business team according to the daily average utilization rate RS usage and the daily average consumption rate RS cost of the respective resources of all the servers:
Where n is the total number of all servers that a single business team has been assigned.
Further, the resource allocation decision platform obtains the daily resource usage ratio TRSP of each team according to the monthly resource usage rate GRSU and the monthly average resource consumption rate GRSC of each service team, the importance of the service team, and the number of machines P managed by the service team:
Wherein e is a team business coefficient, which can characterize the importance of the business team. Illustratively, the size of e may be proportional to the importance of the business team, with the level 1 business team being the most important team, the corresponding team business coefficient e=130, the level 2 business team being the less important team, the corresponding team business coefficient e=115, the level three business team being the team with lower importance than the level one and level two teams, the corresponding team business coefficient e=103.
Finally, the resource allocation decision platform establishes a coordinate system by taking TRSP as a Y axis and taking time as an x axis, and presents the change trend of the TRSP in the coordinate system, if the trend of the TRSP is reduced in one month, the use rate of the server by the team is reduced, the team responsible party is informed of the fact that the server which the team belongs is underutilized, if the trend of the TRSP is increased in one month, the team responsible party is informed of the fact that the service activity of the team is frequent, the team responsible party is informed of the fact that a new test machine can be applied, and if the TRSP is stable, the team service is stable and the information is not required to be sent.
In particular, since the deployment situation of the application software in the stage environment is consistent with the production environment, according to the configuration details of the servers required by the application software to run in the stage environment, it can be deduced how many servers, how many middleware including ELASTICSEARCH, mysql, kafak, etc. are required to maintain the normal running of the application software in the production environment. Based on the inferred results, the base cost of the application software can be assessed, making a reasonable decision for marketized pricing of the application software.
Therefore, in an alternative embodiment, when the resource usage includes building a stage environment, the resource allocation decision platform may count the total amount of resources of the target server, and output reference information about market pricing of the application software according to the counted total amount of resources.
The target server is a server which is distributed for all the demand parties of the pre-release environment for constructing the same application software for resource use.
Example 3
In order to solve the problem of how to determine whether a requesting party can be allocated resources that it requests to use in the prior art, embodiment 3 of the present application provides a resource allocation device, in view of the same inventive concept as the above embodiments of the present application.
The specific structure schematic diagram of the device is shown in fig. 3, and the device comprises the following functional units:
An obtaining unit 31, configured to determine, in response to a resource obtaining request sent by a demander at a first time, a resource usage corresponding to the resource obtaining request;
an auditing unit 32, configured to determine an auditing object corresponding to the resource usage, and audit the auditing object;
and an allocation unit 33, configured to allocate, to the demander, a resource corresponding to the resource acquisition request if the audit passes.
In an alternative embodiment, if the resource usage includes business function verification, the audit object includes any one or more of the following:
The resource utilization information of the requiring party in the first time period comprises utilization conditions of resources applied by the requiring party in the first time period, any time in the first time period is earlier than the first time, resource configuration corresponding to the resource acquisition request, personnel level of the requiring party and retry times of the resource acquisition request. In an alternative embodiment, if the auditing object includes the resource usage information of the demander in the first period, the auditing unit 32 may specifically be configured to:
and under the condition that the demand party uses the applied resource in the first time period, determining the average consumption rate of the applied resource, and auditing according to the magnitude relation between the average consumption rate and the consumption rate threshold.
In an optional implementation manner, further, if the auditing object further includes the resource configuration corresponding to the resource obtaining request, the personnel level of the demander, and the retry number of the resource obtaining request, the auditing unit 32 may specifically be configured to:
if the average consumption rate is larger than the consumption rate threshold, determining that the auditing is passed if the configuration difference is within a preset difference range, wherein the configuration difference is the difference between the resource configuration corresponding to the resource acquisition request and the resource configuration of the applied resource in the first time period;
And under the condition that the average consumption rate of the resources is smaller than or equal to the consumption rate threshold, if the personnel level of the requiring party is within a preset level range and the retry times are within a preset retry times range, determining that the auditing is passed.
In an alternative implementation, if the resource use includes performance pressure testing, the apparatus provided by the embodiment of the present application may further include a timing recovery unit. The unit is specifically used for timing operation aiming at the use of the resources corresponding to the resource acquisition request by the demander, and recovering the resources corresponding to the resource acquisition request when the duration of the timing operation reaches the preset use limit duration.
In an alternative implementation manner, the device provided by the embodiment of the present application may further include:
a change trend determining unit, configured to determine a resource usage ratio of the requiring party according to resource information of the requiring party, and determine a change trend of the resource usage ratio of the requiring party over time, where the resource information includes any one or more of importance of a service corresponding to the requiring party, the number of resources allocated to the requiring party, a resource usage rate of the requiring party, and a resource consumption rate;
And the sending unit is used for sending the change trend to the demand party so that the demand party can judge whether resources need to be supplemented or not based on the change trend.
In the application, the auditing object corresponding to the resource usage is determined, the auditing image is audited, and the resource is allocated to the demand side under the condition that the auditing is passed, so that a more reasonable resource allocation scheme is provided, and the problem of how to determine whether the demand side can be allocated with the resource requested to be used or not in the prior art is solved.
Example 4
In view of the same inventive concepts as the previous embodiments of the present application, embodiment 4 of the present application provides a computing device to solve the problem of how to determine whether a demander can be allocated with resources that it requests to use in the prior art.
As shown in fig. 4, the computing device includes a memory 41 and a processor 42. The memory 41 may be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on an electronic device. The memory 41 may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
A processor 42 coupled to the memory 41 for executing the computer program stored in the memory 41 for performing a resource allocation method as described in embodiment 1 of the present application.
The processor 42 may, when executing the computer program in the memory 41, perform other functions in addition to the above functions, see in particular the description of the embodiments above.
Further, as shown in FIG. 4, the computing device also includes a display 44, a communication component 43, a power supply component 45, an audio component 46, and other components. Only some of the components are schematically shown in fig. 4, which does not mean that the computing device only includes the components shown in fig. 4.
Accordingly, the embodiments of the present application also provide a computer-readable storage medium storing a computer program, which when executed by a computer is capable of implementing the method provided in each of the above embodiments.
Accordingly, embodiments of the present application also provide a computer program product storing instructions that, when executed by a computer, cause the computer to implement the methods provided by the above embodiments.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
It should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same, and although the present application has been described in detail with reference to the above-mentioned embodiments, it should be understood by those skilled in the art that the technical solution described in the above-mentioned embodiments may be modified or some technical features may be equivalently replaced, and these modifications or substitutions do not make the essence of the corresponding technical solution deviate from the spirit and scope of the technical solution of the embodiments of the present application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510105413.4A CN120688761A (en) | 2025-01-22 | 2025-01-22 | Resource allocation method and related equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510105413.4A CN120688761A (en) | 2025-01-22 | 2025-01-22 | Resource allocation method and related equipment |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN120688761A true CN120688761A (en) | 2025-09-23 |
Family
ID=97080958
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202510105413.4A Pending CN120688761A (en) | 2025-01-22 | 2025-01-22 | Resource allocation method and related equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN120688761A (en) |
-
2025
- 2025-01-22 CN CN202510105413.4A patent/CN120688761A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7664847B2 (en) | Managing workload by service | |
| CN108965381A (en) | Implementation of load balancing, device, computer equipment and medium based on Nginx | |
| CN111124830B (en) | Micro-service monitoring method and device | |
| CN110493065A (en) | The alarm association degree analysis method and system of a kind of cloud center O&M | |
| CN108762924A (en) | A kind of method, apparatus and computer readable storage medium of load balancing | |
| US9667552B2 (en) | Real-time SLA impact analysis | |
| CN105049509A (en) | Cluster scheduling method, load balancer and clustering system | |
| CN111274604A (en) | Service access method, device, equipment and computer readable storage medium | |
| WO2021051839A1 (en) | Data processing method, apparatus and system and storage medium | |
| JP2007148738A (en) | Information monitoring method, system and program | |
| US20070156733A1 (en) | Calculating cluster availability | |
| CN117478679A (en) | Dynamic load balancing method based on data analysis | |
| CN115103007A (en) | Distributed cloud-based service discovery method, device and readable storage medium | |
| CN117201612A (en) | Scheduling method, device and electronic equipment for content distribution network | |
| HK1253571A1 (en) | Automatic server cluster discovery | |
| CN109933501A (en) | A method and device for evaluating the capacity of an application system | |
| CN114153688A (en) | Distributed monitoring method and device based on cloud platform | |
| CN111526038A (en) | Service request distribution method and device, computer equipment and readable storage medium | |
| CN113742400B (en) | Network data acquisition system and method based on self-adaptive constraint conditions | |
| CN107193749B (en) | Test methods, devices and equipment | |
| CN119847736B (en) | Heterogeneous computing power integration and dynamic optimization allocation method and system | |
| CN120688761A (en) | Resource allocation method and related equipment | |
| CN109510730A (en) | Distributed system and its monitoring method, device, electronic equipment and storage medium | |
| CN110932935A (en) | Resource control method, apparatus, device and computer storage medium | |
| CN114726649B (en) | Evaluation method, device, terminal device and storage medium for situational awareness |
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 |