Container adjusting method, device and equipment

By obtaining the current business information of the container group at the data acquisition time, the problem of poor timeliness of the container group expansion and capacity is solved, and faster container group adjustment and custom indicator support is achieved.

CN120234089APending Publication Date: 2025-07-01HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311846929.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

In the prior art, the scaling operation of the container group is collected in history because the business indicators obtained are poor timeliness, so it is impossible to flexibly add custom business indicators, and the delay is large.

Method used

By determining the data acquisition time, the current service information of the target container group is obtained in real time, and the capacity processing is performed based on the current service information, the direct-connected acquisition component is used to reduce network delay and realize synchronous query.

Benefits of technology

It improves the timeliness of container group expansion and capacity, reduces the delay in obtaining business information, and supports the flexible addition of customized business indicators.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234089A_ABST
    Figure CN120234089A_ABST
Patent Text Reader

Abstract

The invention provides a container adjustment method, device and equipment, and the method comprises the steps: determining a data collection moment for data collection of a target container group, the data collection moment being a current moment or a moment after the current moment; requesting the target container group to obtain the current service information of the target container group at the data acquisition moment; and according to the current service information, carrying out capacity expansion and shrinkage processing on the target container group. And the timeliness of expanding and shrinking the volume of the container group is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and in particular, to a container adjustment method, apparatus, and device. Background Art

[0002] A container orchestration engine (Kubernetes) cluster may include multiple container groups (pods), and a container group may include multiple containers, which can be used to run services.

[0003] In the related art, business metrics of a container group can be collected and stored in a time series database. A server can obtain the business metrics from the time series database and scale the container group up or down according to the business metrics. However, in the above method, since the obtained business metrics are data collected at a historical moment and stored in the time series database relative to the current moment when scaling up or down, the latency of obtaining the business metrics is large, resulting in poor timeliness of scaling the container group up or down. Summary of the Invention

[0004] Multiple aspects of this application provide a container adjustment method, apparatus, and device to improve the timeliness of scaling a container group up or down.

[0005] In a first aspect, an embodiment of this application provides a container adjustment method, including:

[0006] Determine a data collection moment for collecting data from a target container group, where the data collection moment is the current moment or a moment after the current moment;

[0007] At the data collection moment, request the target container group to obtain the current business information of the target container group;

[0008] Scale the target container group up or down according to the current business information.

[0009] In a possible implementation, determining a data collection moment for collecting data from a target container group includes:

[0010] Obtain the historical business information and historical scaling information of the target container group;

[0011] Determine the data collection moment according to the historical business information and the historical scaling information.

[0012] In a possible implementation, determining the data collection moment according to the historical business information and the historical scaling information includes:

[0013] Estimate the estimated business information of the target container group in a future period according to the historical business information, where the estimated business information includes the index values of at least one business metric;

[0014] Determine the estimated scaling information of the target container group in the future period according to the historical scaling information, where the estimated scaling information includes the probability of scaling the target container group at each moment in the future period;

[0015] Determine the data collection moment according to the estimated service information and the estimated scaling information.

[0016] In a possible implementation manner, determining the data collection moment according to the estimated service information and the estimated scaling information includes:

[0017] Determine M first moments according to the estimated service information, where there are index values of service indicators at the first moments in the estimated service information that are greater than or equal to the corresponding preset thresholds, and M is an integer;

[0018] Determine N second moments according to the estimated scaling information, where the probability of scaling the target container group at the second moments is greater than or equal to a preset probability, and N is an integer;

[0019] Determine the data collection moment according to the M first moments and the N second moments.

[0020] In a possible implementation manner, determining the data collection moment according to the M first moments and the N second moments includes:

[0021] Determine the earliest moment among the M first moments and the N first moments as the target moment;

[0022] Determine a preset advance duration;

[0023] Determine the data collection moment according to the advance duration and the target moment, where the data collection moment is before the target moment, and the time difference between the data collection moment and the target moment is equal to the advance duration.

[0024] In a possible implementation manner, determining the data collection moment for data collection on a target container group includes:

[0025] Determine the data collection period corresponding to the target container group;

[0026] Determine the third moment when the target container group was last data-collected;

[0027] Determine the data collection moment according to the data collection period and the third moment, where the duration between the third moment and the data collection moment is the duration corresponding to the data collection period.

[0028] In a possible implementation, at the data collection moment, request the current service information of the target container group from the target container group, including:

[0029] Determine at least one service metric and the data collection duration corresponding to each service metric;

[0030] At the data collection moment, send a data collection request to the target container group, where the data collection request includes the at least one service metric and the data collection duration corresponding to each service metric;

[0031] Receive the current service information sent by the target container group, where the current service information includes the metric values of each service metric within the corresponding data collection duration.

[0032] In a possible implementation, applied to a server, a collection component is set in the server, and the collection component is directly connected to the target container group;

[0033] At the data collection moment, send a data collection request to the target container group, including:

[0034] At the data collection moment, send the data collection request to the target container group through the collection component.

[0035] In a possible implementation, receive the current service information sent by the target container group, including:

[0036] Receive multiple data streams sent by the target container group through the collection component, where the data streams include the metric values of each service metric collected at at least one collection moment;

[0037] Wherein, for any one data stream, the time difference between the moment when the target container group sends the data stream and the moment when the target container group collects the metric values in the data stream is less than or equal to a preset duration.

[0038] In a possible implementation, perform scaling processing on the target container group according to the current service information, including:

[0039] Obtain the resource usage information of the target container group;

[0040] Perform scaling processing on the target container group according to the current service information and the resource usage information.

[0041] In a possible implementation, the current service information includes multiple metric values corresponding to each service metric among at least one service metric, and the resource usage information includes resource occupancy information corresponding to each resource type among multiple resource types;

[0042] Performing scaling processing on the target container group according to the current service information and the resource usage information includes:

[0043] For any one service metric, determining the metric type of the service metric according to the multiple metric values corresponding to the service metric in the current service information, where the metric type is an abnormal type or a normal type;

[0044] For any one resource type, determining the resource usage type corresponding to each resource type according to the multiple resource occupancy rates corresponding to each resource type in the resource usage information, where the resource usage type is an abnormal type or a normal type;

[0045] If there is an abnormal type service metric in the current service information, and / or there is an abnormal type resource type in the resource usage information, then perform scaling processing on the target container group.

[0046] In a second aspect, an embodiment of the present application provides a container adjustment device, where the container adjustment device includes: a determination module, an acquisition module, and a processing module, where,

[0047] The determination module is configured to determine a data acquisition time for collecting data from the target container group, where the data acquisition time is the current time or a time after the current time;

[0048] The acquisition module is configured to request and obtain the current service information of the target container group from the target container group at the data acquisition time;

[0049] The processing module is configured to perform scaling processing on the target container group according to the current service information.

[0050] In a possible implementation, the determination module is specifically configured to:

[0051] Obtain the historical service information and historical scaling information of the target container group;

[0052] Determine the data acquisition time according to the historical service information and the historical scaling information.

[0053] In a possible implementation, the determination module is specifically configured to:

[0054] Estimate the estimated service information of the target container group in a future period according to the historical service information, where the estimated service information includes the metric values of at least one service metric;

[0055] Determine the estimated scaling information of the target container group in the future period according to the historical scaling information, where the estimated scaling information includes the probability of scaling the target container group at each moment in the future period;

[0056] Determine the data collection moment according to the estimated service information and the estimated scaling information.

[0057] In a possible implementation manner, the determining module is specifically configured to:

[0058] Determine M first moments according to the estimated service information, where there are metric values of service metrics at the first moments in the estimated service information that are greater than or equal to the corresponding preset thresholds, and M is an integer;

[0059] Determine N second moments according to the estimated scaling information, where the probability of scaling the target container group at the second moments is greater than or equal to a preset probability, and N is an integer;

[0060] Determine the data collection moment according to the M first moments and the N second moments.

[0061] In a possible implementation manner, the determining module is specifically configured to:

[0062] Determine the earliest moment among the M first moments and the N first moments as the target moment;

[0063] Determine a preset advance duration;

[0064] Determine the data collection moment according to the advance duration and the target moment, where the data collection moment is before the target moment, and the time difference between the data collection moment and the target moment is equal to the advance duration.

[0065] In a possible implementation manner, the determining module is specifically configured to:

[0066] Determine the data collection period corresponding to the target container group;

[0067] Determine the third moment when the target container group last performed data collection;

[0068] Determine the data collection moment according to the data collection period and the third moment, where the duration between the third moment and the data collection moment is the duration corresponding to the data collection period.

[0069] In a possible implementation, the obtaining module is specifically configured to:

[0070] Determine at least one service metric and the data collection duration corresponding to each service metric;

[0071] At the data collection moment, send a data collection request to the target container group, where the data collection request includes the at least one service metric and the data collection duration corresponding to each service metric;

[0072] Receive the current service information sent by the target container group, where the current service information includes the metric values of each service metric within the corresponding data collection duration.

[0073] In a possible implementation, applied to a server, a collection component is set in the server, and the collection component is directly connected to the target container group; the obtaining module is specifically configured to:

[0074] At the data collection moment, send the data collection request to the target container group through the collection component.

[0075] In a possible implementation, the obtaining module is specifically configured to:

[0076] Receive, through the collection component, multiple data streams sequentially sent by the target container group, where the data streams include the metric values of each service metric collected at at least one collection moment;

[0077] Wherein, for any one data stream, the time difference between the moment when the target container group sends the data stream and the moment when the target container group collects the metric values in the data stream is less than or equal to a preset duration.

[0078] In a possible implementation, the processing module is specifically configured to:

[0079] Obtain the resource usage information of the target container group;

[0080] Perform scaling processing on the target container group according to the current service information and the resource usage information.

[0081] In a possible implementation, the current service information includes multiple metric values corresponding to each service metric among at least one service metric, and the resource usage information includes the resource occupancy information corresponding to each resource type among multiple resource types;

[0082] The processing module is specifically configured to:

[0083] For any business metric, determine the metric type of the business metric based on multiple metric values corresponding to the business metric in the current business information, where the metric type is an abnormal type or a normal type;

[0084] For any resource type, determine the resource usage type corresponding to each resource type based on the multiple resource occupancy rates corresponding to each resource type in the resource usage information, where the resource usage type is an abnormal type or a normal type;

[0085] If there is a business metric of the abnormal type in the current business information, and / or there is a resource type of the abnormal type in the resource usage information, then perform scaling processing on the target container group.

[0086] In a third aspect, an embodiment of the present application provides a server, including: a memory and a processor;

[0087] The memory stores computer-executable instructions;

[0088] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the method according to any one of the first aspects.

[0089] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the method according to any one of the first aspects.

[0090] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the method according to any one of the first aspects.

[0091] An embodiment of the present application provides a container adjustment method, device and equipment. The server can determine the data collection time for collecting data from the target container group, and at the data collection time, request the target container group to obtain the current business information of the target container group. Furthermore, the server can perform scaling processing on the target container group according to the current business information. Since the server can determine the data collection time and obtain the current business information of the target container group in a timely manner at the data collection time, compared with the related technology, multiple metric values of at least one business metric in the current business information are collected currently instead of at a historical time, reducing the latency of obtaining business metrics, thereby comprehensively improving the timeliness of scaling the container group. Description of the Drawings

[0092] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application, and do not constitute an improper limitation of the present application. In the drawings:

[0093] Figure 1 A scenario schematic diagram provided for an exemplary embodiment of the present application;

[0094] Figure 2 A process schematic diagram of container adjustment in the related art;

[0095] Figure 3 A flowchart of a container adjustment method provided for an exemplary embodiment of the present application;

[0096] Figure 4 A flowchart of another container adjustment method provided for an exemplary embodiment of the present application;

[0097] Figure 5 A process schematic diagram of a container adjustment method provided for an exemplary embodiment of the present application;

[0098] Figure 6 A structural schematic diagram of a container adjustment device provided for an exemplary embodiment of the present application;

[0099] Figure 7 A structural schematic diagram of a server provided for an exemplary embodiment of the present application. Detailed implementation manners

[0100] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards, and corresponding operation entrances are provided for the user to choose to authorize or refuse.

[0101] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0102] Figure 1 A scenario schematic diagram provided for an exemplary embodiment of the present application. Please refer to Figure 1 , the Kubernetes cluster may include multiple container groups, and each container group may include multiple containers. For example, the Kubernetes cluster may include container group 1 and container group 2. Container group 1 may include containers 1-1 and 1-2, and container group 2 may include containers 2-1 and 2-2.

[0103] Business operations can be run in a container group. For example, Business 1 can be run in Container Group 1 and Container Group 2.

[0104] The server can collect the current business information in the target container group and scale the container group up or down based on the current business information. The target container group can include Container Group 1 and Container Group 2. For example, if the business metric included in the current business information is the number of network connections, when the number of network connections in both Container Group 1 and Container Group 2 exceeds the connection number threshold, the container group can be scaled up by adding Container Group 3, and Container Group 3 can include Container 3-1 and Container 3-2.

[0105] In the related art, the business metrics of a container group can be collected and stored in a time series database. The server can obtain the business metrics from the time series database and scale the container group up or down based on the business metrics. However, in the above method, since the obtained business metrics are data collected at a historical moment and stored in the time series database relative to the current moment when scaling up or down, the latency of obtaining the business metrics is large, resulting in poor timeliness of scaling the container group up or down.

[0106] In the embodiment of the present application, the server can determine the data collection moment for collecting data from the target container group, collect the current business information in the target container group according to the data collection moment, and then scale the target container group up or down based on the current business information. Since the server can determine the data collection moment to collect the current business information in a timely manner, the latency of collecting the business information is reduced, thereby improving the timeliness of scaling the container group up or down.

[0107] Next, in combination with Figure 2 , the process of container adjustment in the related art will be described.

[0108] Figure 2 It is a schematic diagram of the process of container adjustment in the related art. Please refer to Figure 2 , the Kubernetes cluster includes a Horizontal Pod Autoscaling (HPA) component, a Kubernetes service component, a Prometheus collection component, a node management component, multiple container groups, a Prometheus monitoring component, a Prometheus service component, and a time series database.

[0109] Among them, the Kubernetes service component and the Prometheus collection component can be set on Node 1. A node management component can be provided on Node 2, and a monitoring tool can be provided in the node management component. The monitoring tool can be CAdvisor, which can be used to obtain the resource usage information of the node and the resource usage information of the container groups on the node. The node can be a virtual machine or a server, etc. The resource usage information can be the processor occupancy rate, the memory occupancy rate, etc.

[0110] Steps ①②③ are the process of collecting container data, and steps ④⑤⑥ are the process of the HPA component obtaining container data. The data collection process and the data acquisition process are relatively independent and do not interfere with each other. Among them, the container data can include the resource usage information and multiple metric values of at least one business metric.

[0111] In step ①, the Prometheus monitoring component can periodically collect Container Group 1 and Container Group 2 to obtain multiple metric values corresponding to at least one business metric, and can send the multiple metric values corresponding to the at least one business metric to the Prometheus service component. In step ②, the Prometheus service component can store the multiple metric values corresponding to the at least one business metric in the time series database.

[0112] In step ③, the monitoring tool in the node management component can periodically collect Container Group 1 and Container Group 2 to obtain the resource usage information of Container Group 1 and Container Group 2, and store it.

[0113] In step ④, the HPA component can send a request to obtain business metrics to the Prometheus collection component through the aggregation interface, and can send a request to obtain resource information to the Kubernetes service component. In step ⑤, the Kubernetes service component can send a request to obtain resource usage information to the node management component, and the node management component can send the pre-collected historical resource usage information to the Kubernetes service component. Furthermore, the node management component can send the historical resource usage information to the HPA component through the aggregation interface so that the HPA component can obtain the historical resource usage information; in step ⑥, the Prometheus collection component can send a request to obtain business metrics to the Prometheus service component, and the Prometheus service component can determine multiple historical metric values corresponding to at least one pre-collected business metric in the time series database, and send the multiple historical metric values to the Prometheus collection component. Furthermore, the Prometheus collection component can send the multiple historical metric values to the HPA component through the aggregation interface so that the HPA component can obtain the multiple historical metric values.

[0114] The HPA component can scale the container group up or down according to historical resource usage information and multiple historical metric values.

[0115] In the related art, since the process of collecting container data and the process of the HPA component obtaining container data are asynchronous, the business metrics obtained by the HPA component are data collected in advance at a historical moment and stored in the time series database, rather than the current business metrics. That is, there is a large latency in the business metrics obtained by the HPA component, with the latency ranging from 30 seconds to over 1 minute, resulting in poor timeliness of the server scaling the container group up or down based on container data through the HPA component; and it is impossible to flexibly add custom business metrics.

[0116] Next, the technical solutions shown in this application will be described in detail through specific embodiments. It should be noted that the following several embodiments can exist independently or be combined with each other. For the same or similar content, it will not be repeated in different embodiments.

[0117] Figure 3 It is a flowchart of a container adjustment method provided for an exemplary embodiment of this application. Please refer to Figure 3 , the method may include:

[0118] S301. Determine the data collection moment for collecting data from the target container group.

[0119] The execution subject of the embodiments of this application can be a server or a container adjustment device set in the server. The container adjustment device can be implemented by software or a combination of software and hardware. The container adjustment device can be a processor in the server. For ease of understanding, hereinafter, the execution subject is taken as an example of a server for description.

[0120] The target container group refers to the container group in the Kubernetes cluster that needs to have data collected. Optionally, the number of target container groups can be at least one.

[0121] The data collection moment can be the current moment or a moment after the current moment.

[0122] In an optional embodiment, the data collection moment for collecting data from the target container group can be determined in the following manner: Obtain the historical business information and historical scaling information of the target container group; determine the data collection moment according to the historical business information and historical scaling information.

[0123] Business information refers to the information generated when the target container group runs its business. For example, the business information can be the number of network connections.

[0124] Historical service information may include the metric values of at least one service metric at multiple first historical moments within a first historical duration. The first historical duration may be preset manually.

[0125] For example, if the target container group includes container group 1 and container group 2, the service metric is the number of network connections, the current moment is 15:30, and the first historical duration is 10 minutes before the current moment, then the historical service information may include the multiple historical network connection numbers of container group 1 within the past 10 minutes, which may be as shown in Table 1:

[0126] Table 1

[0127]

[0128] The historical scaling information may include multiple second historical moments and the historical number of container groups at each second historical moment. For example, the historical scaling information may be as shown in Table 2:

[0129] Table 2

[0130] The second historical moment The number of historical container groups 14:45 1 15:00 2 15:15 2 …… ……

[0131] For example, if the current moment is 15:30, the server may obtain the historical service information of the target container group as shown in Table 1 and obtain the historical scaling information as shown in Table 2. Then, the server may predict the data collection moment based on the historical service information and the historical scaling information. Suppose it can be determined that the data collection moment is 15:55.

[0132] Through the above method, the data collection moment can be determined to dynamically adjust the collection interval. When the metric value of a certain service metric fluctuates greatly, the time interval between data collection moments can be shorter, that is, the collection interval is shorter and the frequency of collecting metric values is high, thereby improving the accuracy of scaling based on multiple metric values of the service metric; when the change of a certain service metric fluctuates little, the time interval between data collection moments can be longer, that is, the collection interval is longer and the frequency of collecting metric values is low, which can reduce the energy consumption of the server.

[0133] For example, if the number of network connections fluctuates greatly, it can be determined that the time interval between data collection moment 1 and data collection moment 2 for collecting the number of network connections is 1 minute; if the number of network connections fluctuates smoothly, it can be determined that the time interval between data collection moment 1 and data collection moment 2 for collecting the number of network connections is 30 minutes to reduce the frequency of collecting service metrics, thereby reducing the energy consumption of the server.

[0134] In another alternative embodiment, the data collection time for collecting data from the target container group can be determined in the following manner: Determine the data collection period corresponding to the target container group; Determine the third time when the target container group last collected data; Determine the data collection time according to the data collection period and the third time.

[0135] Optionally, the data collection period can be preset manually. For example, the data collection period can be 30 seconds.

[0136] The duration between the third time and the data collection time can be the duration corresponding to the data collection period.

[0137] For example, if the target container groups are Container Group 1 and Container Group 2, the server can determine the data collection periods corresponding to Container Group 1 and Container Group 2. Assume that the data collection periods corresponding to both Container Group 1 and Container Group 2 are 30 seconds. Assume that the server can determine that the third time when both Container Group 1 and Container Group 2 last collected data is 15:00:00. Then the server can determine the data collection time as 15:00:30 according to the data collection period and the third time.

[0138] S302. At the data collection time, request the target container group to obtain the current service information of the target container group.

[0139] The current service information can include the index values of at least one service metric.

[0140] A collection component can be set in the server. At the data collection time, the server can send a data collection request to the target container group through the collection component to request to obtain the current service information of the target container group. Among them, the collection component can be a collection component for customizing collection metrics.

[0141] The collection component can be directly connected to the target container group. The collection component can communicate with the target container group through the Hypertext Transfer Protocol (HTTP).

[0142] The server can collect custom service metrics through the collection component.

[0143] For example, if the service metric is the number of network connections, and if the data collection time is 15:00:30 and the target container groups are Container Group 1 and Container Group 2, then according to this data collection time, a collection request 1 can be sent to Container Group 1 to request to obtain the current number of network connections 1 of Container Group 1; a collection request 2 can be sent to Container Group 2 to request to obtain the current number of network connections 2 of Container Group 2. Assume that the current number of network connections 1 is 2200 and the current number of network connections 2 is 2100.

[0144] S303. Scale the target container group up or down according to the current service information.

[0145] Since the current service information includes the metric values of at least one service metric, after the server obtains the current service information, it can determine the preset thresholds corresponding to at least one service metric.

[0146] If there is a metric value of a service metric in the current service information that is greater than or equal to the corresponding preset threshold, the target container group can be scaled up; if the metric values of at least one service metric in the current service information are all less than the corresponding preset thresholds, the target container group can be scaled down.

[0147] In another alternative embodiment, the server can also determine the scaling policy and scale the target container group up or down according to the current service information and the scaling policy.

[0148] Optionally, the scaling policy can be that when the service metric in the current service information is greater than or equal to the corresponding preset threshold, n container groups are scaled up within the unit time; when the service metric in the current service information is less than the corresponding preset threshold and remains for the preset duration, n container groups are reduced within the unit time, where n is a positive integer.

[0149] Optionally, the preset threshold, the preset duration, and the unit time can be preset manually.

[0150] For example, if the target container group includes Container Group 1 and Container Group 2, if the current number of network connections 1 of Container Group 1 is 2200 and the current number of network connections 2 of Container Group 2 is 2100, and if the network connection threshold is 2000, since both the current number of network connections 1 and the current number of network connections 2 are greater than the network connection threshold 2000, then 1 container group can be scaled up within the unit time (e.g., 1 minute), that is, Container Group 3 is added; if the current number of network connections 1 of Container Group 1 is 1000 and the current number of network connections 2 of Container Group 2 is 800, both are less than the network connection threshold 2000, and both have remained for 5 minutes, then Container Group 2 can be deleted within the unit time (e.g., 1 minute).

[0151] In the embodiments of the present application, the server can determine the data collection time for collecting data from the target container group, and at the data collection time, request the target container group to obtain the current service information of the target container group, and then can scale the target container group up or down according to the current service information. Since the server can determine the data collection time to collect the current service information in a timely manner, the delay in collecting the service information is reduced, thereby improving the timeliness of scaling the container group up or down.

[0152] Next, based on the Figure 3 illustrated embodiment, in combination with Figure 4, the above container adjustment method will be further described.

[0153] Figure 4 It is a flowchart of another container adjustment method provided by an exemplary embodiment of this application. Please refer to Figure 4 , the method may include:

[0154] S401. Obtain the historical service information and historical scaling information of the target container group.

[0155] It should be noted that the execution process of step S401 can refer to step S301, which will not be elaborated here.

[0156] S402. Estimate the estimated service information of the target container group in the future period according to the historical service information.

[0157] The estimated service information may include the metric values of at least one service metric. For example, if there is a service metric of the number of network connections, the estimated service information may include the metric value of the number of network connections.

[0158] Optionally, the server may process the historical service information through a preset model to estimate the estimated service information of the target container group in the future period according to the historical service information. For example, the preset model may be a neural network model.

[0159] For example, if the target container group includes container group 1 and container group 2, and the historical service information is shown in Table 1, if the estimated service information includes 1 service metric of the number of network connections, the server may estimate the number of network connections at each future moment of container group 1 and container group 2 in the future period through the preset model according to the historical service information. Assuming the future period is 15:55 - 16:00, the estimated service information may be shown in Table 3:

[0160] Table 3

[0161]

[0162] S403. Determine the estimated scaling information of the target container group in the future period according to the historical scaling information.

[0163] The estimated scaling information may include the probability of scaling the target container group at each moment in the future period.

[0164] Optionally, the server may process the historical scaling information through a preset model to determine the estimated scaling information of the target container group in the future period according to the historical scaling information.

[0165] For example, if the historical scaling information is as shown in Table 2, the server can use a preset model to determine the probabilities of scaling the target container group at each future moment based on the historical scaling information. Suppose it can be as shown in Table 4:

[0166] Table 4

[0167] Future moment Scaling probability 15:45 80% 15:55 82% 16:00 91% …… ……

[0168] S404. Determine the data collection moment according to the estimated service information and the estimated scaling information.

[0169] In an alternative embodiment, the data collection moment can be determined according to the estimated service information and the estimated scaling information in the following manner: Determine M first moments according to the estimated service information; determine N second moments according to the estimated scaling information; determine the data collection moment according to the M first moments and the N second moments.

[0170] There exists an index value of a service index in the estimated service information at the first moment that is greater than or equal to the corresponding preset threshold, and M is an integer.

[0171] For example, if the service index is the number of network connections and the corresponding preset threshold is 2000, and if the estimated service information is as shown in Table 3, then since at the future moment 15:56, the number of network connections of container group 2 is 2000, which is equal to the corresponding preset threshold 2000, and at the future moment 15:57, the number of network connections of both container group 1 and container group 2 is greater than the corresponding preset threshold 2000, the future moments 15:56 and 15:57 can be determined as 2 first moments.

[0172] The probability of scaling the target container group at the second moment is greater than or equal to the preset probability, and N is an integer.

[0173] For example, if the estimated scaling information is as shown in Table 4 and the preset probability is 90%, then since the probability of scaling at the future moment 16:00 is 91%, which is greater than the preset probability 90%, the future moment 16:00 can be determined as 2 second moments.

[0174] In an alternative embodiment, the data collection moment can be determined according to the M first moments and the N second moments in the following manner: Determine the earliest moment among the M first moments and the N second moments as the target moment; determine the preset advance duration; determine the data collection moment according to the advance duration and the target moment.

[0175] The data collection moment can be before the target moment, and the time difference between the data collection moment and the target moment is equal to the advance duration. The advance duration can be preset manually.

[0176] For example, if there are two first moments which are future moments 15:56 and 15:57, and there is one second moment which is future moment 16:00, then the earliest moment 15:56 among these three moments can be determined as the target moment. If the advance duration is 1 minute, then the data collection moment can be determined as 15:55 according to the advance duration and the target moment 15:56.

[0177] In this application, through steps S401 to S405, the data collection moment can be determined according to historical service information and historical scaling information, so as to dynamically adjust the collection interval. When the index value of a certain service index fluctuates greatly, the collection interval can be shorter, and the frequency of collecting index values is high, thereby improving the accuracy of scaling based on multiple index values of the service index; when the change of a certain service index fluctuates little, the collection interval can be longer, and the frequency of collecting index values is low, which can reduce the energy consumption of the server. Since the data collection moment can be determined to achieve dynamic adjustment of the collection interval, compared with a fixed collection period, it can not only reduce the energy consumption of the server, but also improve the accuracy of scaling the target container group.

[0178] S405. Determine at least one service index and the data collection duration corresponding to each service index.

[0179] Optionally, for any service index, the service index can have a corresponding data collection duration. The data collection duration corresponding to each service index can be preset manually.

[0180] For example, if there are two service indexes, namely the number of network connections and the bandwidth rate, the server can determine the data collection duration 1 corresponding to the number of network connections and the data collection duration 2 corresponding to the bandwidth rate. Suppose the data collection duration 1 is 1 minute and the data collection duration 2 is 30 seconds.

[0181] S406. At the data collection moment, send a data collection request to the target container group through the collection component.

[0182] The data collection request can include at least one service index and the data collection duration corresponding to each service index.

[0183] For example, if the target container group includes container group 1 and container group 2, and if the data collection moment is 15:55, the server can send data collection request 1 to container group 1 and data collection request 2 to container group 2 through the collection component. If there is one service index which is the number of network connections and the corresponding data collection duration is 1 minute, both data collection request 1 and data collection request 2 can include the service index which is the number of network connections and the data collection duration of 1 minute.

[0184] S407. Receive the current service information sent by the target container group.

[0185] The current service information may include the metric values of each service metric within the corresponding data collection duration.

[0186] For example, if the service metric is the number of network connections, if the data collection duration is 1 minute, and if the target container group includes Container Group 1 and Container Group 2, then the current service information may include the metric values of the number of network connections corresponding to multiple collection moments within the data collection duration of 1 minute, as shown in Table 5:

[0187] Table 5

[0188]

[0189] Optionally, the current service information sent by the target container group can be received in the following manner: Through the acquisition component, receive multiple data streams sent by the target container group, where the data streams include the metric values of each service metric collected at at least one collection moment; among them, for any one data stream, the time difference between the moment when the target container group sends the data stream and the moment when the target container group collects the metric values in the data stream is less than or equal to the preset duration.

[0190] The time difference between the moment when the target container group sends the data stream and the moment when the target container group collects the metric values in the data stream is less than or equal to the preset duration. For example, the preset duration can be 5 seconds. After the target container group collects the last metric value, it can immediately send the data stream.

[0191] For example, if the current service information is as shown in Table 5, then through the acquisition component, receive Data Stream 1 sent by Container Group 1. Data Stream 1 may include the metric values 2000, 2100, and 2100 of the number of network connections collected at three collection moments, namely 15:55:15, 15:55:30, and 15:55:45; through the acquisition component, receive Data Stream 2 sent by Container Group 2. Data Stream 2 may include the metric values 2160, 2180, and 2200 of the number of network connections collected at three collection moments, namely 15:55:15, 15:55:30, and 15:55:45. If the moment when Container Group 1 collects the last metric value in the data stream is 15:55:45, then the moment when Container Group 1 sends Data Stream 1 can be 15:55:46, and the time difference between these two moments can be less than 5 seconds.

[0192] S408. Obtain the resource usage information of the target container group.

[0193] The resource usage information may include the resource occupancy rates corresponding to each resource type among multiple resource types.

[0194] The server can periodically collect the resource usage information of the target container group through a general collection component to obtain the resource usage information of the target container group.

[0195] For example, if the target container group includes Container Group 1 and Container Group 2, the resource usage information can be obtained as shown in Table 6:

[0196] Table 6

[0197]

[0198] S409. Perform scaling processing on the target container group according to the current business information and resource usage information.

[0199] In an optional embodiment, the scaling processing of the target container group can be performed according to the current business information and resource usage information in the following manner: for any business metric, determine the metric type of the business metric according to multiple metric values corresponding to the business metric in the current business information; for any resource type, determine the resource usage type corresponding to each resource type according to multiple resource occupancy information corresponding to each resource type in the resource usage information; if there is an abnormal type of business metric in the current business information and / or there is an abnormal type of resource type in the resource usage information, perform scaling processing on the target container group.

[0200] The metric type can be an abnormal type or a normal type. When the metric value of a business metric is greater than or equal to outside the corresponding preset range, it indicates that the metric value of the business metric is too low or too high, and then the metric type of the business metric can be determined as an abnormal type; when the metric value of a business metric is within the corresponding preset range, it indicates that the metric value of the business metric is within a suitable range, and then the metric type of the business metric can be determined as a normal type.

[0201] The resource usage type can be an abnormal type or a normal type. When the resource occupancy rate of a resource type is outside the corresponding preset range, it indicates that the resource occupancy rate of the resource type is too low or too high, and then the resource usage type of the resource type can be determined as an abnormal type; when the resource occupancy rate of a resource type is within the corresponding preset range, it indicates that the resource occupancy rate of the resource type is within a suitable range, and then the resource usage type of the resource type can be determined as a normal type.

[0202] Since for any business metric, there are multiple metric values corresponding to the business metric, the statistical value corresponding to the business metric can be determined according to the multiple metric values corresponding to the business metric, and then the metric type corresponding to the business metric can be determined according to the statistical value. Optionally, the statistical value can be the mean, maximum value, or minimum value of the multiple metric values corresponding to the business metric.

[0203] For example, if the current service information is as shown in Table 5, there is 1 service metric which is the number of network connections. If the corresponding preset range is [1800, 2000], and if the statistical value is the mean, then it can be determined that the mean number of network connections in Container Group 1 is 2066, which is outside the corresponding preset range. Thus, it can be determined that the metric type of the number of network connections in Container Group 1 is the abnormal type; it can be determined that the mean number of network connections in Container Group 2 is 2180, which is outside the corresponding preset range. Thus, it can be determined that the metric type of the number of network connections in Container Group 2 is the abnormal type.

[0204] Since for any one resource type, there should be multiple resource occupancy rates, the statistical value corresponding to this resource type can be determined according to the multiple resource occupancy rates corresponding to this resource type. Furthermore, the resource usage type corresponding to this resource type can be determined according to this statistical value. Optionally, the statistical value can be the mean, maximum value, or minimum value of the multiple resource occupancy rates corresponding to this resource type.

[0205] For example, if the current service information is as shown in Table 6, there are 2 resource types, namely the processor resource and the memory resource. For the processor resource, if the corresponding preset range is [85%, 90%], and if the statistical value is the mean, assuming it can be determined that the mean processor occupancy rate in Container Group 1 is 90.3%, which is outside the corresponding preset range, then it can be determined that the resource usage type of the processor resource in Container Group 1 is the abnormal type; assuming it can be determined that the mean processor occupancy rate in Container Group 2 is 90.6%, which is outside the corresponding preset range, then it can be determined that the resource usage type of the processor resource in Container Group 2 is the abnormal type. Similarly, for the memory resource, if the corresponding preset range is [80%, 85%], assuming it can be determined that the mean memory occupancy rate in Container Group 1 is 81.7%, which is within the corresponding preset range, then it can be determined that the resource usage type of the memory resource in Container Group 1 is the normal type; assuming it can be determined that the mean memory occupancy rate in Container Group 2 is 80.7%, which is within the corresponding preset range, then it can be determined that the resource usage type of the memory resource in Container Group 2 is the normal type.

[0206] Optionally, if there is a service metric of the abnormal type in the current service information, the server can determine whether the statistical value corresponding to this service metric is greater than the maximum value of the corresponding preset range. If so, the target container group can be expanded; if not, the target container group can be scaled down; and / or, if there is a resource type of the abnormal type in the resource usage information, the server can determine whether the statistical value corresponding to this resource type is greater than the maximum value of the corresponding preset range. If so, the target container group can be expanded; if not, the target container group can be scaled down.

[0207] For example, if in the current service information, the average number of network connections in container group 1 is 2066 and the average number of network connections in container group 2 is 2180, both of which are greater than the maximum value 2000 in the corresponding preset range [1800, 2000], it can be determined that the target container group needs to be scaled out, that is, add container 3; if the resource type with abnormal resource usage information is the processor type, since the average processor occupancy rate in container group 1 is 90.3% and the average processor occupancy rate in container group 2 is 90.6%, both of which are greater than the maximum value 90% in the corresponding preset range [85%, 90%], it can be determined that the target container group needs to be scaled out, that is, add container 3.

[0208] In the embodiments of the present application, the server can obtain the historical service information and historical scaling information of the target container group, and can estimate the estimated service information of the target container group in the future period according to the historical service information; it can determine the estimated scaling information of the target container group in the future period according to the historical scaling information, and then can determine the data collection moment according to the estimated service information and the estimated scaling information. The server can determine at least one service metric and the data collection duration corresponding to each service metric, and send a data collection request to the target container group at the data collection moment. The server can receive the current service information sent by the target container group and obtain the resource usage information of the target container group, and then can perform scaling processing on the target container group according to the current service information and the resource usage information. Since the server can determine the data collection moment to collect the current service information in a timely manner, the delay in collecting service information is reduced, thereby improving the timeliness of scaling the container group.

[0209] Next, in combination with Figure 5 , on the basis of any of the above embodiments, in combination with Figure 5 , the process of the above container adjustment method will be described in detail.

[0210] Figure 5 This is a schematic diagram of the process of a container adjustment method provided by an exemplary embodiment of the present application. Please refer to Figure 5 , the Kubernetes cluster includes an HPA component, a Kubernetes service component, a Prometheus collection component, a node management component, multiple container groups, and a collection component. Among them, the collection component can directly communicate with the container group through http.

[0211] In step ①, the server can determine the data collection moment and use the HPA component to send a data collection request to the collection component through the aggregation interface at the data collection moment; the server can also send a resource information acquisition request to the Kubernetes service component through the HPA component.

[0212] In step ②, after the acquisition component receives the data acquisition request, it can then send the data acquisition request to container group 1 and container group 2 to obtain the current business information respectively sent by container group 1 and container group 2. The current business information may include the metric values of each business metric within the corresponding data acquisition duration.

[0213] After the acquisition component obtains the current business information respectively sent by container group 1 and container group 2, it can send the current business information to the HPA component.

[0214] In step ③, the monitoring tool in the node management component can perform periodic acquisition on container group 1 and container group 2 to obtain the resource usage information of container group 1 and container group 2 and store it.

[0215] In step ④, the Kubernetes service component can send a request to the node management component to obtain the resource usage information. The node management component can send the resource usage information to the Kubernetes service component. Then, the Kubernetes service component can send the resource usage information to the HPA component through the aggregation interface so that the HPA component can obtain the resource usage information.

[0216] After the HPA component obtains the current business information and the resource usage information, it can perform scaling processing on the target container group according to the current business information and the resource usage information.

[0217] In the technical solution of this application, the process of asynchronously obtaining business metrics is changed into a synchronous query process. That is, the HPA component sends a data acquisition request to the acquisition component, and the acquisition component can directly obtain the current business information sent by the target container group. It is equivalent to that the HPA component can synchronously query the current business information, so that for custom business metrics, the latency of collecting business metrics is within 5 seconds; and by directly connecting the acquisition component to the container group to obtain business metric data (compatible with the Kubernetes metric data specification), custom metrics can be flexibly added.

[0218] In the embodiment of this application, since the data acquisition moment can be determined and the current business information of the target container group can be obtained in a timely manner at the data acquisition moment, compared with the related technology, multiple metric values of at least one business metric in the current business information are currently collected rather than collected at a historical moment, reducing the latency of obtaining business metrics; and by directly connecting the acquisition component to the container group to collect the business metrics of the target container group, there is no need to go through other monitoring components and service components, etc., the acquisition link becomes shorter, reducing network latency, thereby comprehensively improving the timeliness of scaling the container group.

[0219] Figure 6 It is a schematic structural diagram of a container adjustment device provided for an exemplary embodiment of this application. Please refer toFigure 6 , the container adjustment device 10 may include: a determination module 11, an acquisition module 12, and a processing module 13, where

[0220] the determination module 11 is configured to determine a data collection time for collecting data from a target container group, and the data collection time is the current time or a time after the current time;

[0221] the acquisition module 12 is configured to request the target container group to obtain the current service information of the target container group at the data collection time;

[0222] the processing module 13 is configured to perform scaling processing on the target container group according to the current service information.

[0223] The container adjustment device provided by the embodiments of the present application may execute the technical solutions shown in the above method embodiments, and its implementation principles and beneficial effects are similar, and will not be elaborated here.

[0224] In a possible implementation manner, the determination module 11 is specifically configured to:

[0225] acquire the historical service information and historical scaling information of the target container group;

[0226] determine the data collection time according to the historical service information and the historical scaling information.

[0227] In a possible implementation manner, the determination module 11 is specifically configured to:

[0228] estimate the estimated service information of the target container group in a future period according to the historical service information, where the estimated service information includes the index values of at least one service index;

[0229] determine the estimated scaling information of the target container group in the future period according to the historical scaling information, where the estimated scaling information includes the probability of scaling at each moment in the future period of the target container group;

[0230] determine the data collection time according to the estimated service information and the estimated scaling information.

[0231] In a possible implementation manner, the determination module 11 is specifically configured to:

[0232] determine M first moments according to the estimated service information, where there are index values of service indexes at the first moments in the estimated service information that are greater than or equal to the corresponding preset thresholds, and M is an integer;

[0233] Determine N second moments based on the estimated scaling information, where the probability of the target container group performing scaling at the second moment is greater than or equal to a preset probability, and N is an integer;

[0234] Determine the data collection moment according to the M first moments and the N second moments.

[0235] In a possible implementation manner, the determining module 11 is specifically configured to:

[0236] Determine the earliest moment among the M first moments and the N first moments as the target moment;

[0237] Determine a preset advance duration;

[0238] Determine the data collection moment according to the advance duration and the target moment. The data collection moment is before the target moment, and the time difference between the data collection moment and the target moment is equal to the advance duration.

[0239] In a possible implementation manner, the determining module 11 is specifically configured to:

[0240] Determine the data collection period corresponding to the target container group;

[0241] Determine the third moment when the target container group last performed data collection;

[0242] Determine the data collection moment according to the data collection period and the third moment. The duration between the third moment and the data collection moment is the duration corresponding to the data collection period.

[0243] In a possible implementation manner, the obtaining module 12 is specifically configured to:

[0244] Determine at least one business metric and the data collection duration corresponding to each business metric;

[0245] At the data collection moment, send a data collection request to the target container group. The data collection request includes the at least one business metric and the data collection duration corresponding to each business metric;

[0246] Receive the current business information sent by the target container group. The current business information includes the metric values of each business metric within the corresponding data collection duration.

[0247] In a possible implementation manner, applied to a server, a collection component is set in the server, and the collection component is directly connected to the target container group; the obtaining module 12 is specifically configured to:

[0248] At the data collection moment, send the data collection request to the target container group through the collection component.

[0249] In a possible implementation manner, the obtaining module 12 is specifically configured to:

[0250] Receive, through the collection component, a plurality of data streams sent by the target container group, where the data streams include metric values obtained by each service metric at at least one collection moment;

[0251] Wherein, for any one data stream, the time difference between the moment when the target container group sends the data stream and the moment when the target container group obtains the metric value in the data stream is less than or equal to a preset duration.

[0252] In a possible implementation manner, the processing module 13 is specifically configured to:

[0253] Obtain the resource usage information of the target container group;

[0254] Perform scaling processing on the target container group according to the current service information and the resource usage information.

[0255] In a possible implementation manner, the current service information includes multiple metric values corresponding to each service metric among at least one service metric, and the resource usage information includes resource occupancy information corresponding to each resource type among multiple resource types;

[0256] The processing module 13 is specifically configured to:

[0257] For any one service metric, determine the metric type of the service metric according to the multiple metric values corresponding to the service metric in the current service information, where the metric type is an abnormal type or a normal type;

[0258] For any one resource type, determine the resource usage type corresponding to each resource type according to the multiple resource occupancy rates corresponding to each resource type in the resource usage information, where the resource usage type is an abnormal type or a normal type;

[0259] If there is a service metric of abnormal type in the current service information, and / or, there is a resource type of abnormal type in the resource usage information, then perform scaling processing on the target container group.

[0260] The container adjustment device provided in the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, which will not be elaborated here.

[0261] An exemplary embodiment of the present application provides a schematic structural diagram of a server, please refer toFigure 7 The server 20 may include a processor 21 and a memory 22. Exemplarily, the processor 21, the memory 22, and each part are interconnected through a bus 23.

[0262] The memory 22 stores computer-executable instructions;

[0263] The processor 21 executes the computer-executable instructions stored in the memory 22, so that the processor 21 executes the method as shown in the above method embodiments.

[0264] Correspondingly, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the above method embodiments.

[0265] Correspondingly, an embodiment of the present application may also provide a computer program product, including a computer program, which when executed by a processor, can implement the method shown in the above method embodiments.

[0266] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) that contain computer-usable program code.

[0267] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the specified function in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0268] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the process in Figure 1 one process or multiple processes and / or blocksFigure 1 the functions specified in one or more boxes

[0269] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide for implementing the steps of the functions specified in one Figure 1 one process or more processes and / or boxes Figure 1 the steps of the functions specified in one or more boxes

[0270] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0271] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.

[0272] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.

[0273] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, commodity or device comprising the said element.

[0274] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various modifications and variations can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims

1. A container adjustment method, characterized in that, Including: Determine the data collection time for data collection of the target container group, where the data collection time is the current time or a time after the current time; At the data collection time, request the current service information of the target container group from the target container group; Perform scaling processing on the target container group according to the current service information.

2. The method according to claim 1, wherein Determining the data collection time for data collection of the target container group includes: Obtain the historical service information and historical scaling information of the target container group; Determine the data collection time according to the historical service information and the historical scaling information.

3. The method according to claim 2, wherein Determining the data collection time according to the historical service information and the historical scaling information includes: Estimate the estimated service information of the target container group in a future period according to the historical service information, where the estimated service information includes the index values of at least one service index; Determine the estimated scaling information of the target container group in the future period according to the historical scaling information, where the estimated scaling information includes the probability of scaling of the target container group at each moment in the future period; Determine the data collection time according to the estimated service information and the estimated scaling information.

4. The method according to claim 3, wherein Determining the data collection time according to the estimated service information and the estimated scaling information includes: Determine M first moments according to the estimated service information, where there is an index value of a service index at the first moment greater than or equal to the corresponding preset threshold, and M is an integer; Determine N second moments according to the estimated scaling information, where the probability of scaling of the target container group at the second moment is greater than or equal to a preset probability, and N is an integer; Determine the data collection time according to the M first moments and the N second moments.

5. The method according to claim 4, wherein Determining the data collection time according to the M first moments and the N second moments includes: Determine the earliest moment among the M first moments and the N first moments as the target moment; Determine a preset advance duration; Determine the data collection time according to the advance duration and the target moment, where the data collection time is before the target moment, and the time difference between the data collection time and the target moment is equal to the advance duration.

6. The method according to claim 1, characterized in that, Determining the data collection time for data collection of the target container group includes: Determine the data collection period corresponding to the target container group; Determine the third moment when the target container group was last data collected; Determine the data collection time according to the data collection period and the third moment, where the duration between the third moment and the data collection time is the duration corresponding to the data collection period.

7. The method according to any one of claims 1-6, characterized in that, At the data collection time, requesting the current service information of the target container group from the target container group includes: Determine at least one service index and the data collection duration corresponding to each service index; At the data collection moment, send a data collection request to the target container group, where the data collection request includes the at least one service metric and the data collection duration corresponding to each service metric; Receive the current service information sent by the target container group, where the current service information includes the metric values of each service metric within the corresponding data collection duration.

8. The method according to claim 7, wherein Applied to a server, where a collection component is set in the server, and the collection component is directly connected to the target container group; At the data collection moment, sending a data collection request to the target container group includes: At the data collection moment, send the data collection request to the target container group through the collection component.

9. The method according to claim 8, wherein Receiving the current service information sent by the target container group includes: Through the collection component, receive multiple data streams sent by the target container group, where the data streams include the metric values of each service metric collected at at least one collection moment; Wherein, for any one data stream, the time difference between the moment when the target container group sends the data stream and the moment when the target container group collects the metric values in the data stream is less than or equal to a preset duration.

10. The method according to any one of claims 1-9, characterized in that, According to the current service information, perform scaling processing on the target container group, including: Obtain the resource usage information of the target container group; According to the current service information and the resource usage information, perform scaling processing on the target container group.

11. The method according to claim 10, characterized in that, The current service information includes multiple metric values corresponding to each service metric among at least one service metric, and the resource usage information includes the resource occupancy information corresponding to each resource type among multiple resource types; According to the current service information and the resource usage information, performing scaling processing on the target container group includes: For any one service metric, determine the metric type of the service metric according to the multiple metric values corresponding to the service metric in the current service information, where the metric type is an abnormal type or a normal type; For any one resource type, determine the resource usage type corresponding to each resource type according to the multiple resource occupancy rates corresponding to each resource type in the resource usage information, where the resource usage type is an abnormal type or a normal type; If there is a service metric of abnormal type in the current service information, and / or there is a resource type of abnormal type in the resource usage information, then perform scaling processing on the target container group.

12. A container adjusting device, characterized in that, Includes: A determination module, an acquisition module, and a processing module, where The determination module is used to determine the data collection moment for collecting data from the target container group, and the data collection moment is the current moment or a moment after the current moment; The acquisition module is used to request and obtain the current service information of the target container group from the target container group at the data collection moment; The processing module is used to perform scaling processing on the target container group according to the current service information.

13. A server, characterized in that, Includes: At least one processor; And A memory communicatively connected to the at least one processor; Wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to cause the server to execute the method according to any one of claims 1-11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1-11 is implemented.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the method according to any one of claims 1-11 is implemented.