Resource adjustment method and device, storage medium and program product
Patent Information
- Application Number
- CN202210912159.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2042-07-29
AI Technical Summary
但是,当这种方法应用在云原生模式时,由于云原生模式下的集群资源共享,单个集群服务的业务量可能有几十甚至上百,如果所有业务的服务质量均采用传统的方法进行保障,那么在业务突发时,由于需要获得业务层所反馈的质量数据才能对应调整资源的权重,因此难以实现资源的快速扩容,从而难以保障业务的服务质量
[0057] The embodiments of the present invention include at least the following beneficial effects: In response to receiving a service request, the resource load index values of each current resource are obtained. All resources are categorized according to all resource load index values to obtain multiple candidate resource sets. Then, the set with the largest number of resources among the multiple candidate resource sets is determined as the target resource set. The set load index value of the target resource set is calculated based on the resource load index values of all resources in the target resource set. Next, the set load index value is compared with the resource load threshold corresponding to the service request to obtain a comparison result. When the comparison result shows that the set load index value is greater than the resource load threshold, resource expansion is performed. In other words, there is no need to wait for quality data feedback from the service layer. The resource layer can determine whether resource expansion is needed based on the comparison result between the set load index value and the resource load threshold corresponding to the service request. Therefore, even with a large volume of business or a sudden business surge, rapid dynamic expansion of resources can be achieved, thereby ensuring the service quality of the business.
Smart Images

Figure CN117527819B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud computing technology, and in particular to a resource adjustment method and apparatus, storage medium, and program product. Background Technology
[0002] With the development of cloud computing, cloud-native resource operation has become mainstream. To ensure service quality, the traditional approach involves collaboration between the business layer and the resource layer, adjusting resource weights based on quality data feedback from the business layer. However, when this approach is applied to cloud-native models, due to the shared resources within clusters, a single cluster may handle tens or even hundreds of services. If all service quality is guaranteed using traditional methods, rapid resource scaling becomes difficult during business surges because it requires quality data from the business layer to adjust resource weights, thus hindering the guarantee of service quality. Summary of the Invention
[0003] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.
[0004] This invention provides a resource adjustment method, apparatus, storage medium, and program product that can achieve rapid and dynamic expansion of resources, thereby ensuring the quality of service.
[0005] On one hand, embodiments of the present invention provide a resource adjustment method, including the following steps:
[0006] In response to a received business request, obtain the current resource load index values for each resource;
[0007] All resources are categorized based on all the resource load index values to obtain multiple candidate resource sets;
[0008] Among the multiple candidate resource sets, the one with the largest number of the stated resources is determined as the target resource set;
[0009] The set load index value of the target resource set is calculated based on the resource load index values of all the resources in the target resource set.
[0010] The set load index value is compared with the resource load threshold corresponding to the service request to obtain the comparison result;
[0011] When the comparison result shows that the set load index value is greater than the resource load threshold, resource expansion is performed.
[0012] On the other hand, embodiments of the present invention also provide a resource adjustment device, including:
[0013] The indicator acquisition unit is used to obtain the current resource load indicator values of each resource in response to a received business request.
[0014] The resource classification unit is used to classify all the resources according to all the resource load index values to obtain multiple candidate resource sets;
[0015] The set determination unit is used to determine the set with the largest number of the resources among the multiple candidate resource sets as the target resource set;
[0016] The index calculation unit is used to calculate the set load index value of the target resource set based on the resource load index values of all the resources in the target resource set.
[0017] The indicator comparison unit is used to compare the set load indicator value with the resource load threshold corresponding to the service request to obtain the comparison result;
[0018] The resource expansion unit is used to expand resources when the comparison result shows that the set load index value is greater than the resource load threshold.
[0019] Optionally, the resource classification unit is further configured to:
[0020] Determine the classification threshold;
[0021] All resources are classified according to the classification threshold and all the resource load index values to obtain multiple candidate resource sets.
[0022] Optionally, the resource classification unit is further configured to:
[0023] All the resource load index values are normally distributed;
[0024] The classification threshold is determined based on the normal distribution.
[0025] Optionally, the index calculation unit is further configured to:
[0026] Calculate the average value of the resource load index for all resources in the target resource set;
[0027] The mean value is used as the set load index value of the target resource set.
[0028] Optionally, the set determination unit is further configured to redetermine a new target resource set based on all the resources after resource expansion;
[0029] The index calculation unit is also used to calculate a new set load index value for the new target resource set based on the resource load index values of all the resources in the new target resource set.
[0030] The indicator comparison unit is also used to compare the new set load indicator value with the resource load threshold to obtain a new comparison result;
[0031] The resource expansion unit is further configured to continue resource expansion when the new comparison result is that the new set load index value is greater than the resource load threshold, until the new set load index value is less than the resource load threshold.
[0032] Optionally, the set determination unit is further configured to:
[0033] All the resources after resource expansion are reclassified to obtain multiple new candidate resource sets;
[0034] Among the multiple new candidate resource sets, the one with the largest number of the stated resources is determined as the new target resource set.
[0035] Optionally, the plurality of candidate resource sets further includes a low-load resource set and a high-load resource set; the resource adjustment device further includes:
[0036] A resource adjustment unit is used to adjust the resources of the low-load resource set and the high-load resource set when the comparison result is that the set load index value is less than or equal to the resource load threshold, thereby increasing the resource quantity of the target resource set.
[0037] A business processing unit is used to process the business request using the resources in the target resource set after the resource quantity has been increased.
[0038] Optionally, the resource adjustment unit is further configured to:
[0039] Migrate at least one of the resources in the low-load resource set to the target resource set;
[0040] Migrate at least one of the resources in the high-load resource set to the target resource set.
[0041] Optionally, the resource includes different types of sub-resources; the indicator acquisition unit is further configured to:
[0042] Obtain the load information of each of the sub-resources in each of the current resources;
[0043] Based on the load information of each of the sub-resources in each of the current resources, the resource load index value of each of the current resources is obtained.
[0044] Optionally, the sub-resources include memory resources and non-memory resources; the indicator acquisition unit is further configured to:
[0045] Among the current resources, the resource whose load information exceeds a preset load threshold is designated as the first target resource, and the resource whose load information does not exceed the preset load threshold is designated as the second target resource.
[0046] For the first target resource, a preset index value is used as the resource load index value of the first target resource;
[0047] For the second target resource, the resource load index value of the second target resource is calculated based on the load information of the memory resource and the load information of the non-memory resource.
[0048] Optionally, the indicator acquisition unit is further configured to:
[0049] Determine the proportion of the first indicator corresponding to the memory resources and the proportion of the second indicator corresponding to the non-memory resources;
[0050] The resource load index value of the second target resource is calculated based on the load information of the memory resources, the load information of the non-memory resources, the first index ratio, and the second index ratio.
[0051] On the other hand, embodiments of the present invention also provide a resource adjustment device, including:
[0052] At least one processor;
[0053] At least one memory for storing at least one program;
[0054] The resource adjustment method described above is implemented when at least one of the programs is executed by at least one of the processors.
[0055] On the other hand, embodiments of the present invention also provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to implement the resource adjustment method as described above.
[0056] On the other hand, embodiments of the present invention also provide a computer program product, including a computer program or computer instructions, the computer program or computer instructions being stored in a computer-readable storage medium, a processor of a computer device reading the computer program or computer instructions from the computer-readable storage medium, and the processor executing the computer program or computer instructions to cause the computer device to perform the resource adjustment method as described above.
[0057] The embodiments of the present invention include at least the following beneficial effects: In response to receiving a service request, the resource load index values of each current resource are obtained. All resources are categorized according to all resource load index values to obtain multiple candidate resource sets. Then, the set with the largest number of resources among the multiple candidate resource sets is determined as the target resource set. The set load index value of the target resource set is calculated based on the resource load index values of all resources in the target resource set. Next, the set load index value is compared with the resource load threshold corresponding to the service request to obtain a comparison result. When the comparison result shows that the set load index value is greater than the resource load threshold, resource expansion is performed. In other words, there is no need to wait for quality data feedback from the service layer. The resource layer can determine whether resource expansion is needed based on the comparison result between the set load index value and the resource load threshold corresponding to the service request. Therefore, even with a large volume of business or a sudden business surge, rapid dynamic expansion of resources can be achieved, thereby ensuring the service quality of the business.
[0058] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the description, claims, and drawings. Attached Figure Description
[0059] The accompanying drawings are provided to further understand the technical solutions of the present invention and constitute a part of the specification. They are used together with the embodiments of the present invention to explain the technical solutions of the present invention, and do not constitute a limitation on the technical solutions of the present invention.
[0060] Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of the present invention;
[0061] Figure 2 This is a schematic diagram of another implementation environment provided by an embodiment of the present invention;
[0062] Figure 3 This is a flowchart of a resource adjustment method provided in an embodiment of the present invention;
[0063] Figure 4 This is a schematic diagram of the system architecture for performing a resource adjustment method provided in an embodiment of the present invention;
[0064] Figure 5 This is a flowchart illustrating the principle of container resource regeneration triggered by resource analysis, provided in an embodiment of the present invention.
[0065] Figure 6 This is a schematic diagram of a resource adjustment device provided in an embodiment of the present invention;
[0066] Figure 7 This is a schematic diagram of another resource adjustment device provided in an embodiment of the present invention. Detailed Implementation
[0067] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. The described embodiments should not be considered as limitations on the present invention, and all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present invention.
[0068] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0069] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the scope of the invention.
[0070] Before providing a further detailed description of the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention will be explained, and the nouns and terms involved in the embodiments of the present invention shall be interpreted as follows.
[0071] 1) Kubernetes (or K8s for short) is an open-source container orchestration engine used to manage containerized applications across multiple hosts in a cloud platform. Kubernetes supports automated deployment, large-scale scalability, and containerized application management. In Kubernetes, multiple containers can be created, each running an application instance. Through built-in load balancing strategies, the management, discovery, and access to the application instance can be automatically achieved, without requiring complex manual configuration and processing by operations personnel.
[0072] 2) Containers are a technology used to bundle an application and all its necessary files into a single runtime environment. Containers can be easily moved and run on any operating system in any environment. Containers isolate software, allowing it to run independently across different operating systems, hardware, networks, storage systems, and security policies. Furthermore, containers do not contain an operating system, therefore they require minimal computing resources, have a very small footprint, and are easy to install.
[0073] 3) Docker is an open-source application container engine that bundles an application and all its necessary files into a portable container, allowing it to be deployed on any operating system. Docker uses a client-server architecture and can be managed and created using a remote application programming interface (API).
[0074] 4) Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, e-commerce platforms, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing.
[0075] 5) Cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. The network providing these resources is called the "cloud." From the user's perspective, the resources in the "cloud" are infinitely scalable, readily available, on-demand, expandable, and pay-as-you-go. As a provider of basic cloud computing capabilities, a cloud resource pool (referred to as a cloud platform, generally called an IaaS (Infrastructure as a Service) platform) is established, deploying various types of virtual resources within the pool for external customers to choose from. The cloud resource pool mainly includes: computing devices (virtualized machines containing operating systems), storage devices, and network devices. Logically, a PaaS (Platform as a Service) layer can be deployed on top of the IaaS layer, and a SaaS (Software as a Service) layer can be deployed on top of the PaaS layer. Alternatively, SaaS can be directly deployed on top of IaaS. PaaS is a platform for running software, such as databases and web containers. SaaS encompasses various types of business software, such as web portals and bulk SMS messaging tools. Generally speaking, SaaS and PaaS are upper-layered compared to IaaS.
[0076] 6) Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying platform, a platform product service layer, and an application service layer. Blockchains can include public blockchains, consortium blockchains, and private blockchains. A public blockchain is one where anyone can access the blockchain network at any time to read data, send data, or compete for ledger entries; a consortium blockchain is one jointly managed by several organizations or institutions; a private blockchain is one with a degree of centralized control, where the right to write to the ledger is controlled by a specific organization or institution, and data access and use are subject to strict permission management.
[0077] 7) Intelligent Traffic System (ITS), also known as Intelligent Transportation System, effectively integrates advanced science and technology (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) into transportation, service control, and vehicle manufacturing, strengthening the connection between vehicles, roads, and users, thereby forming a comprehensive transportation system that ensures safety, improves efficiency, improves the environment, and saves energy.
[0078] 8) Intelligent Vehicle Infrastructure Cooperative Systems (IVICS), or vehicle-road cooperative systems for short, represent a development direction for Intelligent Transportation Systems (ITS). IVICS utilizes advanced wireless communication and next-generation Internet technologies to implement comprehensive, real-time dynamic information exchange between vehicles and infrastructure. Based on the collection and fusion of dynamic traffic information across all times and spaces, it conducts active vehicle safety control and cooperative road management, fully realizing effective collaboration between people, vehicles, and roads. This ensures traffic safety, improves traffic efficiency, and ultimately forms a safe, efficient, and environmentally friendly road traffic system.
[0079] With the development of cloud computing, the cloud-native Kubernetes-based container scheduling model has become a fundamental resource delivery method for cloud computing. However, while Kubernetes-produced containers are running services, different container resources handle different business requests, resulting in varying resource processing weights. This can easily lead to a mismatch between resources and business requests, thus affecting service quality. To address this issue, the traditional approach is to passively adjust resource processing weights based on service quality feedback to match resources with business requests. Specifically, this involves collaboration between the business layer and the resource layer, adjusting resource weights based on quality data feedback from the business layer. However, when this method is applied to cloud-native models, due to the shared resources within clusters, a single cluster may handle tens or even hundreds of business requests. If the service quality of all services is guaranteed using traditional methods, then during business surges, rapid resource scaling becomes difficult because it requires quality data feedback from the business layer to adjust resource weights accordingly. This hinders the ability to guarantee service quality. In response to sudden business disruptions, some technologies offer the method of performing lossy operations at the business layer. This involves discarding some business requests to ensure the remaining requests can be processed normally, thus maintaining overall system stability even when rapid resource scaling is not feasible. However, this method sacrifices some business requests, impacting the user experience for some users.
[0080] To enable rapid and dynamic resource expansion to ensure service quality, this invention provides a resource adjustment method, a resource adjustment device, a computer-readable storage medium, and a computer program product. In response to a received service request, the method acquires the resource load index values of each resource, categorizes all resources based on these values to obtain multiple candidate resource sets, selects the set with the most resources as the target resource set, calculates the set load index value based on the resource load index values of all resources in the target resource set, and compares the set load index value with the resource load threshold corresponding to the service request. If the comparison result shows that the set load index value is greater than the resource load threshold, resource expansion is performed. In other words, the solution provided by this invention eliminates the need to wait for quality data feedback from the service layer. The resource layer can determine whether resource expansion is necessary based on the comparison result between the set load index value and the resource load threshold corresponding to the service request. Therefore, even with high service volume or sudden service spikes, rapid and dynamic resource expansion can be achieved, thereby ensuring service quality.
[0081] The solutions provided in the embodiments of the present invention involve technologies such as cloud computing, resource management, and automatic resource expansion, and are specifically described through the following embodiments.
[0082] Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of the present invention. (Refer to...) Figure 1 The implementation environment includes a server 101 and a terminal 102, which are directly or indirectly connected via wired or wireless communication. The server 101 and terminal 102 can be nodes in a blockchain, but this embodiment does not specifically limit their presence.
[0083] Server 101 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0084] Server 101 may integrate resource adjustment functions, or server 101 may be equipped with a resource adjustment device for implementing resource adjustment functions.
[0085] Server 101 has at least the following functions: classifying resources, calculating the set load index value of the target resource set, and determining whether to expand resources based on the set load index value of the target resource set. For example, when a business request is received, it can obtain the resource load index value of each resource, classify all resources according to all resource load index values to obtain multiple candidate resource sets, and then determine the one with the most resources in these candidate resource sets as the target resource set. Then, based on the resource load index values of all resources in the target resource set, it calculates the set load index value of the target resource set. Next, it compares the set load index value with the resource load threshold corresponding to the business request. When the comparison result is that the set load index value is greater than the resource load threshold, it determines to expand resources.
[0086] Terminal 102 may include, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, smart wearable devices, etc. Optionally, terminal 102 may have an application client installed. When a user performs a business operation in the application client, terminal 102 will send a business request to server 101 through the application client. After server 101 completes the business operation according to the business request, terminal 102 will receive and display the business operation result returned by server 101.
[0087] Reference Figure 2 As shown, in one application scenario, when a user performs multimedia operations such as video transcoding or image compression through the application client of terminal 102, terminal 102 sends a corresponding service request to server 101 through the application client. In response to receiving the service request from terminal 102, server 101 obtains the resource load index values of each resource and categorizes all resources according to these values, resulting in multiple candidate resource sets. Then, among these candidate resource sets, the one with the most resources is determined as the target resource set. Next, based on the resource load index values of all resources in the target resource set, the server calculates... The server 101 obtains the set load index value of the target resource set and compares it with the resource load threshold corresponding to the business request. When the comparison result shows that the set load index value is greater than the resource load threshold, the server 101 expands the resources until the expanded resources can meet the needs of the business request. At this time, the server 101 uses the expanded resources to process the business request and obtains the business operation result. After obtaining the business operation result, the server 101 sends the business operation result to the terminal 102. In response to receiving the business operation result sent by the server 101, the terminal 102 displays the business operation result.
[0088] It should be noted that in various specific embodiments of the present invention, when processing data related to the characteristics of a target object (such as a user) or a set of attribute information is required, the target object's permission or consent will be obtained first. Furthermore, the collection, use, and processing of this data will comply with relevant laws, regulations, and standards of the relevant countries and regions. In addition, when embodiments of the present invention need to obtain the target object's attribute information, separate permission or consent from the target object will be obtained through pop-ups or redirection to a confirmation page. Only after obtaining the target object's separate permission or consent will the necessary target object-related data for the normal operation of the embodiments of the present invention be obtained.
[0089] Figure 3 This is a flowchart of a resource adjustment method provided in an embodiment of the present invention. In this embodiment, a server is used as the execution subject for illustration. (Refer to...) Figure 3 The resource adjustment method includes, but is not limited to, steps 110 to 160.
[0090] Step 110: In response to receiving a business request, obtain the current resource load index values of each resource.
[0091] The resources in this step can be container resources or other types of resources; no specific limitation is made here. In this step, when the server receives a business request, to ensure the quality of service for that request, the server will first assess the current resource situation to determine whether the current resources can meet the resource requirements of the business request. When assessing the current resource situation, the server can first obtain the resource load index values of each resource so that subsequent steps can determine whether the current resources can meet the resource requirements of the business request based on these resource load index values. The resource load index value is used to characterize the resource utilization level. The resource load index value can be calculated based on the resource load information, which refers to the resource's load usage data. For example, assuming the resources include Central Processing Unit (CPU) resources, then the resource load information includes the CPU resource utilization rate. It should be noted that a larger resource load index value indicates a higher utilization level of the corresponding resource, and a smaller resource load index value indicates a lower utilization level of the corresponding resource.
[0092] In some possible implementations, the service request can be initiated by the terminal communicating with the server, or it can be initiated by the server itself; no specific limitation is made here. For example, when a user performs multimedia service processing such as video transcoding or image compression on the terminal, the terminal will initiate a service request corresponding to that multimedia service processing to the server; similarly, when the server performs data cleaning on model training data or serializes data required for big data computation, the server itself will initiate the corresponding service request.
[0093] In some possible implementations, each resource may include different types of sub-resources, such as CPU resources, memory resources, and disk resources. In this case, when obtaining the resource load index value of each current resource, the load information of each sub-resource within each current resource can be obtained first, and then the resource load index value of each current resource can be obtained based on the load information of each sub-resource within each current resource. There are different implementations for obtaining the resource load index value of each current resource based on the load information of each sub-resource within each current resource, and no specific limitation is made here. For example, the sum of the load information of all sub-resources within each resource can be used as the resource load index value of each resource; alternatively, the load information of all sub-resources within each resource can be weighted and summed, and the result of the weighted summation can be used as the resource load index value of each resource; still another option is to input the load information of all sub-resources within each resource into a pre-trained load index prediction model to predict the load index and obtain the resource load index value of each resource. The load index prediction model can be composed of a deep neural network model or a convolutional neural network model, etc.
[0094] In some possible implementations, when the sub-resources include memory resources and non-memory resources (such as CPU resources or disk resources), when obtaining the resource load index value of each current resource based on the load information of each sub-resource, the resources whose memory resource load information exceeds a preset load threshold can be designated as first target resources, and the resources whose memory resource load information does not exceed the preset load threshold can be designated as second target resources. Then, for the first target resource, the preset index value can be used as its resource load index value. For the second target resource, its resource load index value can be calculated based on the memory resource load information and the non-memory resource load information. It should be noted that during program execution, the data to be processed needs to be stored in memory first, and then the CPU retrieves the required data from memory for processing to ensure the program runs normally. Therefore, memory resources are crucial for ensuring the normal operation of the program. If the memory resource load information exceeds the preset load threshold, it indicates that the current resource load is high and cannot meet the resource requirements of the business request; if the memory resource load information does not exceed the preset load threshold, it indicates that the current resource load is low and can meet the resource requirements of the business request. In other words, resources whose memory load exceeds a preset load threshold cannot be used to handle the service request, while resources whose memory load does not exceed the preset load threshold can be used. Therefore, resources with memory load exceeding the preset load threshold can be designated as the first target resource, and those with memory load not exceeding the preset load threshold can be designated as the second target resource. This allows for differentiation between resources and facilitates the management of different resources. Furthermore, for the first target resource, since it cannot be used to handle the service request, a preset index value can be used as its resource load index value to indicate that the first target resource is under high load and its resource weight cannot be adjusted to support the service request. For the second target resource, since it can be used to handle the service request, its resource load index value can be calculated based on both memory resource load information and non-memory resource load information. It should be noted that the specific values of the preset load threshold and preset indicator value can be appropriately selected according to the actual application situation, and no specific limitation is made here. For example, the preset load threshold can be set to 80% or 90%, while the preset indicator value can be set to 100.
[0095] In some possible implementations, when calculating the resource load index value of the second target resource based on the load information of memory resources and non-memory resources, the first index ratio corresponding to memory resources and the second index ratio corresponding to non-memory resources can be determined first. Then, based on the load information of memory resources, the load information of non-memory resources, the first index ratio, and the second index ratio, the resource load index value of the second target resource can be calculated. Here, the first index ratio is the weight ratio of memory resources in the resource load index value, and the second index ratio is the weight ratio of non-memory resources in the resource load index value. Depending on the actual application scenario, both the first index ratio and the second index ratio can have different values, which are not specifically limited here. After determining the first and second indicator ratios, the resource load index value of the second target resource can be calculated based on the load information of memory resources, the load information of non-memory resources, the first indicator ratio, and the second indicator ratio. For example, the load information of memory resources can be multiplied by the first indicator ratio to obtain the contribution of memory resources to the resource load index value, and the load information of non-memory resources can be multiplied by the second indicator ratio to obtain the contribution of non-memory resources to the resource load index value. Then, the contribution of memory resources to the resource load index value and the contribution of non-memory resources to the resource load index value are added together to obtain the resource load index value of the second target resource. Alternatively, the load information of memory resources, the load information of non-memory resources, the first indicator ratio, and the second indicator ratio can be input into a preset calculation formula to calculate the resource load index value of the second target resource. It should be noted that when non-memory resources include multiple types of resources, there will be multiple second indicator ratios, and these multiple second indicator ratios may be the same or different. For example, if non-memory resources include CPU resources and disk resources, then there are two second indicator ratios, and the second indicator ratio of CPU resources can be 50%, while the second indicator ratio of disk resources can be 20%.
[0096] The following example illustrates in detail the process of obtaining resource load index values.
[0097] Assuming all resources include CPU, memory, and disk resources, we iterate through each resource and determine if the CPU utilization exceeds a preset load threshold. If the CPU utilization exceeds the threshold, there's no need to further check memory and disk utilization; the resource load metric for this resource can be set to 100, indicating high utilization and inability to meet business resource demands. If the CPU utilization does not exceed the preset threshold, the resource load metric is calculated using the following formula:
[0098] Score = N% * C + K% * M + P% * D
[0099] Wherein, Score represents the resource load metric, C represents the CPU resource utilization rate, N% represents the percentage of CPU resources corresponding to this metric, M represents the memory resource utilization rate, K% represents the percentage of memory resources corresponding to this metric, D represents the disk resource utilization rate, and P% represents the percentage of disk resources corresponding to this metric. It should be noted that since CPU resources are more sensitive to the resource requirements of business requests, N% > K% > P%, and N% + K% + P% = 100%. For example, in some embodiments, N% can be set to 50%, K% to 30%, and P% to 20%.
[0100] Furthermore, after obtaining the resource load index values for each resource, the resource acquisition time and the resource device identifier corresponding to the resource can be used as indexes to create a resource data table for storage in the database. This facilitates resource management in subsequent steps. The resource data table can be shown in Table 1 below:
[0101] Table 1
[0102]
[0103] After obtaining the resource load index values of each resource and constructing a resource data table stored in the database based on the resource load index values of each resource, the resource load index values of each resource at different times can be easily obtained from the resource data table, and the load information of each sub-resource in each resource can also be easily obtained.
[0104] Step 120: Classify all resources according to all resource load index values to obtain multiple candidate resource sets.
[0105] In this step, since the resource load index values of each resource are obtained in step 110, all resources can be classified according to all resource load index values to obtain multiple candidate resource sets, so that subsequent steps can determine the target resource set for judging whether resource expansion is needed based on these candidate resource sets.
[0106] In some possible implementations, when classifying all resources based on all resource load index values, the classification can be done by calculating similarity, by distributing resources according to data, or by using other different data processing methods; no specific limitation is made here. For example, when classifying all resources by calculating similarity, the similarity between each resource load index value can be calculated first, such as Euclidean distance, Pearson correlation coefficient, cosine similarity, etc., and then all resources can be classified based on the calculated similarity. Alternatively, when classifying all resources by distributing resources according to data, all resource load index values can be first distributed normally, and then all resources can be classified based on the normal distribution.
[0107] In some possible implementations, when classifying all resources based on all resource load index values to obtain multiple candidate resource sets, a classification threshold value can be determined first. Then, all resources are classified according to the classification threshold value and all resource load index values to obtain multiple candidate resource sets. The classification threshold value is a boundary value used to classify resource load index values. In some embodiments, the classification threshold value can be determined based on prior knowledge, or it can be determined based on the results of data processing on all resource load index values; no specific limitation is made here. When determining the classification threshold value based on the results of data processing, all resource load index values can first be normally distributed, and then the classification threshold value can be determined based on the normal distribution. For example, all resource load index values can be arranged from largest to smallest or smallest to largest to obtain a sequence of resource load index values. Then, a normal distribution can be performed based on this sequence of resource load index values. In this case, the classification threshold value can be determined based on the normally distributed resource load index values. After determining the classification thresholds, all resources can be classified according to these thresholds and all resource load index values to obtain multiple candidate resource sets. In some embodiments, assuming the resource load index values follow a normal distribution, then, based on the characteristics of the normal distribution, the normally distributed resource load index values can be divided into three segments. That is, two classification thresholds can be determined based on the normally distributed resource load index values. After classifying all resources according to these two classification thresholds and all resource load index values, three candidate resource sets can be obtained. In these three candidate resource sets, the number of resources in the middle set is relatively large, while the number of resources in the sets on either side of the middle set is relatively small. These three candidate resource sets can be defined as low-load, medium-load, and high-load resource sets. In the low-load resource set, resources are currently handling fewer business requests; therefore, increasing the resource weight of resources in this set can improve their processing capacity. Resources in the medium-load resource set handle the majority of current business requests. Resources in the high-load resource set are currently handling a large number of business requests, indicating high-load processing; therefore, decreasing the resource weight of resources in this set can reduce their processing capacity. By adjusting the resources in these three candidate sets, the load utilization of each resource can be effectively balanced, ensuring the quality of service.
[0108] Step 130: Among multiple candidate resource sets, the one with the largest number of resources is determined as the target resource set.
[0109] In this step, since multiple candidate resource sets were obtained in step 120, the one with the largest number of resources can be determined as the target resource set. Since the target resource set has the largest number of resources among the multiple candidate resource sets, the resources in the target resource set carry most of the current business requests. Based on the total load utilization of the target resource set, it is possible to accurately determine whether the current resources can meet the resource requirements of the current business requests. Therefore, determining the target resource set from these multiple candidate resource sets first is beneficial for subsequent steps to determine whether resource expansion is needed to meet the resource requirements of the current business requests based on the target resource set.
[0110] Step 140: Calculate the set load index value of the target resource set based on the resource load index values of all resources in the target resource set.
[0111] In this step, since the target resource set was determined in step 130, and the resources in the target resource set carry most of the current business requests, the set load index value of the target resource set can be calculated based on the resource load index values of all resources in the target resource set. This allows subsequent steps to determine whether resource expansion is needed based on the set load index value of the target resource set.
[0112] In some possible implementations, there can be multiple calculation methods when calculating the set load index value of the target resource set based on the resource load index values of all resources in the target resource set, and no specific limitation is made here. For example, the sum of the resource load index values of all resources in the target resource set can be used as the set load index value of the target resource set; or, the average of the resource load index values of all resources in the target resource set can be calculated first, and then the average can be used as the set load index value of the target resource set.
[0113] Step 150: Compare the aggregate load metric values with the resource load thresholds corresponding to the business requests to obtain the comparison results.
[0114] In this step, since the set load index value of the target resource set was calculated in step 140, and the set load index value can characterize the total load utilization of the target resource set, the set load index value can be compared with the resource load threshold corresponding to the business request to obtain the comparison result, so that subsequent steps can determine whether resource expansion is needed based on the comparison result.
[0115] It should be noted that the resource load threshold represents the minimum resource requirement corresponding to a business request. If the set load index value of the target resource set is less than or equal to the resource load threshold, that is, the resources in the target resource set can meet the minimum resource requirement corresponding to the business request, then the business request can be considered to be processed normally. If the set load index value of the target resource set is greater than the resource load threshold, that is, the resources in the target resource set cannot meet the minimum resource requirement corresponding to the business request, then the business request cannot be processed normally.
[0116] Step 160: When the comparison result shows that the set load index value is greater than the resource load threshold, resource expansion is performed.
[0117] In this step, since the comparison result between the set load metric value and the resource load threshold corresponding to the business request was obtained in step 150, it can be determined whether resource expansion is needed based on this comparison result. Specifically, if the comparison result shows that the set load metric value is greater than the resource load threshold, it indicates that the resources in the target resource set cannot meet the minimum resource requirements corresponding to the business request, and the normal processing of the business request cannot be achieved. Therefore, resource expansion can be performed so that the expanded resources can meet the minimum resource requirements corresponding to the business request. In some embodiments, when the resources are container resources, Kubernetes can be used to produce new container resources for resource expansion.
[0118] In this embodiment, the resource adjustment method, including steps 110 to 160, obtains the resource load index values of each resource in response to a received service request. Based on these resource load index values, all resources are categorized into multiple candidate resource sets. The set with the largest number of resources is then selected as the target resource set. The set load index value is calculated based on the resource load index values of all resources in the target resource set. This set load index value is then compared with the resource load threshold corresponding to the service request. If the comparison result shows that the set load index value is greater than the resource load threshold, resource expansion is performed. In other words, in this embodiment, there is no need to wait for quality data feedback from the service layer. The resource layer can determine whether resource expansion is necessary based on the comparison result between the set load index value and the resource load threshold corresponding to the service request. Therefore, even with high service volume or sudden service spikes, rapid dynamic resource expansion can be achieved, ensuring service quality.
[0119] In some possible implementations, after resource expansion, the expanded resources may change the original resource structure. In order to accurately determine whether the expanded resources can meet the resource requirements corresponding to the business request, the resource adjustment method may also include, but is not limited to, the following steps:
[0120] First, a new target resource set is determined based on all the resources after resource expansion. Then, a new set load index value is calculated based on the resource load index values of all resources in the new target resource set. Next, the new set load index value is compared with the resource load threshold to obtain a new comparison result. When the new comparison result shows that the new set load index value is greater than the resource load threshold, resource expansion continues until the new set load index value is less than the resource load threshold.
[0121] In some possible implementations, when redetermining the new target resource set based on all expanded resources, all expanded resources can first be reclassified to obtain multiple new candidate resource sets. Then, among these multiple new candidate resource sets, the one with the largest number of resources is determined as the new target resource set. It should be noted that the expanded resources may change the structure of the original target resource set, therefore, a new target resource set needs to be determined. Then, based on the new set load index value of the new target resource set, it is determined whether the expanded resources can meet the resource requirements corresponding to the business request.
[0122] In some possible implementations, when the candidate resource set also includes a low-load resource set and a high-load resource set—that is, when the candidate resource set includes a low-load resource set, a high-load resource set, and the aforementioned target resource set (i.e., the aforementioned intermediate-load resource set)—when comparing the set load index value with the resource load threshold corresponding to the business request, if the comparison result shows that the set load index value is less than or equal to the resource load threshold, it indicates that the resources in the target resource set can meet the resource requirements corresponding to the business request, and therefore resource expansion is not necessary. In this case, to further ensure that the resources in the target resource set can meet the resource requirements corresponding to the business request, resource adjustments can be made to the low-load and high-load resource sets to increase the number of resources in the target resource set. The increased resources in the target resource set are then used to process the business request. Specifically, during the resource adjustment process, at least one resource from the low-load resource set and at least one resource from the high-load resource set can be migrated to the target resource set, thereby increasing the number of resources in the target resource set and ensuring that the resources in the target resource set can meet the resource requirements corresponding to the business request. In some embodiments, the resource load index value of resources in the low-load resource set can be increased by adjusting the index ratio corresponding to the resources in the low-load resource set (e.g., the first index ratio corresponding to memory resources and the second index ratio corresponding to non-memory resources), thereby achieving the purpose of migrating resources in the low-load resource set to the target resource set. Similarly, the resource load index value of resources in the high-load resource set can be decreased by adjusting the index ratio corresponding to the resources in the high-load resource set (e.g., the first index ratio corresponding to memory resources and the second index ratio corresponding to non-memory resources), thereby achieving the purpose of migrating resources in the high-load resource set to the target resource set.
[0123] The resource adjustment method of this invention will be described in detail below with specific examples.
[0124] like Figure 4 As shown, Figure 4 This is a schematic diagram of a system architecture for implementing resource adjustment methods, provided as a specific example. Figure 4In response to a received business request, the system first retrieves the resource load metric values of each container resource from the multiple currently deployed container resources. Specifically, it first collects the load information of each sub-resource within these container resources (e.g., CPU utilization, memory utilization, and disk utilization). Then, it identifies container resources whose memory utilization exceeds a preset load threshold and those whose memory utilization does not exceed the preset load threshold. For container resources whose memory utilization exceeds the preset load threshold, the corresponding resource load metric value is set to 100. For container resources, determine the corresponding indicator ratios for each sub-resource (e.g., the indicator ratios for CPU resources, memory resources, and disk resources). Multiply the load information of each sub-resource by its corresponding indicator ratio to obtain intermediate calculation results. Sum all intermediate calculation results to obtain the resource load indicator value for container resources whose memory resource utilization does not exceed a preset load threshold. After obtaining the resource load indicator values for each container resource, perform resource analysis on each container resource based on these values. Specifically, first, distribute all resource load indicator values normally, and then analyze the resource load indicator values based on the normally distributed distribution. All container resources are categorized to obtain multiple candidate resource sets. Resource data analysis is then performed on these candidate sets to create resource profiles for each set. After obtaining these profiles, the set with the most container resources is identified as the target resource set. Then, based on the resource load metrics of all container resources in the target resource set, a set load metric is calculated. This set load metric is then compared to the resource load threshold corresponding to the business request to obtain the comparison result. Afterwards, based on the comparison result, it is determined whether the container resources in the target resource set can meet the resource requirements of the business request. Specifically, when the comparison result is that the set load index value is less than or equal to the resource load threshold, it means that the container resources in the target resource set can meet the resource requirements of the business request. At this time, at least one container resource from the low-load resource set in these candidate resource sets can be migrated to the target resource set, and at least one container resource from the high-load resource set in these candidate resource sets can be migrated to the target resource set to increase the number of container resources in the target resource set. The container resources in the target resource set with the increased number of container resources are then used to process the business request.When the comparison result shows that the set load metric value is greater than the resource load threshold, it indicates that the container resources in the target resource set cannot meet the resource requirements of the business request. In this case, new container resources are produced through Kubernetes to expand the resource pool. Then, the resource load metric values of all expanded container resources are re-acquired. Based on these re-acquired resource load metric values, the target resource set is redefined, and corresponding resource analysis is performed to determine whether the container resources in the expanded target resource set can meet the resource requirements of the business request. If they can, the container resources in the expanded target resource set are used to process the business request. If they still cannot meet the requirements, new container resources are produced through Kubernetes to expand the resource pool until the container resources in the new target resource set can meet the resource requirements of the business request.
[0125] like Figure 5 As shown, Figure 5 This is a concrete example providing a flowchart illustrating the principle of container resource regeneration triggered by resource analysis. Figure 5The process begins by collecting resource data from multiple currently deployed container resources. Then, resource analysis is performed on this data, resulting in multiple candidate resource sets. It's important to note that the resource data collection and analysis processes are executed cyclically. The candidate resource sets obtained from this analysis can be used to provide data support for subsequent cloud-native containerized services. After obtaining multiple candidate resource sets, when a business request is received, the system first determines whether the set load metric value of the target resource set in these candidate resource sets is greater than the resource load threshold corresponding to the business request. If it is not greater, the container resources in these candidate resource sets are adjusted. For example, at least one container resource from the low-load resource set in these candidate resource sets is migrated to the target resource set, and at least one container resource from the high-load resource set in these candidate resource sets is migrated to the target resource set, increasing the number of container resources in the target resource set. After the resource adjustment is completed, the container resources in the adjusted target resource set are used to process the business request. If the load metric value is greater, new container resources are produced through Kubernetes to expand the resources. Then, the resource load metric value of all expanded container resources is re-obtained, and the target resource set is re-determined based on the re-obtained resource load metric value. Corresponding resource analysis is performed to determine whether the container resources in the expanded target resource set can meet the resource requirements of the business request. If they can, the container resources in the expanded target resource set are used to process the business request. If they still cannot meet the requirements, new container resources are produced through Kubernetes to expand the resources until the container resources in the new target resource set can meet the resource requirements of the business request.
[0126] As can be seen from the specific examples above, the resource adjustment method provided by this invention integrates cloud-native container resources, quantitatively analyzes the load information of container resources, and dynamically adjusts the resource weights corresponding to container resources based on the load information. When the delivered container resources cannot bear business requests, the container resources are reproduced, thus solving the problem of insufficient container resources in a closed loop and ensuring the service quality of the business. This invention can solve the problem of scalable shared operation in multi-business scenarios under traditional solutions, and realizes the transformation of the resource operation mode in the cloud-native model from an extensive resource scale accumulation mode to a refined resource data analysis mode. It solves the service quality problem of the business in a closed loop at the resource layer, thereby improving the intelligence of cloud-native services. In addition, through the closed-loop processing at the resource layer in the operation system, this invention eliminates the need to build a service quality feedback system for each business, thus reducing the manpower and equipment costs of the operation system. Moreover, this invention ensures the service quality of the business through the closed-loop processing at the resource layer, providing a reference for the migration of traditional existing businesses to the cloud-native model, and also supports the rapid launch and scaling of incremental businesses in the cloud-native resource model.
[0127] The following examples illustrate the application scenarios of the embodiments of the present invention.
[0128] It should be noted that the resource adjustment method provided in this embodiment of the invention can be applied to different application scenarios such as multimedia information processing scenarios and model training data processing scenarios. The following description will take multimedia information processing scenarios and model training data processing scenarios as examples.
[0129] Scene 1
[0130] The resource adjustment method provided in this embodiment of the invention can be applied to multimedia information processing scenarios. Specifically, in response to detecting that a user sends a video transcoding request to the server via a device such as a smartphone or computer, the server first obtains the load information of each sub-resource in each container resource (e.g., CPU resource utilization, memory resource utilization, and disk resource utilization). Then, among these container resources, it identifies container resources whose memory resource utilization exceeds a preset load threshold and container resources whose memory resource utilization does not exceed the preset load threshold. For container resources whose memory resource utilization exceeds the preset load threshold, the corresponding resource load index value is set to 100. For container resources whose resource utilization does not exceed a preset load threshold, determine the corresponding indicator ratios for each sub-resource (e.g., the indicator ratios for CPU resources, memory resources, and disk resources). Multiply the load information of each sub-resource by its corresponding indicator ratio to obtain intermediate calculation results. Sum all intermediate calculation results to obtain the resource load indicator value for container resources whose memory resource utilization does not exceed the preset load threshold. After obtaining the resource load indicator values for each container resource, distribute all resource load indicator values normally. Based on the normally distributed resource load indicator values, classify all container resources to obtain multiple candidate resource sets. Next, among these candidate resource sets, the one with the most container resources is determined as the target resource set. The average resource load index value of all container resources in the target resource set is calculated, and this average value is used as the set load index value of the target resource set. After obtaining the set load index value of the target resource set, it is compared with the resource load threshold corresponding to the video transcoding request. When the comparison result is that the set load index value is less than or equal to the resource load threshold, resource adjustments are made to the low-load and high-load resource sets among these candidate resource sets to increase the number of resources in the target resource set. The increased resource quantity in the target resource set is then used. The container resources process the video transcoding request. If the comparison result shows that the set load index value is greater than the resource load threshold, resource expansion is performed. Then, the resource load index values of all expanded container resources are re-acquired, and the target resource set is re-determined based on the re-acquired resource load index values. It is then determined whether the container resources in the expanded target resource set can meet the resource requirements of the video transcoding request. If they can, the container resources in the expanded target resource set are used to process the video transcoding request. If they still cannot meet the requirements, new container resources are produced to expand the resource set until the container resources in the new target resource set can meet the resource requirements of the video transcoding request. After the server completes the processing of the video transcoding request, it will obtain the corresponding video transcoding result, which will then be returned to the user.
[0131] Scene 2
[0132] The resource adjustment method provided in this embodiment of the invention can also be applied to model training data processing scenarios. Specifically, in response to the server's own data cleaning request for model training data, the server first obtains the load information of each sub-resource in each container resource (e.g., CPU resource utilization, memory resource utilization, and disk resource utilization). Then, among these container resources, it identifies container resources whose memory resource utilization exceeds a preset load threshold and those whose memory resource utilization does not exceed the preset load threshold. For container resources whose memory resource utilization exceeds the preset load threshold, the corresponding resource load index value is set to 100. For container resources exceeding a preset load threshold, determine the corresponding indicator ratios for each sub-resource (e.g., the indicator ratios for CPU resources, memory resources, and disk resources). Multiply the load information of each sub-resource by its corresponding indicator ratio to obtain intermediate calculation results. Sum all intermediate calculation results to obtain the resource load indicator value for container resources whose memory resource utilization does not exceed the preset load threshold. After obtaining the resource load indicator values for each container resource, distribute all resource load indicator values normally. Based on the normally distributed resource load indicator values, classify all container resources to obtain multiple candidate resource sets. Then... Among these candidate resource sets, the one with the largest number of container resources is determined as the target resource set. The average resource load index value of all container resources in the target resource set is calculated, and this average value is used as the set load index value of the target resource set. After obtaining the set load index value of the target resource set, it is compared with the resource load threshold corresponding to the data cleaning request. When the comparison result is that the set load index value is less than or equal to the resource load threshold, resource adjustments are made to the low-load and high-load resource sets among these candidate resource sets, increasing the number of resources in the target resource set, and using the containers in the target resource set with increased resources. The server processes the data cleaning request. If the comparison result shows that the set load index value is greater than the resource load threshold, resource expansion is performed. Then, the resource load index values of all container resources after resource expansion are re-acquired, and the target resource set is re-determined based on the re-acquired resource load index values. It is then determined whether the container resources in the expanded target resource set can meet the resource requirements of the data cleaning request. If they can, the container resources in the expanded target resource set are used to process the data cleaning request. If they still cannot meet the requirements, new container resources are produced for resource expansion until the container resources in the new target resource set can meet the resource requirements of the data cleaning request. After the server completes the processing of the data cleaning request, it obtains the corresponding model training sample data. At this point, the server uses the model training sample data to train the model.
[0133] It is understood that although the steps in the above flowcharts are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this embodiment, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the above flowcharts may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.
[0134] Reference Figure 6 This invention also discloses a resource adjustment device 600, which can implement the resource adjustment method as described in the preceding embodiments. The resource adjustment device 600 includes:
[0135] The indicator acquisition unit 610 is used to obtain the current resource load indicator values of each resource in response to a received business request.
[0136] Resource classification unit 620 is used to classify all resources according to all resource load index values to obtain multiple candidate resource sets;
[0137] The set determination unit 630 is used to determine the set with the largest number of resources among multiple candidate resource sets as the target resource set;
[0138] The index calculation unit 640 is used to calculate the set load index value of the target resource set based on the resource load index values of all resources in the target resource set.
[0139] The indicator comparison unit 650 is used to compare the aggregate load indicator value with the resource load threshold corresponding to the business request to obtain the comparison result;
[0140] The resource expansion unit 660 is used to expand resources when the comparison result shows that the set load index value is greater than the resource load threshold.
[0141] In one embodiment, the resource classification unit 620 is further configured to:
[0142] Determine the classification threshold;
[0143] All resources are categorized based on the classification threshold and all resource load index values to obtain multiple candidate resource sets.
[0144] In one embodiment, the resource classification unit 620 is further configured to:
[0145] All resource load index values are normally distributed;
[0146] The classification threshold is determined based on the normal distribution.
[0147] In one embodiment, the index calculation unit 640 is further configured to:
[0148] Calculate the mean value of the resource load index of all resources in the target resource set;
[0149] The mean is used as the set load index value for the target resource set.
[0150] In one embodiment, the set determination unit 630 is further configured to redetermine a new target resource set based on all resources after resource expansion;
[0151] The indicator calculation unit 640 is also used to calculate the new set load indicator value of the new target resource set based on the resource load indicator values of all resources in the new target resource set.
[0152] The indicator comparison unit 650 is also used to compare the new set load indicator value with the resource load threshold to obtain a new comparison result;
[0153] The resource expansion unit 660 is also used to continue resource expansion when the new comparison result is that the new set load index value is greater than the resource load threshold, until the new set load index value is less than the resource load threshold.
[0154] In one embodiment, the set determination unit 630 is further configured to:
[0155] All resources after resource expansion are reclassified to obtain multiple new candidate resource sets;
[0156] Among multiple new candidate resource sets, the one with the largest number of resources is determined as the new target resource set.
[0157] In one embodiment, the plurality of candidate resource sets further includes a low-load resource set and a high-load resource set; the resource adjustment device 600 further includes:
[0158] The resource adjustment unit is used to adjust the resources of the low-load resource set and the high-load resource set when the comparison result is that the set load index value is less than or equal to the resource load threshold, thereby increasing the number of resources in the target resource set.
[0159] The business processing unit is used to process business requests using resources from the target resource set after the resource quantity has been increased.
[0160] In one embodiment, the resource adjustment unit is further configured to:
[0161] Migrate at least one resource from the low-load resource set to the target resource set;
[0162] Migrate at least one resource from the high-load resource set to the target resource set.
[0163] In one embodiment, the resources include different types of sub-resources; the indicator acquisition unit 610 is further configured to:
[0164] Get the load information of each sub-resource in each current resource;
[0165] Based on the load information of each sub-resource in each current resource, the resource load index value of each current resource is obtained.
[0166] In one embodiment, the sub-resources include memory resources and non-memory resources; the indicator acquisition unit 610 is further configured to:
[0167] Among the current resources, the resource whose memory resource load information exceeds the preset load threshold is designated as the first target resource, and the resource whose memory resource load information does not exceed the preset load threshold is designated as the second target resource.
[0168] For the first target resource, the preset index value will be used as the resource load index value of the first target resource;
[0169] For the second target resource, the resource load index value of the second target resource is calculated based on the load information of memory resources and non-memory resources.
[0170] In one embodiment, the indicator acquisition unit 610 is further configured to:
[0171] Determine the proportion of the first indicator corresponding to memory resources and the proportion of the second indicator corresponding to non-memory resources;
[0172] Based on the load information of memory resources, the load information of non-memory resources, the ratio of the first indicator and the ratio of the second indicator, the resource load index value of the second target resource is calculated.
[0173] It should be noted that since the resource adjustment device 600 of this embodiment can implement the resource adjustment method as described in the previous embodiment, the resource adjustment device 600 of this embodiment has the same technical principle and the same beneficial effect as the resource adjustment method described in the previous embodiment. To avoid repetition, it will not be described again here.
[0174] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0175] Reference Figure 7 The present invention also discloses a resource adjustment device 700, which includes:
[0176] At least one processor 701;
[0177] At least one memory 702 is used to store at least one program;
[0178] When at least one program is executed by at least one processor 701, the resource adjustment method as described in any of the preceding embodiments is implemented.
[0179] This invention also discloses a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to implement the resource adjustment method as described in any of the preceding embodiments.
[0180] This invention also discloses a computer program product, including a computer program or computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer program or computer instructions from the computer-readable storage medium and executes the computer program or computer instructions, causing the computer device to perform the resource adjustment method as described in any of the preceding embodiments.
[0181] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatuses.
[0182] It should be understood that in this invention, "at least one (item)" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0183] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, apparatuses, or units, and may be electrical, mechanical, or other forms.
[0184] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0185] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0186] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0187] The step numbers in the above method embodiments are set only for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
Claims
1. A resource adjustment method, characterized in that, Includes the following steps: In response to receiving a business request, the system obtains the current resource load metric values for each resource; wherein, the resources include container resources; All resource load index values are distributed normally, and classification thresholds are determined based on the normal distribution. All resources are classified according to the classification threshold and all the resource load index values to obtain multiple candidate resource sets; wherein, the multiple candidate resource sets include a low-load resource set and a high-load resource set; Among the multiple candidate resource sets, the one with the largest number of the stated resources is determined as the target resource set; The set load index value of the target resource set is calculated based on the resource load index values of all the resources in the target resource set. The set load index value is compared with the resource load threshold corresponding to the service request to obtain the comparison result; When the comparison result indicates that the set load index value is greater than the resource load threshold, new container resources are generated to expand resources. When the comparison result is that the set load index value is less than or equal to the resource load threshold, resource adjustment is performed on the low-load resource set and the high-load resource set, the resource quantity of the target resource set is increased, and the resources in the target resource set with the increased resource quantity are used to process the service request.
2. The resource adjustment method according to claim 1, characterized in that, The step of calculating the set load index value of the target resource set based on the resource load index values of all resources in the target resource set includes: Calculate the average value of the resource load index for all resources in the target resource set; The mean value is used as the set load index value of the target resource set.
3. The resource adjustment method according to claim 1, characterized in that, After resource expansion, the resource adjustment method further includes: A new set of target resources is determined based on all the resources after resource expansion; Based on the resource load index values of all resources in the new target resource set, a new set load index value for the new target resource set is calculated. The new set load index value is compared with the resource load threshold to obtain a new comparison result; When the new comparison result is that the new set load index value is greater than the resource load threshold, resource expansion continues until the new set load index value is less than the resource load threshold.
4. The resource adjustment method according to claim 3, characterized in that, The step of redetermining the new target resource set based on all the resources after resource expansion includes: All the resources after resource expansion are reclassified to obtain multiple new candidate resource sets; Among the multiple new candidate resource sets, the one with the largest number of the stated resources is determined as the new target resource set.
5. The resource adjustment method according to claim 1, characterized in that, The resource adjustment for the low-load resource set and the high-load resource set includes: Migrate at least one of the resources in the low-load resource set to the target resource set; Migrate at least one of the resources in the high-load resource set to the target resource set.
6. The resource adjustment method according to claim 1, characterized in that, The resources include different types of sub-resources; The process of obtaining the current resource load index values for each resource includes: Obtain the load information of each of the sub-resources in each of the current resources; Based on the load information of each of the sub-resources in each of the current resources, the resource load index value of each of the current resources is obtained.
7. The resource adjustment method according to claim 6, characterized in that, The sub-resources include memory resources and non-memory resources; The step of obtaining the resource load index value of each of the current resources based on the load information of each of the sub-resources in each of the current resources includes: Among the current resources, the resource whose load information exceeds a preset load threshold is designated as the first target resource, and the resource whose load information does not exceed the preset load threshold is designated as the second target resource. For the first target resource, a preset index value is used as the resource load index value of the first target resource; For the second target resource, the resource load index value of the second target resource is calculated based on the load information of the memory resource and the load information of the non-memory resource.
8. The resource adjustment method according to claim 7, characterized in that, The step of calculating the resource load index value of the second target resource based on the load information of the memory resource and the load information of the non-memory resource includes: Determine the proportion of the first indicator corresponding to the memory resources and the proportion of the second indicator corresponding to the non-memory resources; The resource load index value of the second target resource is calculated based on the load information of the memory resources, the load information of the non-memory resources, the first index ratio, and the second index ratio.
9. A resource adjustment device, characterized in that, include: The indicator acquisition unit is used to obtain the current resource load indicator values of each resource in response to a received business request; wherein, the resources include container resources; The resource classification unit is used to perform a normal distribution on all the resource load index values, determine a classification threshold value based on the normal distribution, and classify all the resources according to the classification threshold value and all the resource load index values to obtain multiple candidate resource sets; wherein, the multiple candidate resource sets include a low-load resource set and a high-load resource set; The set determination unit is used to determine the set with the largest number of the resources among the multiple candidate resource sets as the target resource set; The index calculation unit is used to calculate the set load index value of the target resource set based on the resource load index values of all the resources in the target resource set. The indicator comparison unit is used to compare the set load indicator value with the resource load threshold corresponding to the service request to obtain the comparison result; A resource expansion unit is used to produce new container resources to expand resources when the comparison result is that the set load index value is greater than the resource load threshold. The resource adjustment device further includes: A resource adjustment unit is used to adjust the resources of the low-load resource set and the high-load resource set when the comparison result is that the set load index value is less than or equal to the resource load threshold, thereby increasing the resource quantity of the target resource set. A business processing unit is used to process the business request using the resources in the target resource set after the resource quantity has been increased.
10. A resource adjustment device, characterized in that, include: At least one processor; At least one memory for storing at least one program; The resource adjustment method as described in any one of claims 1 to 8 is implemented when at least one of the programs is executed by at least one of the processors.
11. A computer-readable storage medium, characterized in that, It stores a processor-executable program, which, when executed by the processor, is used to implement the resource adjustment method as described in any one of claims 1 to 8.
12. A computer program product, comprising a computer program or computer instructions, characterized in that, The computer program or the computer instructions are stored in a computer-readable storage medium, the processor of the computer device reads the computer program or the computer instructions from the computer-readable storage medium, and the processor executes the computer program or the computer instructions, causing the computer device to perform the resource adjustment method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Job scheduling method based on cluster node load state prediction
CN110096349A