Resource configuration method and device, electronic equipment, medium and product

By predicting the next-time resource allocation limit of the application system in the container cluster, the problem that the resource allocation limit in the existing technology cannot meet the burst traffic needs, and the stability and performance of the application operation are improved.

CN119645638APending Publication Date: 2025-03-18AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411720709.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the event-driven elastic capacity expansion processing, the prior art is affected by the preset resource allowance configuration upper limit, and cannot meet the resource requirements of burst traffic, resulting in service interruption or performance degradation.

Method used

By determining the current resource usage information, current resource configuration information and preset resource configuration upper limit of the application system in the container cluster, the predicted resource configuration upper limit at the next moment, and based on this, the next resource configuration upper limit is determined to perform resource configuration.

Benefits of technology

It effectively avoids service interruptions or performance degradation, improves the stability of application operation, and ensures that the resource requirements of burst traffic can be met.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645638A_ABST
    Figure CN119645638A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a resource configuration method and device, electronic equipment, a medium and a product. The method comprises the following steps: determining current resource use information, current resource configuration information and a preset current resource configuration upper limit of an application system in a container cluster in a current time period; predicting a predicted resource configuration upper limit of the application system in the container cluster at the next moment based on the current resource use information; and based on the current resource configuration information, the predicted resource configuration upper limit and the current resource configuration upper limit, determining the next resource configuration upper limit at the next moment, and performing resource configuration on the application system in the container cluster based on the next resource configuration upper limit. According to the technical scheme provided by the embodiment of the invention, the next resource configuration upper limit can more possibly meet the demand of the burst flow to the resources at the next moment, the situation of service interruption or performance reduction is avoided, and the application running stability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a resource configuration method, device, electronic device, medium, and product. Background Art

[0002] Currently, elastic scaling has been widely used in cloud-native applications by automatically adjusting the number of workload replicas to adapt to different resource requirements.

[0003] In the prior art, in the process of providing services to the outside world by the application system in the container cluster, elastic expansion processing is usually performed based on event-driven, so that when encountering burst traffic during the operation of the application system in the container cluster, the resource requirements of the current workload can be met to ensure normal operation. However, in the process of implementing the present invention, it is found that the prior art has at least the following technical problems: due to the influence of the pre-set upper limit of resource configuration allowed when elastic expansion processing is performed based on event-driven, even if the capacity is expanded to the maximum value allowed to be configured, the demand for resources by burst traffic cannot be met, resulting in service interruption or performance degradation, and poor stability of application operation. Summary of the invention

[0004] The embodiments of the present invention provide a resource configuration method, device, electronic device, medium and product to avoid service interruption or performance degradation, so as to achieve the purpose of improving the stability of application operation.

[0005] According to one aspect of the present invention, there is provided a resource configuration method, comprising:

[0006] Determine the current resource usage information, current resource configuration information, and preset current resource configuration upper limit of the application system in the container cluster in the current time period;

[0007] Based on the current resource usage information, predict the upper limit of predicted resource configuration of the application system in the container cluster at the next moment;

[0008] Based on the current resource configuration information, the predicted resource configuration upper limit and the current resource configuration upper limit, a next resource configuration upper limit at the next moment is determined, so as to perform resource configuration for the application system in the container cluster based on the next resource configuration upper limit.

[0009] According to another aspect of the present invention, there is provided a resource configuration device, comprising:

[0010] An information determination module is used to determine the current resource usage information, current resource configuration information, and a preset current resource configuration upper limit of the application system in the container cluster in the current time period;

[0011] An upper limit prediction module, used to predict the upper limit of predicted resource configuration of the application system in the container cluster at the next moment based on the current resource usage information;

[0012] The upper limit determination module is used to determine the next resource configuration upper limit at the next moment based on the current resource configuration information, the predicted resource configuration upper limit and the current resource configuration upper limit, so as to perform resource configuration for the application system in the container cluster based on the next resource configuration upper limit.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the resource configuration method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the resource configuration method described in any embodiment of the present invention when executed.

[0018] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the resource configuration method according to any embodiment of the present invention is implemented.

[0019] The technical solution of the embodiment of the present invention determines the current resource usage information, current resource configuration information and preset current resource configuration upper limit of the application system in the container cluster in the current time period; and, by combining the current resource usage information, predicts the predicted resource configuration upper limit of the application system in the container cluster at the next moment, thereby determining the predicted resource configuration upper limit at the next moment in consideration of the change trend of the resource usage information at different moments in the current time period, so that the determined predicted resource configuration upper limit is more likely to meet the demand for resources of the burst traffic at the next moment; finally, based on the current resource configuration information, the predicted resource configuration upper limit and the current resource configuration upper limit, determine the next resource configuration upper limit at the next moment, so as to configure resources for the application system in the container cluster based on the next resource configuration upper limit. The technical solution of this embodiment determines the next resource configuration upper limit based on the current resource configuration upper limit and the predicted resource configuration upper limit, so that the next resource configuration upper limit is more likely to meet the demand for resources of the burst traffic at the next moment, avoids service interruption or performance degradation, and is conducive to improving the stability of application operation.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 is a flow chart of a resource configuration method provided according to an embodiment of the present invention;

[0023] Figure 2 is a flow chart of another resource configuration method provided according to an embodiment of the present invention;

[0024] Figure 3 is a schematic diagram of a resource configuration process provided according to an embodiment of the present invention;

[0025] Figure 4 is a structural schematic diagram of a resource configuration device provided according to an embodiment of the present invention;

[0026] Figure 5 It is a structural schematic diagram of an electronic device for implementing the resource configuration method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "etc." and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0029] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.

[0030] Figure 1 This is a flow chart of a resource configuration method provided according to an embodiment of the present invention. This embodiment is applicable to the case where resource configuration is performed on an application system in a container cluster based on the next resource configuration upper limit determined at the next moment. The method can be executed by a resource configuration device, which can be implemented in the form of hardware and / or software.

[0031] like Figure 1 As shown, the method of this embodiment may specifically include:

[0032] S110: Determine current resource usage information, current resource configuration information, and a preset current resource configuration upper limit of an application system in the container cluster in a current time period.

[0033] Among them, the application system in the container cluster is deployed on the Kubernetes cluster (container cluster). The Kubernetes cluster is a software cluster used for large-scale deployment and management of containers. It has the capabilities of resource scheduling, application deployment and management, automatic repair, service discovery and load balancing, and elastic scaling. The current time period can be a time period with a preset time length from the current moment, and the preset time length can be set to 10 minutes, half an hour, 1 hour or 1 day, etc. The current resource usage information is composed of the resource usage information corresponding to each moment in the current time period. The resource usage information is the amount of resources occupied by the application system in the container cluster. The current resource configuration information is the amount of resources allocated to each application instance in the application system in the container cluster at the current moment. The current resource configuration upper limit is the upper limit of the amount of resources allowed to be allocated to each application instance in the application system in the container cluster at the pre-set current moment.

[0034] In a specific implementation, the current resource usage information of the application system in the cluster in the current time period can be obtained through an interface pre-created on the container cluster. Specifically, the current resource usage information can be obtained in real time or periodically. Exemplarily, the current resource usage information is obtained based on the list watch mechanism. In addition, the current resource configuration information and the preset upper limit of the current resource configuration are determined through the configuration parameters of the application system in the container cluster at the current moment.

[0035] Optionally, the implementation method for determining the current resource usage information, current resource configuration information and a preset current resource configuration upper limit of the application system in the container cluster in the current time period includes: determining a first utilization rate of pre-allocated processor resources and a second utilization rate of pre-allocated memory by the application system in the container cluster at each moment in the current time period, and using the first utilization rate and the second utilization rate as the current resource usage information; determining the number of workload copies and namespace resource quota configured for the application system in the container cluster at the current moment, and using the number of workload copies and the namespace resource quota as the current resource configuration information; obtaining the preset upper limit of the number of copies and the upper limit of the space resource quota corresponding to the current moment, and using the upper limit of the number of copies and the upper limit of the space resource quota as the current resource configuration upper limit.

[0036] The current time is the end time of the current time period.

[0037] In a specific implementation, for each moment in the current time period, the first resource amount of the pre-allocated processor resources provided to the application system in the container cluster at that moment and the second resource amount of the pre-allocated memory provided can be determined; the third resource amount of the processor resources actually used by the application system in the container cluster at that moment and the fourth resource amount of the memory actually used can be determined, and the ratio between the third resource amount and the first resource amount is used as the first utilization rate at that moment; the ratio between the fourth resource amount and the second resource amount is used as the second utilization rate at that moment. The first utilization rate and the second utilization rate corresponding to each moment constitute the current resource usage information corresponding to the current time period.

[0038] Furthermore, by querying the configuration parameters of the application system in the container cluster, the number of workload copies and the namespace resource quota configured for the application system in the container cluster at the current moment are determined. The number of workload copies is the number of application instances. The number of workload copies and the namespace resource quota are used as the current resource configuration information. It should be noted that when configuring the number of workload copies and the namespace resource quota, it is necessary to set them according to the pre-set resource configuration range, that is, the number of workload copies cannot exceed the upper limit of the number of workload copies, and the namespace resource quota cannot exceed the upper limit of the space resource quota.

[0039] In addition, the current running state of each application instance may also be determined, where the current running state includes at least one of starting, running, and stopping.

[0040] After obtaining the current resource usage information, the current resource usage information may be subjected to information preprocessing operations, the information preprocessing operations including at least one of abnormal information elimination, missing value compensation or duplicate information removal, so as to ensure the integrity and validity of the current resource usage information.

[0041] This embodiment provides a method for determining current resource usage information, current resource configuration information, and a preset upper limit of current resource configuration, so as to effectively and quickly determine the required information.

[0042] S120: Based on the current resource usage information, predict the upper limit of resource configuration of the application system in the container cluster at the next moment.

[0043] In this embodiment, the maximum resource usage of the application system in the container cluster in the current time period can be determined based on the current resource usage information, and the predicted resource configuration upper limit at the next moment can be determined based on the maximum resource usage. Alternatively, the implementation method of predicting the predicted resource configuration upper limit of the application system in the container cluster at the next moment based on the current resource usage information can also be: input the current resource usage information into a pre-trained configuration upper limit prediction model, and determine the predicted resource configuration upper limit of the application system in the container cluster at the next moment based on the output result of the configuration upper limit prediction model; wherein the configuration upper limit prediction model includes a long short-term memory model.

[0044] In a specific implementation, the long short-term memory model to be trained can be trained based on a pre-constructed sample data set, and the trained long short-term memory model can be used as a configuration upper limit prediction model. When determining the predicted resource configuration upper limit, the current resource usage information can be input into the configuration upper limit prediction model, and the configuration upper limit prediction model outputs: the predicted upper limit of the number of copies, and / or the predicted upper limit of the resource quota for the namespace. The predicted upper limit of the number of copies and / or the predicted upper limit of the resource quota for the namespace can be used as the predicted resource configuration upper limit.

[0045] In this embodiment, by configuring the upper limit prediction model, the predicted resource configuration upper limit at the next moment can be quickly predicted, thereby fully considering the resource usage in the current time period and predicting the development trend, which is conducive to improving the accuracy of the determined predicted resource configuration upper limit and making the predicted resource configuration upper limit more in line with the actual resource demand requirements.

[0046] S130: Determine a next resource configuration upper limit at a next moment based on current resource configuration information, the predicted resource configuration upper limit, and the current resource configuration upper limit, so as to perform resource configuration for the application system in the container cluster based on the next resource configuration upper limit.

[0047] In this embodiment, the method for determining the next resource configuration upper limit at the next moment may include: when the predicted resource configuration upper limit is lower than the current resource configuration upper limit, using the current resource configuration upper limit as the next resource configuration upper limit; when the predicted resource configuration upper limit is higher than the current resource configuration upper limit, the next resource configuration upper limit may be determined based on the current resource configuration information, from the current resource configuration upper limit and the next resource configuration upper limit.

[0048] Furthermore, when an emergency capacity expansion instruction is received at the next moment, resources can be configured for the application system in the container cluster based on the determined next resource configuration upper limit so that the configured resource amount is less than the next resource configuration upper limit.

[0049] The technical solution of the embodiment of the present invention determines the current resource usage information, current resource configuration information and preset current resource configuration upper limit of the application system in the container cluster in the current time period; and, by combining the current resource usage information, predicts the predicted resource configuration upper limit of the application system in the container cluster at the next moment, thereby determining the predicted resource configuration upper limit at the next moment in consideration of the change trend of the resource usage information at different moments in the current time period, so that the determined predicted resource configuration upper limit is more likely to meet the demand for resources of the burst traffic at the next moment; finally, based on the current resource configuration information, the predicted resource configuration upper limit and the current resource configuration upper limit, determine the next resource configuration upper limit at the next moment, so as to configure resources for the application system in the container cluster based on the next resource configuration upper limit. The technical solution of this embodiment determines the next resource configuration upper limit based on the current resource configuration upper limit and the predicted resource configuration upper limit, so that the next resource configuration upper limit is more likely to meet the demand for resources of the burst traffic at the next moment, avoids service interruption or performance degradation, and is conducive to improving the stability of application operation.

[0050] Figure 2 is a flowchart of another resource configuration method provided according to an embodiment of the present invention. Based on the above embodiment, this embodiment optionally determines the next resource configuration upper limit at the next moment based on the current resource configuration information, the predicted resource configuration upper limit and the current resource configuration upper limit, including: when the current resource configuration information meets the preset configuration conditions, the predicted resource configuration upper limit is used as the next resource configuration upper limit at the next moment; when the current resource configuration information does not meet the preset configuration conditions, the current resource configuration upper limit is used as the next resource configuration upper limit at the next moment. Among them, the explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 2 As shown, the method includes:

[0051] S210: Determine current resource usage information, current resource configuration information, and a preset current resource configuration upper limit of an application system in the container cluster in a current time period.

[0052] S220: Based on the current resource usage information, predict the upper limit of resource configuration of the application system in the container cluster at the next moment.

[0053] S230: When the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the current resource configuration information meets the preset configuration conditions, the predicted resource configuration upper limit is used as the next resource configuration upper limit at the next moment, so as to perform resource configuration for the application system in the container cluster based on the next resource configuration upper limit.

[0054] The current resource configuration information includes the number of workload copies and the namespace resource quota at the current moment. The next resource configuration upper limit includes the next copy upper limit and the next resource quota upper limit at the next moment.

[0055] In this embodiment, the preset configuration condition includes at least one of the following: the number of workload copies configured for the application system in the container cluster at the current moment reaches the current upper limit of the number of copies; the namespace resource quota configured for the application system in the container cluster at the current moment reaches the current upper limit of the resource quota.

[0056] In a specific implementation, the current resource configuration upper limit can be compared with the predicted resource configuration upper limit. If the predicted resource configuration upper limit is higher than the current resource configuration upper limit, it can be determined whether the current resource configuration information meets the preset configuration conditions. If the preset configuration conditions are met, the predicted resource configuration upper limit is directly used as the next resource configuration upper limit. If the current resource configuration information does not meet the preset configuration conditions, the current resource configuration upper limit can be used as the next resource configuration upper limit at the next moment.

[0057] In this embodiment, after determining the predicted resource configuration upper limit, in order to save resources as much as possible, the predicted resource configuration upper limit is used as the next resource configuration upper limit only when the current resource configuration information meets the preset configuration conditions, which is conducive to saving resources and improving resource utilization.

[0058] Optionally, the current resource configuration upper limit includes the current replica number upper limit, and the predicted resource configuration upper limit includes the predicted replica number upper limit; when the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the current resource configuration information meets the preset configuration conditions, the implementation method of using the predicted resource configuration upper limit as the next resource configuration upper limit at the next moment includes: when the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the number of workload replicas configured for the application system in the container cluster at the current moment reaches the current replica number upper limit, the predicted replica number upper limit is used as the next replica number upper limit at the next moment.

[0059] In a specific implementation, if the predicted upper limit of the number of replicas is higher than the current upper limit of the number of replicas, the number of workload replicas configured for the application system in the container cluster at the current moment is determined. If the number of workload replicas reaches the current upper limit of the number of replicas, the predicted upper limit of the number of replicas can be used as the next upper limit of the number of replicas at the next moment. If the number of workload replicas does not reach the current upper limit of the number of replicas, the current upper limit of the number of replicas can be used as the next upper limit of the number of replicas.

[0060] In this embodiment, when the number of workload copies reaches the current upper limit of the number of copies, the predicted upper limit of the number of copies is used as the next upper limit of the number of copies. Since the predicted upper limit of the number of copies is higher than the current upper limit of the number of copies, it is equivalent to raising the upper limit of the number of copies at the next moment relative to the current moment, so as to avoid the situation where the amount of resources provided cannot meet the demand for resources due to the influence of the upper limit of the number of copies.

[0061] Optionally, the current resource configuration upper limit includes the current resource quota upper limit, and the predicted resource configuration upper limit includes the predicted resource quota upper limit; when the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the current resource configuration information meets the preset configuration conditions, the implementation method of using the predicted resource configuration upper limit as the next resource configuration upper limit at the next moment may also be: when the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the namespace resource quota configured for the application system in the container cluster at the current moment reaches the current resource quota upper limit, the predicted resource quota upper limit is used as the next resource quota upper limit at the next moment.

[0062] Specifically, when the predicted resource quota upper limit is higher than the current resource quota upper limit, you can compare whether the namespace resource quota configured for the application system in the container cluster at the current moment has reached the current resource quota upper limit. If the current resource quota upper limit has been reached, it means that the namespace resource quota cannot be further increased, which may cause the inability to cope with sudden traffic. In this case, the predicted resource quota upper limit can be used as the next resource quota upper limit, thereby increasing the resource quota upper limit, and being able to respond in time in the event of sudden traffic, thereby improving the stability of application operation. If the current resource quota upper limit has not been reached, in order to save resources as much as possible, the current resource quota upper limit can be used as the next resource quota upper limit. Even if sudden traffic occurs, since the namespace resource quota at the current moment has not reached the current resource quota upper limit, it means that there is still room for increasing the namespace resource quota, and it has a certain ability to cope with sudden traffic.

[0063] S240: When the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the current resource configuration information does not meet the preset configuration conditions, the current resource configuration upper limit is used as the next resource configuration upper limit at the next moment, so as to configure resources for the application system in the container cluster based on the next resource configuration upper limit.

[0064] In the specific implementation, when the current resource configuration information does not meet the preset configuration conditions, it means that the current resource configuration information has not reached the current resource configuration upper limit, and there is still room for upward adjustment, which has a certain ability to cope with sudden traffic. Since the predicted resource configuration upper limit is higher than the current resource configuration upper limit, in order to avoid wasting resources, the current resource configuration upper limit can be used as the next resource configuration upper limit at the next moment, so as to configure resources for the application system in the container cluster based on the next resource configuration upper limit.

[0065] This embodiment combines the current resource configuration information to determine the upper limit of the next resource configuration, which can minimize resource waste while coping with burst traffic.

[0066] The above describes in detail the implementation example corresponding to the resource configuration method. In order to make the technical solution of this method further clear to those skilled in the art, a specific application scenario is given below. The resource configuration method proposed in this embodiment can be executed by an elastic expansion and contraction emergency disposal system, which includes a perception layer, a decision layer and a control layer. Through the perception layer, the decision layer and the control layer, it is ensured that the application system in the container cluster can automatically adjust the scaling configuration and namespace configuration when encountering burst traffic, adapt to the resource requirements of the application, and ensure stable operation of the application.

[0067] Figure 3 is an architecture diagram of an elastic expansion and contraction emergency response system provided according to an embodiment of the present invention; Figure 3 As shown in the figure, the Kubernetes cluster includes namespace 1 (nameapce1) and namespace 2 (nameapce2). Nameapce1 contains elastic application 1, which is configured with n containers, namely pod1, pod2, ..., podn. Nameapce1 contains elastic application 2, which is configured with n containers, namely pod1, pod2, ..., podn, where n is a positive integer.

[0068] In the actual application process, the perception layer perceives the state changes of the application system in the Kubernetes cluster in real time through the list watch mechanism. Specifically, the perception layer obtains the application system replica number information, namespace information, elastic configuration information and monitoring indicator information in real time. The replica number information includes the number of workload replicas at the current moment, and the namespace information includes the namespace resource quota at the current moment; the elastic configuration information includes the upper limit of the number of replicas and the upper limit of the space resource quota corresponding to the current moment, and the monitoring indicator information includes the processor usage and memory usage. The decision layer determines the predicted resource configuration upper limit corresponding to the next moment based on the obtained replica number information, namespace information, elastic configuration information, monitoring indicator information and the pre-built upper limit prediction model. The predicted resource configuration upper limit includes the predicted replica number upper limit and the predicted resource quota upper limit. When the number of workload replicas at the current moment reaches the current replica number upper limit, the elastic configuration modification decision is generated based on the predicted replica number upper limit; when the namespace resource quota at the current moment reaches the current resource quota upper limit, the quota modification decision is generated based on the predicted resource quota upper limit. Based on the elastic configuration modification decision, the number of workload copies of the application system in the container cluster is configured, that is, the elastic scaling configuration is controlled; in addition, the elastic scaling configuration can also be controlled by adjusting the scaling step size and monitoring indicator thresholds. Based on the quota modification decision, the namespace quota of the application system in the container cluster is configured, that is, the namespace quota is controlled. In addition, through an event-driven automatic scaling tool, the resource configuration of the application in the Kubernetes cluster is modified accordingly.

[0069] In this embodiment, the speed and efficiency of responding to capacity expansion needs are improved through automated configuration adjustment; and the resource quota of the namespace is adjusted in combination with the current resource configuration, thereby ensuring that the capacity expansion operation can be completed accurately and effectively.

[0070] Figure 4 1 is a schematic diagram of the structure of a resource configuration device provided according to an embodiment of the present invention, and the device is used to execute the resource configuration method provided in any of the above embodiments. The device and the resource configuration method of the above embodiments belong to the same inventive concept, and the details not described in detail in the embodiment of the resource configuration device can refer to the embodiment of the above resource configuration method. Figure 4 As shown, the device comprises:

[0071] The information determination module 10 is used to determine the current resource usage information, current resource configuration information and the preset current resource configuration upper limit of the application system in the container cluster in the current time period;

[0072] The upper limit prediction module 11 is used to predict the upper limit of resource configuration of the application system in the container cluster at the next moment based on the current resource usage information;

[0073] The upper limit determination module 12 is used to determine the next resource configuration upper limit at the next moment based on the current resource configuration information, the predicted resource configuration upper limit and the current resource configuration upper limit, so as to perform resource configuration for the application system in the container cluster based on the next resource configuration upper limit.

[0074] Based on any optional technical solution in the embodiment of the present invention, optionally, the information determination module 10 includes:

[0075] A current resource usage information determination unit, used to determine a first utilization rate of pre-allocated processor resources and a second utilization rate of pre-allocated memory by an application system in the container cluster at each moment in a current time period, and use the first utilization rate and the second utilization rate as current resource usage information;

[0076] A current resource configuration information determination unit is used to determine the number of workload copies and the namespace resource quota configured for the application system in the container cluster at the current moment, and use the number of workload copies and the namespace resource quota as the current resource configuration information; wherein the current moment is the end moment of the current time period;

[0077] The current resource configuration upper limit determining unit is used to obtain the upper limit of the number of replicas and the upper limit of the space resource quota corresponding to the preset current moment, and use the upper limit of the number of replicas and the upper limit of the space resource quota as the current resource configuration upper limit.

[0078] Based on any optional technical solution in the embodiment of the present invention, optionally, the upper limit prediction module 11 includes:

[0079] An information input unit, used to input current resource usage information into a pre-trained configuration upper limit prediction model, and determine the predicted resource configuration upper limit of the application system in the container cluster at the next moment based on the output result of the configuration upper limit prediction model;

[0080] Among them, the configuration upper limit prediction model includes a long short-term memory model.

[0081] Based on any optional technical solution in the embodiment of the present invention, optionally, the upper limit determination module 12 includes:

[0082] A first determining unit, configured to use the predicted resource configuration upper limit as the next resource configuration upper limit at the next moment when the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the current resource configuration information meets a preset configuration condition;

[0083] The second determining unit is configured to use the current resource configuration upper limit as the next resource configuration upper limit at the next moment when the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the current resource configuration information does not meet the preset configuration condition.

[0084] Based on any optional technical solution in the embodiments of the present invention, optionally, the current resource configuration upper limit includes the current upper limit of the number of copies, and the predicted resource configuration upper limit includes the predicted upper limit of the number of copies;

[0085] The first determining unit includes:

[0086] The first determination subunit is used to use the predicted upper limit of the number of copies as the next upper limit of the number of copies at the next moment when the predicted upper limit of the resource configuration is higher than the current upper limit of the resource configuration and the number of workload copies configured for the application system in the container cluster at the current moment reaches the current upper limit of the number of copies.

[0087] On the basis of any optional technical solution in the embodiments of the present invention, optionally, the current resource configuration upper limit includes a current resource quota upper limit, and the predicted resource configuration upper limit includes a predicted resource quota upper limit;

[0088] The second determining unit includes:

[0089] The second determination subunit is used to use the predicted resource quota upper limit as the next resource quota upper limit at the next moment when the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the namespace resource quota configured for the application system in the container cluster at the current moment reaches the current resource quota upper limit.

[0090] The technical solution of the embodiment of the present invention determines the current resource usage information, current resource configuration information and preset current resource configuration upper limit of the application system in the container cluster in the current time period; and, by combining the current resource usage information, predicts the predicted resource configuration upper limit of the application system in the container cluster at the next moment, thereby determining the predicted resource configuration upper limit at the next moment in consideration of the change trend of the resource usage information at different moments in the current time period, so that the determined predicted resource configuration upper limit is more likely to meet the demand for resources of the burst traffic at the next moment; finally, based on the current resource configuration information, the predicted resource configuration upper limit and the current resource configuration upper limit, determine the next resource configuration upper limit at the next moment, so as to configure resources for the application system in the container cluster based on the next resource configuration upper limit. The technical solution of this embodiment determines the next resource configuration upper limit based on the current resource configuration upper limit and the predicted resource configuration upper limit, so that the next resource configuration upper limit is more likely to meet the demand for resources of the burst traffic at the next moment, avoids service interruption or performance degradation, and is conducive to improving the stability of application operation.

[0091] It is worth noting that in the embodiment of the above-mentioned resource configuration device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0092] Figure 5 Schematic diagram of the structure of an electronic device that implements the resource configuration method of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0093] like Figure 5 As shown, the electronic device 20 includes at least one processor 21, and a memory connected to the at least one processor 21, such as a read-only memory (ROM) 22, a random access memory (RAM) 23, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 21 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 22 or the computer program loaded from the storage unit 28 to the random access memory (RAM) 23. In RAM23, various programs and data required for the operation of the electronic device 20 can also be stored. The processor 21, ROM22 and RAM23 are connected to each other through a bus 24. An input / output (I / O) interface 25 is also connected to the bus 24.

[0094] A number of components in the electronic device 20 are connected to the I / O interface 25, including: an input unit 26, such as a keyboard, a mouse, etc.; an output unit 27, such as various types of displays, speakers, etc.; a storage unit 28, such as a disk, an optical disk, etc.; and a communication unit 29, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 29 allows the electronic device 20 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0095] The processor 21 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 21 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 21 executes the various methods and processes described above, such as a resource configuration method.

[0096] In some embodiments, the resource configuration method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 28. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 20 via the ROM 22 and / or the communication unit 29. When the computer program is loaded into the RAM 23 and executed by the processor 21, one or more steps of the resource configuration method described above may be performed. Alternatively, in other embodiments, the processor 21 may be configured to perform the resource configuration method in any other appropriate manner (e.g., by means of firmware).

[0097] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0098] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0099] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0100] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0101] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0102] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0103] This embodiment also provides a computer program product, including a computer program, which, when executed by a processor, implements the resource configuration method provided in any embodiment of the present application.

[0104] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0105] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0106] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A resource configuration method, characterized in that: include: Determine the current resource usage information, current resource configuration information, and preset current resource configuration upper limit of the application system in the container cluster in the current time period; Based on the current resource usage information, predict the upper limit of predicted resource configuration of the application system in the container cluster at the next moment; Based on the current resource configuration information, the predicted resource configuration upper limit and the current resource configuration upper limit, a next resource configuration upper limit at the next moment is determined, so as to perform resource configuration for the application system in the container cluster based on the next resource configuration upper limit.

2. The method according to claim 1, characterized in that The determining of current resource usage information, current resource configuration information, and a preset current resource configuration upper limit of the application system in the container cluster in the current time period includes: Determine a first utilization rate of pre-allocated processor resources and a second utilization rate of pre-allocated memory by the application system in the container cluster at each moment in the current time period, and use the first utilization rate and the second utilization rate as the current resource usage information; Determine the number of workload copies and the namespace resource quota configured for the application system in the container cluster at the current moment, and use the number of workload copies and the namespace resource quota as the current resource configuration information; wherein the current moment is the end moment of the current time period; The preset upper limit of the number of replicas and the upper limit of the space resource quota corresponding to the current moment are obtained, and the upper limit of the number of replicas and the upper limit of the space resource quota are used as the current resource configuration upper limit.

3. The method according to claim 1, characterized in that The predicting, based on the current resource usage information, an upper limit of predicted resource configuration of the application system in the container cluster at the next moment includes: Inputting the current resource usage information into a pre-trained configuration upper limit prediction model, and determining the predicted resource configuration upper limit of the application system in the container cluster at the next moment based on the output result of the configuration upper limit prediction model; Wherein, the configuration upper limit prediction model includes a long short-term memory model.

4. The method according to claim 1, characterized in that: The determining, based on the current resource configuration information, the predicted resource configuration upper limit and the current resource configuration upper limit, of the next resource configuration upper limit at the next moment includes: When the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the current resource configuration information meets the preset configuration condition, the predicted resource configuration upper limit is used as the next resource configuration upper limit at the next moment; When the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the current resource configuration information does not meet the preset configuration condition, the current resource configuration upper limit is used as the next resource configuration upper limit at the next moment.

5. The method according to claim 4, characterized in that The current resource configuration upper limit includes the current upper limit of the number of copies, and the predicted resource configuration upper limit includes the predicted upper limit of the number of copies; The step of using the predicted resource configuration upper limit as the next resource configuration upper limit at the next moment when the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the current resource configuration information satisfies a preset configuration condition includes: When the predicted resource configuration upper limit is higher than the current resource configuration upper limit, and the number of workload replicas configured for the application system in the container cluster at the current moment reaches the current replica number upper limit, the predicted replica number upper limit is used as the next replica number upper limit at the next moment.

6. The method according to claim 4, characterized in that The current resource configuration upper limit includes the current resource quota upper limit, and the predicted resource configuration upper limit includes the predicted resource quota upper limit; The step of using the predicted resource configuration upper limit as the next resource configuration upper limit at the next moment when the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the current resource configuration information satisfies a preset configuration condition includes: When the predicted resource configuration upper limit is higher than the current resource configuration upper limit and the namespace resource quota configured for the application system in the container cluster at the current moment reaches the current resource quota upper limit, the predicted resource quota upper limit is used as the next resource quota upper limit at the next moment.

7. A resource allocation device, characterized in that: include: An information determination module is used to determine the current resource usage information, current resource configuration information, and a preset current resource configuration upper limit of the application system in the container cluster in the current time period; An upper limit prediction module, used to predict the upper limit of predicted resource configuration of the application system in the container cluster at the next moment based on the current resource usage information; The upper limit determination module is used to determine the next resource configuration upper limit at the next moment based on the current resource configuration information, the predicted resource configuration upper limit and the current resource configuration upper limit, so as to perform resource configuration for the application system in the container cluster based on the next resource configuration upper limit.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the resource configuration method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the resource configuration method according to any one of claims 1 to 6 when executed.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the resource configuration method according to any one of claims 1 to 6.