Resource allocation method and related equipment

By determining the audit objects corresponding to resource usage and conducting audits, resources are allocated to the demanders, solving the problem of how to determine whether the demanders can be allocated the resources they request, achieving the rationality and accuracy of resource allocation, and avoiding resource waste.

CN120688761APending Publication Date: 2025-09-23MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510105413.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In the prior art, how to determine whether a demander can be allocated the resources it requests is a problem that needs to be solved urgently.

Method used

By determining the audit object corresponding to the resource usage and auditing the audit object, resources are allocated to the demander if the audit passes, providing a reasonable resource allocation plan.

Benefits of technology

Ensure the rationality and accuracy of resource allocation, avoid resource waste, and improve resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120688761A_ABST
    Figure CN120688761A_ABST
Patent Text Reader

Abstract

The invention discloses a resource allocation method and related equipment. The method comprises the following steps: in response to a resource acquisition request sent by a demander at a first moment, determining a resource use corresponding to the resource acquisition request; determining an auditing object corresponding to the resource use, and auditing the auditing object; and allocating resources corresponding to the resource acquisition request to the demander under the condition that the audit is passed. By adopting the scheme disclosed by the invention, the rationality and accuracy of resource allocation can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to a resource allocation method and related equipment. Background Art

[0002] Testing aimed at verifying business functionality typically involves key steps such as requirements analysis and organization, test case design, test environment setup, test execution, and result analysis. During the test environment setup phase, a suitable testing environment, including hardware, software, and network, must be established to ensure stability and reliability, ultimately guaranteeing accurate test results.

[0003] According to existing technology, resource demanders (such as the business team responsible for business function verification) can submit online resource acquisition requests to resource managers (such as the infrastructure operations and maintenance team). For managers, determining whether the requested resources can be allocated is a pressing issue. Summary of the Invention

[0004] The embodiments of the present application provide a resource allocation method and related devices to solve the problem in the prior art of how to determine whether a demander can be allocated the resources it requests.

[0005] In one aspect, an embodiment of the present application provides a resource allocation method, comprising: In response to the resource acquisition request sent by the demander at the first moment, determine the resource usage corresponding to the resource acquisition request; determine the audit object corresponding to the resource usage, and audit the audit object; if the audit is passed, allocate the resources corresponding to the resource acquisition request to the demander.

[0006] In one aspect, an embodiment of the present application provides a resource allocation device, comprising: An acquisition unit is used to respond to a resource acquisition request sent by a demander at the first moment and determine the resource usage corresponding to the resource acquisition request; an audit unit is used to determine an audit object corresponding to the resource usage and audit the audit object; and an allocation unit is used to allocate the resources corresponding to the resource acquisition request to the demander if the audit is passed.

[0007] A computing device comprising: a memory and a processor, wherein: The memory is used to store computer programs; The processor is coupled to the memory and is configured to execute the computer program stored in the memory to perform the above method.

[0008] A computer-readable storage medium stores a computer program, which can implement the above method when executed by a computer.

[0009] A computer program product is characterized in that the computer program product stores instructions, and when the instructions are executed by a computer, the computer is caused to implement the above method. At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: Since in the test scenario, the resource usage of the resources required by the demander can largely determine whether resources are allocated to the demander, in this application, by determining the audit object corresponding to the resource usage, then auditing the audit object, and allocating resources to the demander if the audit is passed, a more reasonable resource allocation plan is given to ensure the rationality and accuracy of resource allocation. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 A flowchart of a specific implementation of a resource allocation method provided in an embodiment of the present application; Figure 2a A schematic diagram of a system architecture for implementing the method provided in an embodiment of the present application in an actual application scenario; Figure 2b A schematic diagram of a specific process of applying the method provided in this application to a practical scenario; Figure 3 A schematic diagram of the specific structure of a resource allocation device provided in an embodiment of the present application; Figure 4 A schematic diagram of the specific structure of the computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0011] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0012] Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0013] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0014] Example 1 Embodiment 1 of the present application provides a resource allocation method to solve the problem in the prior art of how to determine whether a demander can be allocated the resources it requests.

[0015] The execution subject of this method can be any computing device that can implement this method, such as a server, a mobile phone, a personal computer, a smart wearable device, an intelligent robot, etc.

[0016] The different steps of the method may be implemented by the same execution entity or by different execution entities. The embodiments of the present application do not limit the execution entity used to implement the method.

[0017] In addition, the embodiment of the present application does not limit the execution order of different steps. When using the method provided in the embodiment of the present application, the execution order of different steps can be adjusted according to actual needs.

[0018] For ease of description, the method provided in the embodiment of the present application is described in detail below, taking a decision-making tool that can be installed on a user terminal of a management party and used for resource allocation as an example of the execution subject of the method.

[0019] like Figure 1 FIG. 1 is a flowchart of a specific implementation of a resource allocation method provided in an embodiment of the present application, including the following steps: Step 11: In response to the resource acquisition request sent by the demander at the first moment, determine the resource usage corresponding to the resource acquisition request; The demander can be any party that requires resources. Examples include, but are not limited to, a testing team or testers. Those skilled in the art will appreciate that the demander can also refer to, for example, the terminal devices or clients used by the testing team or testers.

[0020] The first moment is the moment when the resource acquisition request is sent from the demander. For example, if the demander sends a resource acquisition request at 12:00 on December 8, 2024, then 12:00 on December 8, 2024 is the first moment.

[0021] The resource acquisition request sent by the demander may be forwarded to the decision-making tool via the server; or may be sent directly by the demander to the decision-making tool.

[0022] The resource acquisition request sent by the demander is used to request software resources and / or resources.

[0023] Software resources include but are not limited to operating systems, applications, databases, middleware, etc. These software resources can be used by the demander to perform various tasks such as testing, development, and data analysis.

[0024] Resources are generally a general term for all physical devices in a computer system. In the embodiments of this application, physical devices within the resource concept may include, but are not limited to, central processing units (CPUs), memory, hard drives, graphics cards, sound cards, network cards, and various input and output devices. Within this conceptual scope, for example, servers required in a test environment also qualify as resources as described in the embodiments of this application.

[0025] In an optional implementation, the resource usage includes but is not limited to at least one of business function verification, setting up a pre-release (stage) environment, performance stress testing, performance testing, security testing, compatibility testing, and user experience testing.

[0026] In an optional embodiment, the resource acquisition request sent by the requester may include information about the resource usage of the requested resource. This resource usage information is used to indicate the specific purpose of the requested resource. Specifically, this resource usage information may be a string. For example, the string 000 may indicate that the resource usage is for business function verification; the string 001 may indicate that the resource usage is for setting up a stage environment; and so on.

[0027] When the resource acquisition request includes information on the resource usage of the requested resource, the decision-making tool may directly obtain the resource usage information of the resource from the request after receiving the resource acquisition request.

[0028] In another optional embodiment, the resource acquisition request may not include the resource usage information of the requested resource. In such a case, after receiving the resource acquisition request, the decision tool may obtain the resource usage information input into the decision tool by, for example, a person from the management party.

[0029] Step 12: Determine the audit objects corresponding to resource usage and audit the audit objects; In an optional implementation, a correspondence between different resource usages and corresponding audit objects can be pre-established. In this case, by querying the correspondence, the audit object corresponding to the resource usage requested by the demander can be determined.

[0030] In a specific example, the pre-established correspondence relationship may be shown in Table 1 below.

[0031] Table 1:

[0032] Taking Table 1 as an example, audit object 1, audit object 2, and audit object 3 can be a single audit object or an audit object set consisting of multiple audit objects (which can be called sub-audit objects).

[0033] In the embodiments of the present application, the audit object refers to the 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 following: The requester's resource usage information within the first time period; the resource usage information includes the requester's usage of the resources requested within the first time period; any moment within the first time period is earlier than the first moment, that is, the first time period is a historical moment relative to the first moment; the resource configuration corresponding to the resource acquisition request; the personnel rank of the requester; the personnel of the requester, for example, may refer to the person who sent the resource acquisition request; and the number of retries (retransmissions) of the resource acquisition request. Accordingly, when the audit object includes the requester's resource usage information within the first time period, auditing the audit object may include the following sub-steps: Sub-step ①: if the demander has used the requested resources within the first time period, determine the average consumption rate of the requested resources; Sub-step ②: Review based on the relationship between the average consumption rate and the consumption rate threshold.

[0034] In a specific example, a specific implementation process of the above sub-steps is as follows: First, determine whether the demander has used the resources historically allocated to the demander in the second time period; If the judgment is yes, then determining the average consumption rate of the resources requested by the demander in the first time period, and obtaining a comparison result by comparing the average consumption rate of the resources historically allocated by the demander in the first time period with a preset consumption rate threshold; Based on the comparison results, determine whether the audit object has passed the audit.

[0035] The second time period is also a historical time period, and the first time period falls within the time coverage of the second time period.

[0036] In an optional embodiment, a specific implementation of sub-step ② may include: when the average consumption rate is greater than the consumption rate threshold, if the configuration difference is within a preset difference range, determining that the review is passed; wherein the configuration difference is the difference between the resource configuration corresponding to the resource acquisition request and the resource configuration of the resource requested during the first time period; When the average resource consumption rate is less than or equal to the consumption rate threshold, if the personnel rank of the demander is within the preset rank range, and the number of retries of the resource acquisition request is within the preset retry number range, the review is determined to be passed.

[0037] When the resource usage includes setting up a stage environment, the audit objects corresponding to this resource usage may include, but are not limited to, the resource configuration corresponding to the resource acquisition request. In this case, whether the audit passes can be determined based on whether the configuration difference falls within a preset difference range. The configuration difference refers to the difference between the resource configuration corresponding to the resource acquisition request and the resource configuration of the resource requested during the first time period.

[0038] For example, if the resource configuration for the resource requested during the first time period is "server memory size is 1GB," while the resource configuration corresponding to the resource acquisition request is "server memory size is 2GB," then the difference in memory size—and therefore the configuration difference—exceeds 20%. If the preset difference range is [0, 20%], then this can be determined to be a configuration non-compliance and the application will be rejected.

[0039] When a resource usage includes performance stress testing, the audit object corresponding to this resource usage may include, but is not limited to, the resource usage type itself. In this case, whether the audit passes can be determined based on whether the resource usage type is a performance stress test. For example, if the resource usage type is a performance stress test, the audit passes; otherwise, the audit fails.

[0040] Step 13: If the review is passed, the resources corresponding to the resource acquisition request are allocated to the demander.

[0041] In an optional embodiment, if the review passes, the decision tool may output a decision result indicating that "the resource corresponding to the resource acquisition request can be allocated to the requester," indicating that the resource corresponding to the resource acquisition request can be allocated to the requester. If the resource manager learns of this decision result, it may allocate the resource corresponding to the resource acquisition request to the requester.

[0042] In a specific example, when the resource corresponding to the resource acquisition request is a server, the management party can send the IP address of the server used in the request and the account and password used to log in to the server to the requester, thereby allocating the server to the requester for use.

[0043] In a specific example, the decision-making tool can also directly allocate resources corresponding to the resource acquisition request to the demander. For example, the decision-making tool can send the IP address of the server corresponding to the resource acquisition request (the server is the resource) and the account and password used to log in to the server to the demander.

[0044] Because in the test scenario, the resource usage of the demander can largely determine how the resources should be allocated to the demander - for example, if the resource usage is performance stress testing, then since the performance stress test will use the resources for a shorter period of time, it is possible to conduct an audit on a relatively single audit object in order to make a decision as soon as possible on whether the resources can be allocated to the demander; for another example, if the resource usage is business function verification, then since the number of resources required for business function verification will not be too large, it is possible to first audit whether the demander currently has allocated resources that have not been fully utilized, and then make further judgments based on the audit situation. Therefore, in this application, by determining the audit object corresponding to the resource usage, then auditing the audit object, and allocating resources to the demander if the audit passes, a more reasonable resource allocation scheme is provided, which solves the problem of how to determine whether the demander can be allocated the resources it requests to use, which exists in the prior art.

[0045] In an optional embodiment, when the resource is used for performance stress testing, since the test for this purpose uses resources (such as hardware resources) for a short time, it can be considered to allocate resources as soon as possible and then reclaim the resources as soon as possible. Therefore, after the review is passed and the resources corresponding to the resource acquisition request are allocated to the demander, the decision tool can also perform a timing operation on the demander's use of the resources corresponding to the resource acquisition request; further, when the timing operation reaches the preset usage limit, the resources corresponding to the resource acquisition request are reclaimed.

[0046] For example, the decision-making tool can prohibit the demander from logging into the server by modifying the account and password used to log into the server, thereby achieving the purpose of reclaiming the server.

[0047] In an optional implementation, the method provided in the embodiment of the present application may further include: Determine the resource usage ratio of the demand side according to the resource information of the demand side, and determine the changing trend of the resource usage ratio of the demand side over time; The change trend is sent to the demander so that the demander can determine whether additional resources are needed based on the change trend.

[0048] The resource utilization ratio is the resource utilization ratio of the resources allocated to the demand side. Resource information includes any one or more of the following: The importance of the business corresponding to the demander, the amount of resources allocated to the demander, the demander's resource utilization rate and resource consumption rate.

[0049] The resource utilization rate of the demand side may specifically include: the average daily utilization rate of the resources allocated to the demand side. The resource consumption rate of the demand side may specifically include: the average daily consumption rate of the resources allocated to the demand side.

[0050] In an optional implementation, the method provided in the embodiment of the present application may further include: Count the total amount of target resources; target resources are the resources allocated to all demanders who use the resources to build the stage environment of the same application software; Based on the total amount of resources counted, reference information on the market pricing of the application software is output.

[0051] Example 2 Example 2 mainly introduces a specific implementation method of applying the resource allocation method provided in Example 1 of this application to an actual scenario.

[0052] Assume that there is an enterprise in this actual scenario, and the various parties demanding the enterprise's hardware resources (for example, servers, which will be used as an example in the following text to introduce the specific implementation method) include: 1. Business Team A is responsible for business function verification; 2. Business Team B is responsible for setting up the stage environment; 3. Business Team C is responsible for performance stress testing.

[0053] Of course, these business teams, or members of these business teams, such as ordinary R&D personnel, R&D team leaders and directors, can all be demanders of servers.

[0054] At the same time, the company also has managers who manage the servers, specifically the basic operation and maintenance team.

[0055] According to relevant technologies, the following methods can be used to allocate servers to demanders: The requester submits an online server application to the server administrator to request the required servers. The application includes the requested number of servers and server configuration information, such as the number of CPUs and memory size of each server. After receiving the server application, the administrator determines whether the number and configuration of the currently available servers can meet the needs of the requester based on the server number and configuration information contained therein, combined with the number and configuration information of the currently available servers among the servers managed by the administrator; If the judgment is yes, the server application is approved, and the management party will send the IP address of the server that meets the needs of the demander and the account and password used to log in to the server to the demander, thereby realizing the allocation of the server.

[0056] The above-mentioned related technologies have been proven to have the following problems in practice: For business team A, the server resources they are currently requesting are for business function verification. This resource usage requires a modest amount of CPU and memory, allowing them to maximize the use of previously allocated servers. However, in reality, it's very likely that business team A's previously allocated servers are insufficient, and they are then reassigned new servers based on their current application, resulting in excessive resource idleness and waste.

[0057] For business team B, the server resource they're currently applying for is intended for building a stage environment. This resource usage is unique in that the stage environments built for each server application are independent of each other—for example, stage environment 1 is built based on server 1 in the first application, and stage environment 2 is built based on server 2 in the second application. Because server 1's IP address and server 2's IP address belong to completely different, isolated network segments, stage environments 1 and 2 are independent of each other. Therefore, when resources are used to build a stage environment, the application provider generally won't reuse previously allocated servers to ensure the independence of the newly built stage environment. Therefore, for this resource usage, the application provider's server application can be approved quickly, without having to invest unnecessary resources in review. This unnecessary investment is also a form of resource waste.

[0058] For Business Team C, the server resources they are currently requesting are intended for performance stress testing. This resource usage is characterized by a short lifespan, allowing for quick allocation and subsequent reclaiming. However, if the management adopts a complex review strategy to determine whether the server can be allocated to Business Team C, this would be an unnecessary investment of resources, resulting in wasted resources.

[0059] To solve the above problems, in Example 2, based on Figure 2a The system architecture shown in Figure 2b The process shown is used to make reasonable decisions on whether to allocate the server requested by the demander to avoid waste of various resources.

[0060] exist Figure 2a The system architecture shown includes a resource allocation decision platform, client applications used by demanders, and several servers for testing. These servers include both those already allocated to demanders and those not yet allocated. Each server is connected to the resource allocation decision platform. Furthermore, each client application is connected to the resource allocation decision platform.

[0061] Based on Figure 2a The system architecture shown in FIG. 2 is as follows. Figure 2b The process shown is used to decide whether to allocate the server requested by the demander. Specifically, the process includes the following steps: Step 21: Netdata installed on each server collects the CPU usage and memory usage index values ​​of each server and sends these index values ​​to the resource allocation decision platform; Netdata is an open source distributed real-time performance and health monitoring tool that can monitor the performance indicators of servers, containers, virtual machines, and IoT devices in real time, such as CPU, memory, disk, network, etc.

[0062] In an embodiment of the present application, Netdata may be installed on each server, and Netdata collects the index values ​​of the CPU usage and memory usage of the server currently installed.

[0063] In a specific example, Netdata can be configured to collect and report metric values ​​to the resource allocation decision platform every minute. Upon receiving the metric value, the resource allocation decision platform stores the metric value, the corresponding server IP address, and the metric value collection time as a key-value pair in a real-time index in ElasticSearch. ElasticSearch is a real-time distributed search and analytics engine that processes data distributedly across multiple nodes (such as servers and the resource allocation decision platform). For example, it can perform real-time analysis and statistics on input data.

[0064] For example, the real-time index name can be infrasturct_live, and the format is: cpu.busy:20,hostName:10.25.65.44,timestamp:2024:05:08. cpu.busy:20 represents the CPU usage value, and the value 20 means the CPU usage is 20%; hostName:10.25.65.44 represents the server IP address, and the string 10.25.65.44 is the specific IP address; timestamp:2024:05:08 12:24:56 represents the time when the CPU usage value was collected, and 2024:05:08 12:24:56 means 12:24:56 on May 8, 2024.

[0065] Similarly, memory usage can also be stored in the above format.

[0066] Step 22: The resource allocation decision platform uses a daily statistical cycle to calculate the maximum and average CPU usage and memory usage of each server each day. In a specific example, the resource allocation decision platform can start a task scheduled to be executed at 24:00 every day. The task includes: First, obtain the indicator value stored in key-value format, the corresponding server IP address, and the indicator value collection time from the real-time index in ElasticSearch; Then, for each server, based on the data obtained from the real-time index, the average CPU usage of the day is calculated (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 ); Finally, cpu avg 、 mem avg 、 cpu max 、 mem max Each of the four metric values, along with the corresponding server IP address and metric value collection time, is stored in Elasticsearch as a key-value pair under the index corresponding to the statistical results of the day.

[0067] For example, the index name can be infrastruct_day, and the format is: cpu avg :15,hostName:10.25.65.44,timestamp:2024:05:08. cpu avg :15 represents the average CPU usage. A value of 15 means the average CPU usage is 15%. Similarly, the values ​​of the other three indicators, except the average CPU usage, can also be stored in the above format.

[0068] In an optional implementation, since Netdata reports the CPU usage and memory usage values ​​to the resource allocation decision platform once every minute, for any server, the resource allocation decision platform receives 1440 CPU usage and memory usage values ​​of the server in one day, so for the server, the corresponding cpu avg The calculation formula can be as follows: [1] in, cpu i Refers to the server's first i CPU usage in minutes, 0< i <1441.

[0069] CPU utilization, also known as CPU load or CPU occupancy, is a key metric for measuring computer system performance. It reflects the CPU's activity level, specifically how much computing resources are being consumed by the currently executing task. Higher CPU utilization indicates that the system is processing more tasks or running more complex programs.

[0070] In an optional implementation, the CPU usage rate may be calculated as follows: [(the total duration that the CPU is in a non-idle state at each sampling time point) / total sampling time]×100%.

[0071] For this server, the corresponding mem avg The calculation formula can be as follows: [2] in, mem i Refers to the server's first i Memory usage in minutes, 0< i <1441.

[0072] In an optional implementation, the memory usage may be calculated as: (total memory usage / total available memory)×100%.

[0073] cpu max 、 mem max The calculation formulas are as follows: [3] [4] Step 23: The resource allocation decision platform calculates the average daily CPU usage of each server ( cpu avg ), the average value of memory usage ( mem avg ), calculate the average daily resource usage of each server; The server's resource utilization rate indicates the ratio of resources used by applications running on the server during stable operation to the server's total resources. The server's daily average resource utilization rate indicates the average ratio of resources used by applications running on the server during stable operation to the server's total resources over the course of a day.

[0074] In an optional embodiment, the daily average resource utilization rate RS of each server can be calculated according to the daily average CPU utilization rate and the daily average memory utilization rate of the server according to the following formula: usage : [5] Step 24: The resource allocation decision platform allocates resources based on the maximum value of each server's daily CPU usage ( cpu max ) and the maximum value of memory usage ( mem max ), calculate the average daily resource consumption rate of each server; The average server resource consumption rate indicates the ratio of server resources consumed by applications running on the server under extreme conditions to the total server resources. The daily average server resource consumption rate indicates the ratio of server resources consumed by applications running on the server under extreme conditions to the total server resources over a given day.

[0075] The average daily resource consumption rate RS of each server is obtained by combining the maximum daily CPU usage and the maximum daily memory usage of each server. cost ; [6] Step 25: The resource allocation decision platform collects statistics on the usage of the test servers managed by each demander (business team); In an optional implementation, the specific implementation process of step 25 may include the following sub-steps: The resource allocation decision platform obtains the correspondence between the business team's ID and the IP address of the server to which the business team has been assigned from the Configuration Management Database (CMDB); Based on this correspondence, the resource allocation decision platform determines the IP addresses of all servers that have been allocated to each business team; The resource allocation decision platform calculates the average daily resource usage RS based on the IP addresses of all allocated servers. usage and the average daily resource consumption rate RS cost In the example, determine the RS of all the servers that have been assigned usage and RS cost ; Finally, the resource allocation decision platform will be the business team's ID, the IP address of all servers that have been allocated to each business team, and the RS of all servers that have been allocated. usage and RS cost , and stored in the Mysql database accordingly.

[0076] Step 26: When the resource allocation decision platform receives the server application sent by the demander, it selects an audit policy corresponding to the resource usage according to the resource usage information of the server; audits the server application according to the selected audit policy to obtain the audit result.

[0077] Among them, the server application is equivalent to the resource acquisition request described in Example 1; the audit policy corresponding to the resource usage will include an audit object, and the included audit object is equivalent to the audit object corresponding to the resource usage of the resource described in Example 1.

[0078] The following describes step 26 in detail, taking business team A responsible for "business function verification", business team B responsible for "setting up the stage environment", and business team C responsible for "performance stress testing" as examples.

[0079] 1. Take Business Team A, responsible for "Business Function Verification", as the demander and initiating a server application as an example: Because the server's resource usage is for business function verification, the amount of CPU and memory required is not too large. Therefore, the server historically allocated to the demander can be used as much as possible. Therefore, the audit policy corresponding to this resource usage can include: 1) Server Idle Status Review: Determine whether there are any servers with a daily average resource usage rate or a daily average resource consumption rate of 0 among the servers that have been allocated to the requester in the past 10 days. If the judgment result is that there are servers, the server application will be rejected, and the IP address of the server with a daily average resource usage rate or a daily average resource consumption rate of 0 will be returned to the requester's client. If the judgment result is that there are no servers, the applicant's personnel rank review will be conducted.

[0080] In an optional implementation, the server idleness audit may include the following sub-steps: Sub-step 1: The resource allocation decision platform obtains the requester's ID and the server request sending timestamp from the server request; Sub-step 2: The resource allocation decision platform queries the business team ID stored in the MySQL database and the RS of all servers allocated to each business team based on the demander's ID. usage and RS cost , obtain the RS of all servers that have been allocated to the demand side usage and RS cost ; Sub-step 3: The resource allocation decision platform is based on the sending timestamp and the queried RS usage (or RS cost ), determine whether there is an RS in the server that has been allocated to the demander within the last 10 days up to the sending timestamp. usage (or RS cost ) is 0; if the judgment result is that it exists, the server application is rejected and RS is returned to the client of the demander. usage (or RS cost ) is 0; if the result is that it does not exist, execute sub-step 4: Sub-step 4: Compare the RS of the demander to the allocated server in the last 10 days cost The relationship between the size of the preset consumption rate threshold (for example, 50%), if the RS of each server has been allocatedcost If the RS of each assigned server is greater than 50%, a server configuration compliance audit will be conducted; cost If the percentage is less than or equal to 50%, the applicant’s personnel rank review will be conducted.

[0081] 2) Server configuration compliance review: In a specific example, the resource allocation decision platform can obtain the configuration of the server currently applied for by the demander and the configuration of the server applied for in the past for comparison. If the configuration difference between the two is within 20%, it is determined that the machine configuration applied for by the applicant is compliant, and the server application can be approved; if the configuration difference between the two exceeds 20%, it is determined that the machine configuration applied for by the applicant is not compliant, and the server application can be rejected.

[0082] For example, if the server configuration you previously applied for included 1GB of memory, and the server configuration you are currently applying for includes 2GB of memory, then the memory size difference exceeds 20%, which is a configuration violation.

[0083] 3) Personnel grade review of applicants: For example, if person X from business team A is the applicant and uses the client to submit a server application to the resource allocation decision-making platform, the applicant's rank review can include the following sub-steps: Sub-step 1: Obtain target information from the server application, including Person X's name, role, rank, and the configuration of the server being applied for, and record this target information in the application work order table created for the applicant; The information in the application work order table includes not only the target information mentioned above, but also the number of times the applicant has retried to resend the application to the same server.

[0084] In a specific example, the applicant's "role" may be an ordinary R&D personnel, R&D team leader or director, etc.; the "position level" applied for may be P1 or P2, etc. The larger the number after P, the higher the position level.

[0085] Sub-step ②: If the applicant's role is R&D team leader or director, or their rank is greater than P6, and the number of retries for the server application is less than 2, then the resource allocation decision-making platform can determine that the applicant's personnel rank review has been passed, and thus determine that the server application has been passed. If the applicant's role is an ordinary R&D staff member with a rank below P7, and the number of retries for the server application is greater than 1 - which basically indicates that the applicant does not have sufficient understanding of hardware resource configuration - then the resource allocation decision-making platform can determine that the applicant's personnel rank review has failed, and thus determine that the server application has failed, and thus can reject the server application.

[0086] In particular, if the applicant's role is an ordinary R&D personnel with a job level below P7, and the number of retries of the server application is greater than 1, then the resource allocation decision platform can obtain the identifier of the business team to which the applicant belongs from the server application; based on this identifier, query the pre-set identifiers of each business team and the address of the client of the person in charge of the business team (such as the R&D team leader), and then forward the server application to the client of the person in charge based on the queried address; if a review approval notification is received from the client of the person in charge, the resource allocation decision platform can determine that the server application has been reviewed and approved; if a review failure notification is received from the client of the person in charge, the resource allocation decision platform can determine that the server application has failed the review and can thus reject the server application.

[0087] In an embodiment of the present application, if the server application is approved, the resource allocation decision platform can send the IP address of the server matching the server application and the account and password used to log in to the server to the applicant's client; if the server application is not approved, the resource allocation decision platform can send an application failure notification to the applicant's client.

[0088] 2. Take the example of business team B, who is responsible for "building the stage environment", initiating a server application as the demander: Since the server resource is used to build a stage environment, the demander generally does not reuse the server that has been allocated in the past. Therefore, the audit policy corresponding to this resource usage may include: server configuration compliance audit.

[0089] In a specific example, the resource allocation decision platform can obtain the configuration of the server currently applied for by the demander and the configuration of the server applied for in the past for comparison. If the configuration difference between the two is within 20%, it is determined that the machine configuration applied for by the applicant is compliant, and the server application can be approved; if the configuration difference between the two exceeds 20%, it is determined that the machine configuration applied for by the applicant is not compliant, and the server application can be rejected.

[0090] 3. Take the example of business team C responsible for "performance stress testing" initiating a server application as the demander: Because server resources are used for performance stress testing, their usage time is short, allowing them to be allocated and subsequently reclaimed as quickly as possible. Therefore, the audit policy corresponding to this resource usage can include direct approval. In other words, the resource allocation decision platform can directly approve the server application based on the resource usage being performance stress testing.

[0091] In particular, after the review is passed and the requested server is allocated to the demander, the resource allocation decision platform can also perform a timing operation on the usage time of the server(s) - specifically, the timing can be started after the server's IP address and the account and password used to log in to the server are sent to the applicant's client.

[0092] When the timer reaches the preset usage limit, the resource allocation decision platform reclaims the server(s). For example, the resource allocation decision platform can modify the account and password used to log in to the server to prohibit the demander from logging in to the server, thereby achieving the purpose of reclaiming the server.

[0093] In Example 2, the resource allocation decision platform can also check the resource usage of each business team based on the resource usage ratio. The specific implementation method is as follows: First, the resource allocation decision platform obtains the daily average resource usage RS of all servers allocated to each business team stored in the Mysql database. usage and the average daily resource consumption rate RS cost ; Then, the resource allocation decision platform calculates the average daily resource usage of all servers based on RS usage and the average daily resource consumption rate RS cost , we can calculate the monthly resource utilization rate GRSU and the monthly average resource consumption rate GRSC of each business team:

[0094]

[0095] in, n The total number of servers that have been allocated to a single business team.

[0096] Furthermore, the resource allocation decision platform makes decisions based on the monthly resource utilization rate GRSU and the monthly average resource consumption rate GRSC of each business team, the importance of the business team, and the number of machines managed by the business team. P , get each team's daily resource usage ratio TRSP:

[0097] in, e is the team business coefficient, which can represent the importance of the business team. For example, e The size of the business team is proportional to its importance: the level 1 business team is the most important team, and the corresponding team business coefficient e =130; Level 2 business team is the second most important team, and the corresponding team business coefficient e=115; The third-level business team is a team with lower importance than the first and second-level teams, and the corresponding team business coefficient e =103.

[0098] Finally, the resource allocation decision platform establishes a coordinate system with TRSP as the Y-axis and time as the x-axis, and presents the changing trend of TRSP in this coordinate system. If the TRSP trend is downward within a month, it means that the team's server utilization rate has decreased, and a message is sent to the team leader to remind them that the team's servers are not fully utilized. If the TRSP trend is upward within a month, it means that the team's business activities are relatively frequent, and a message is sent to the team leader to remind them that they can apply for new test machines. If TRSP remains stable, it means that the team's business remains stable and no message is needed. In particular, since the application software deployment in the stage environment is consistent with the production environment, the server configuration details required for the application software to run in the stage environment can be used to infer the number of servers and middleware components, including Elasticsearch, MySQL, Kafka, etc., required to maintain normal operation of the application software in the production environment. Based on this inference, the basic cost of the application software can be estimated, allowing for reasonable market pricing decisions.

[0099] Therefore, in an optional embodiment, when the resource usage includes building a stage environment, the resource allocation decision platform can count the total amount of resources of the target server; and based on the counted total amount of resources, output reference information on the market pricing of the application software.

[0100] The target server is a server allocated to all demanders whose resource usage is to build a pre-release environment for the same application software.

[0101] Example 3 In order to solve the problem in the prior art of how to determine whether the demander can be allocated the resources it requests, based on the same inventive concept as the above embodiments of this application, embodiment 3 of this application provides a resource allocation device.

[0102] The specific structural diagram of the device is shown in the following figure: Figure 3 As shown, it includes the following functional units: An acquisition unit 31 is configured to respond to a resource acquisition request sent by a demander at a first moment and determine a resource usage corresponding to the resource acquisition request; An audit unit 32 is configured to determine an audit object corresponding to the resource usage and audit the audit object; The allocating unit 33 is configured to allocate resources corresponding to the resource acquisition request to the demander if the request is approved.

[0103] In an optional embodiment, if resource usage includes business function verification, the audit objects include any one or more of the following: The resource usage information of the requester in the first time period; the resource usage information includes the resource usage of the requested resource by the requester in the first time period; any time in the first time period is earlier than the first time; the resource configuration corresponding to the resource acquisition request; the personnel rank of the requester; and the number of retries of the resource acquisition request. In an optional embodiment, if the audit object includes the resource usage information of the requester in the first time period, then the audit unit 32 can be specifically used to: In a case where the demander has used the applied resources within the first time period, an average consumption rate of the applied resources is determined; and an audit is performed based on a relationship between the average consumption rate and a consumption rate threshold.

[0104] In an optional implementation, if the audit object further includes the resource configuration corresponding to the resource acquisition request, the personnel rank of the requester, and the number of retries of the resource acquisition request, then the audit unit 32 may be specifically configured to: When the average consumption rate is greater than the consumption rate threshold, if the configuration difference is within a preset difference range, the review is determined to be passed; the configuration difference is the difference between the resource configuration corresponding to the resource acquisition request and the resource configuration of the resource applied for in the first time period; When the average resource consumption rate is less than or equal to the consumption rate threshold, if the personnel rank of the demander is within the preset rank range, and the number of retries is within the preset number of retries, the review is determined to be passed.

[0105] In an optional embodiment, if the resource usage includes performance stress testing, the apparatus provided in the embodiment of the present application may further include a timing recovery unit. This unit is specifically configured to: perform a timing operation on the resource usage corresponding to the resource acquisition request by the requester; and when the duration of the timing operation reaches a preset usage limit, recover the resource corresponding to the resource acquisition request.

[0106] In an optional embodiment, the device provided in the embodiment of the present application may further include: a change trend determining unit, configured to determine the resource usage ratio of the demander based on the resource information of the demander, and determine a change trend of the resource usage ratio of the demander over time; wherein the resource information includes any one or more of the following: the importance of the business corresponding to the demander, the amount of resources allocated to the demander, the resource usage rate and the resource consumption rate of the demander; The sending unit is used to send the change trend to the demander, so that the demander can determine whether to supplement resources based on the change trend.

[0107] Since in the test scenario, the resource usage of the resources required by the demander can largely determine whether the resources are allocated to the demander, in this application, by determining the audit object corresponding to the resource usage, then auditing the audit object, and allocating resources to the demander if the audit is passed, a more reasonable resource allocation scheme is provided, which solves the problem of how to determine whether the demander can be allocated the resources it requests to use, which exists in the prior art.

[0108] Example 4 Based on the same inventive concept as the aforementioned embodiments of the present application, embodiment 4 of the present application provides a computing device to solve the problem existing in the prior art of how to determine whether the demander can be allocated the resources it requests.

[0109] like Figure 4 As shown, the computing device includes: a memory 41 and a processor 42. The memory 41 can 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 the electronic device. The memory 41 can be implemented by any type of volatile or non-volatile storage device or a 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 disk or optical disk.

[0110] The processor 42 is coupled to the memory 41 and is used to execute the computer program stored in the memory 41 to execute a resource allocation method described in Example 1 of the present application.

[0111] When executing the computer program in the memory 41 , the processor 42 can implement other functions in addition to the above functions. For details, please refer to the description of the previous embodiments.

[0112] Further, such as Figure 4As shown, the computing device also includes: a display 44, a communication component 43, a power component 45, an audio component 46 and other components. Figure 4 Only some components are shown schematically, and it does not mean that the computing device only includes Figure 4 Components shown.

[0113] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a computer, can implement the methods provided in the above embodiments.

[0114] Accordingly, an embodiment of the present application further provides a computer program product, which stores instructions. When the instructions are executed by a computer, the computer implements the methods provided in the above embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0115] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A resource allocation method, characterized in that: include: In response to a resource acquisition request sent by a demander at a first moment, determining a resource usage corresponding to the resource acquisition request; Determine the audit object corresponding to the resource usage, and audit the audit object; If the review is passed, the resources corresponding to the resource acquisition request are allocated to the demander.

2. The method according to claim 1, wherein The resource usage includes business function verification; the audit objects include any one or more of the following: Resource usage information of the requester in the first time period; the resource usage information includes the usage of the resources requested by the requester 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; The rank of the person on the requesting party; The number of retries for the resource acquisition request.

3. The method according to claim 2, wherein The audit object includes resource usage information of the demander within a first time period; and the auditing of the audit object includes: determining an average consumption rate of the requested resources if the requester has used the requested resources within the first time period; The review is performed based on the relationship between the average consumption rate and the consumption rate threshold.

4. The method according to claim 3, wherein The audit object also includes the resource configuration corresponding to the resource acquisition request, the personnel rank of the requester, and the number of retries of the resource acquisition request; The reviewing based on the relationship between the average consumption rate and the consumption rate threshold includes: In the case where the average consumption rate is greater than the consumption rate threshold, if the configuration difference is within the preset difference range, then the review is determined to be passed; The configuration difference is the difference between the resource configuration corresponding to the resource acquisition request and the resource configuration of the resources applied for in the first time period; When the average resource consumption rate is less than or equal to the consumption rate threshold, if the personnel rank of the demander is within the preset rank range, and the number of retries is within the preset number of retries, the review is determined to be passed.

5. The method according to any one of claims 1 to 4, characterized in that The resource usage includes performance stress testing; if the review is passed, after allocating resources corresponding to the resource acquisition request to the demander, the method further includes: Performing a timing operation on the use of the resource corresponding to the resource acquisition request by the demander; When the duration of the timing operation reaches a preset usage limit duration, the resources corresponding to the resource acquisition request are reclaimed.

6. The method according to claim 1, wherein The method further comprises: Determining a resource usage ratio of the demander based on the resource information of the demander, and determining a change trend of the resource usage ratio of the demander over time; wherein the resource information includes any one or more of the following: the importance of the business corresponding to the demander, the amount of resources allocated to the demander, the resource usage rate and the resource consumption rate of the demander; The change trend is sent to the demander, so that the demander determines whether resources need to be supplemented based on the change trend.

7. A resource allocation device, characterized in that: include: an acquisition unit, configured to respond to a resource acquisition request sent by a demander at a first moment and determine a resource usage corresponding to the resource acquisition request; An audit unit, configured to determine an audit object corresponding to the resource usage and audit the audit object; The allocation unit is configured to allocate resources corresponding to the resource acquisition request to the demander if the request is approved.

8. A computing device, characterized in that include: Memory and processor, wherein The memory is used to store computer programs; The processor is coupled to the memory and is configured to execute the computer program stored in the memory to perform the method according to any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a computer, implements the method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The computer program product stores instructions, which, when executed by a computer, enable the computer to implement the method according to any one of claims 1 to 6.

Citation Information

Cited By

  • User personal resource management method and device, storage medium and program product

    CN121168506A

  • Method, device, storage medium and program product for managing user personal resources

    CN121168506B