Instance adjustment method and device, electronic equipment and storage medium

By predicting load data and using a dynamic adjustment mechanism, the latency problem of instance resource management in high-concurrency scenarios is solved, achieving efficient and flexible resource management and improving service performance and user experience.

CN120994381APending Publication Date: 2025-11-21JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511105709.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-07
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

In high-concurrency, large-scale scenarios, threshold-based reactive scaling strategies lead to delays in expansion operations, failing to provide computing resources in a timely manner, thus affecting service performance and user experience.

Method used

By analyzing the load data of the target instance at N first time steps, the load data of the future second time step is predicted, and the instances in the target shard are adjusted based on the actual load data and historical data. Dynamic resource management is achieved by adopting a hash ring and independent controller management mechanism.

Benefits of technology

It enables efficient, flexible and precise resource management under high concurrency, large-scale and sudden load scenarios, improves the response speed and adaptability of instance adjustment, and avoids resource shortage and waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994381A_ABST
    Figure CN120994381A_ABST
Patent Text Reader

Abstract

The invention discloses an instance adjustment method and device, electronic equipment and a storage medium, and relates to the technical field of computers, and the method comprises the steps: firstly, analyzing first load data of a target instance in N first time steps, predicting second load data of the target instance in a second time step in the future, and predicting third load data of a target fragment, and finally, adjusting the target fragment based on the actual load data, the predicted third load data and the historical first load data. According to the dynamic adjustment mechanism based on prediction analysis and real-time feedback of the historical load data, efficient, flexible and accurate resource management can be performed on the fragments in high-concurrency, large-scale and burst load scenes, so that the technical problem that instances cannot be efficiently adjusted in related technologies is solved, and the user experience is improved. The technical effect of efficiently adjusting the instances is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to an instance adjustment method and device, electronic equipment and storage medium. BACKGROUND

[0002] As a distributed computing unit composed of multiple instances in a distributed service architecture, the scalable group carries the task of dynamically managing computing resources to cope with changing load demands.

[0003] In a high-concurrency and large-scale scenario, the load changes exceptionally rapidly, and the responsive scaling strategy based on a threshold relies on lagging indicators to trigger scaling operations, resulting in a delay in scaling operations and an inability to provide the required computing resources in a timely manner, which affects service performance and user experience, and there is a technical problem of inefficient adjustment of instances. SUMMARY

[0004] The present application provides an instance adjustment method and device, electronic equipment and storage medium to at least solve the technical problem of inefficient adjustment of instances in related technologies, and achieves the technical effect of efficient adjustment of instances.

[0005] The present application provides an instance adjustment method, comprising: determining second load data of a target instance at a second time step based on N first load data of the target instance at N first time steps, wherein the first load data is load data under a target resource dimension, the second time step is a future time step, and N is an integer greater than 0; determining third load data of a target shard at the second time step based on the second load data, wherein the target shard includes at least one target instance; and adjusting the target instance included in the target shard at a third time step based on N first load data, the third load data and fourth load data, wherein the fourth load data is actual load data of the instance at the third time step, and the third time step is a time step corresponding to the current time between the second time step and the second time step.

[0006] The application further provides an example adjustment device, comprising: a first determination module configured to determine second load data of a target instance at a second time step based on N first load data of the target instance at N first time steps, wherein the first load data is load data under a target resource dimension, the second time step is a future time step, and N is an integer greater than 0; a second determination module configured to determine third load data of a target shard at the second time step based on the second load data, wherein the target shard comprises at least one target instance; and a first adjustment module configured to adjust the target instance included in the target shard at a third time step based on N first load data, the third load data, and fourth load data, wherein the fourth load data is actual load data of the instance at the third time step, and the third time step is a time step corresponding to a current time between the second time step and the second time step.

[0007] The application further provides an electronic device, comprising: a memory configured to store a computer program; and a processor configured to execute the computer program to implement the steps of the adjustment method of any of the shards.

[0008] The application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the adjustment method of any of the examples.

[0009] The application further provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the steps of the adjustment method of any of the examples.

[0010] According to the application, first load data of a target instance at N first time steps is analyzed, second load data of the target instance at a future second time step is predicted to predict third load data of a target shard, and finally, instances in the target shard are adjusted based on actual load data, predicted third load data, and historical first load data. This dynamic adjustment mechanism based on prediction analysis of historical load data and real-time feedback can efficiently, flexibly, and accurately manage resources of instances in the face of high concurrency, large scale, and sudden load scenarios, thereby solving the technical problem that instances cannot be efficiently adjusted in the related art and achieving the technical effect of efficiently adjusting instances. BRIEF DESCRIPTION OF DRAWINGS

[0011] To more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative effort.

[0012] Figure 1 A hardware structure block diagram of a mobile terminal for an example of the adjustment method provided by an embodiment of the present application is shown in FIG. 1.

[0013] Figure 2 A flow chart of the adjustment method for an example of an embodiment of the present application is shown in FIG. 2.

[0014] Figure 3 An architecture diagram of the adjustment method for an example of an embodiment of the present application is shown in FIG. 3.

[0015] Figure 4 A flow chart of the adjustment method for an example of an embodiment of the present application is shown in FIG. 4.

[0016] Figure 5 A structure schematic diagram of the adjustment device for an example of an embodiment of the present application is shown in FIG. 5. DETAILED DESCRIPTION

[0017] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, any other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0018] It should be noted that, in the description of the present application, the terms "comprise", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0019] In order for those skilled in the art to better understand the technical solutions of the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0020] In combination with a specific application environment architecture or a specific hardware architecture on which the execution of the adjustment method of an example depends, the specific application environment architecture or the specific hardware architecture is described herein.

[0021] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking the execution on a mobile terminal as an example, Figure 1 A hardware structure block diagram of a mobile terminal for an example of the adjustment method provided by an embodiment of the present application is shown in FIG. 1. Figure 1 As shown in FIG. 1, the mobile terminal can include one or moreFigure 1 The mobile terminal can further include a transmission device 106 for communication function and an input / output device 108. Those skilled in the art can understand that the mobile terminal can further include more or less components than those shown in the figure, or have different configuration from that shown in the figure. Figure 1 The structure shown in the figure is only for illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal can further include more or less components than those shown in the figure, or have different configuration from that shown in the figure. Figure 1 The structure shown in the figure is only for illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal can further include more or less components than those shown in the figure, or have different configuration from that shown in the figure. Figure 1 The structure shown in the figure is only for illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal can further include more or less components than those shown in the figure, or have different configuration from that shown in the figure.

[0022] The memory 104 can be used to store computer programs, such as software programs of application software and modules, such as a computer program corresponding to the adjustment method of an example of an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, implements the method described above. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, and these remote memories can be connected to the mobile terminal through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0023] The transmission device 106 is used to receive or send data via a network. Specific examples of the network can include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.

[0024] The embodiment of the present application provides an adjustment method of an example, Figure 2 A flowchart of the adjustment method of an example of an embodiment of the present application is shown in the figure, and the flow includes the following steps: Figure 2 The flowchart of the adjustment method of an example of an embodiment of the present application is shown in the figure, and the flow includes the following steps:

[0025] In step S202, the second load data of the target instance at a second time step is determined based on N first load data of the target instance at N first time steps, wherein the first load data is load data under a target resource dimension, the second time step is a future time step, and N is an integer greater than 0.

[0026] Optionally, the target instance is an independent computing entity running services in the scaling group, responsible for processing part of the workload, which can be either a container or a virtual machine. The target instance has multiple resource dimensions, including but not limited to Central Processing Unit (CPU), memory, network bandwidth. The load data under each resource dimension reflects the resource usage of the target instance at a specific time point.

[0027] Optionally, the first time step is a historical time step, a fixed time interval for collecting load data, for example, collecting load data every 5 minutes, then at the current time point T, T-5 minutes, T-10 minutes, T-15 minutes, etc. are the first time step.

[0028] Optionally, the first load data is data collected from the target instance within the first time step, reflecting the use of a specific resource dimension. For example, in the first time step T-5 minutes, the CPU utilization data collected from the target instance C1 is 80%; in the first time step T-10 minutes, the CPU utilization data collected from the target instance C1 is 70%; in the first time step T-15 minutes, the CPU utilization data collected from the target instance C1 is 60%; these are the first load data, which is instance-level load data.

[0029] Optionally, the second time step is a future time point or time range, for example, the target is to predict the load situation 30 minutes later, then at the current time point T, T+30 minutes is the second time step. Based on the N first load data of the target instance C1 at T-5 minutes, T-10 minutes, T-15 minutes, etc. N first time steps, predict its second load data at T+30 minutes.

[0030] Step S204, determining the third load data of the target shard at the second time step based on the second load data, wherein the target shard includes at least one of the target instances.

[0031] Optionally, the target shard is any of the multiple initial shards obtained by dividing the multiple instances (including but not limited to the target instance) in the scaling group. Each shard is managed by an independent controller, aiming to improve the overall scalability and response speed of the system through parallel operation.

[0032] Optionally, the third load data is the expected load data of the entire target shard at the second time step, calculated based on the second load data (i.e. the predicted load data of the target instance at the second time step). It reflects the comprehensive resource demand prediction of all instances in the target shard, and is shard-level load data.

[0033] In step S206, the target instance included in the target shard is adjusted based on the N first load data, the third load data, and fourth load data at a third time step, wherein the fourth load data is actual load data of the instance at the third time step, and the third time step is a time step corresponding to a current time between the second time step and the second time step.

[0034] Optionally, the third time step refers to a time point currently being experienced, for example, a current time point is defined as T, then T is the third time step, and the fourth load data is collected at this time point, and the resource configuration of the target shard is adjusted according to the first load data and the third load data.

[0035] Optionally, the fourth load data is actual load data of the target instance at the third time step, for example, the CPU utilization of the target instance C1 at this time is 75%, and the instant load data is the fourth load data.

[0036] Optionally, the first load data, the second load data, the third load data, and the fourth load data are all load data of the target resource dimension.

[0037] The execution subject of the above steps in the embodiment can be a hardware or software processor, an agent device, a management device, etc. The execution subject of the above steps can also be a terminal, a server, a specific processor arranged in the terminal or the server, or a processor or processing device arranged independently of the terminal or the server, but is not limited thereto.

[0038] According to the embodiment of the present application, first, the first load data of the target instance in N first time steps is analyzed, the second load data of the target instance in a future second time step is predicted, the third load data of the target shard is predicted, and finally, the instance in the target shard is adjusted based on the actual load data, the predicted third load data, and the historical first load data. This dynamic adjustment mechanism through prediction analysis and real-time feedback of historical load data can efficiently, flexibly, and accurately manage the resources of the instance in the face of high concurrency, large-scale, and burst load scenarios. Therefore, the technical problem of being unable to efficiently adjust the instance in the related art is solved, and the technical effect of efficiently adjusting the instance is achieved.

[0039] In an example embodiment, before determining the N second load data of the target instance at the second time step based on the N first load data of the target instance at N first time steps under the target resource dimension, the method further comprises: mapping the plurality of instances included in the scaling group to a hash ring based on the identities of the plurality of instances, wherein the plurality of instances include the target instance, and one instance corresponds to one hash value in the hash ring; dividing the plurality of instances in the hash ring into a plurality of initial shards, wherein at least one instance is included in one initial shard; determining a target shard from the plurality of initial shards, wherein the target instance is included in the target shard; and obtaining the load data of the target instance through a controller corresponding to the target shard to obtain the N first load data.

[0040] Optionally, the hash ring is a technical means for load balancing and data distribution in distributed computing, which maps resources or requests to a virtual ring structure through a hash function to ensure uniform distribution of resources and efficient access. For example, the scaling group includes instances C1, C2, C3, C4, and C5, and the identities of these instances are mapped to a hash ring in a ring structure through a consistent hashing algorithm, and each instance corresponds to a specific point on the ring, i.e., a hash value. The identity of the instance is used to uniquely identify the instance, including but not limited to an instance identifier (Identifier, abbreviated as ID), an Internet Protocol Address (Internet Protocol Address, abbreviated as IP address).

[0041] Optionally, the initial shard is a logical unit in which the plurality of instances in the scaling group are divided based on the hash ring, and each shard is managed by an independent controller. For example, in the hash ring, according to the consistent hashing algorithm, instances C1 to C5 can be divided into 3 initial shards, such as shard A (including C1 and C2), shard B (including C3), and shard C (including C4 and C5), and the instances in each shard will be managed by a specific controller for health check, resource monitoring, and scaling operation.

[0042] Optionally, the target shard can be any of the initial shards in the scaling group, or a specific shard in the initial shards in the scaling group that needs to be monitored, for example, shard A, shard B, and shard C can all be target shards. For example, if instance C1 is a target instance that needs to be monitored for load data, then shard A (which includes C1) is the target shard, and the load data of C1 will be obtained through the controller managing shard A.

[0043] Optionally, the controller is the component responsible for managing instances within a specific shard. It performs tasks such as health checks, resource monitoring, and instance scheduling. Controllers operate in parallel, enabling the control plane to scale linearly with the number of shards. Each controller handles only a subset of instances. To ensure high availability, the controllers for each shard are designed in a master-slave mode. Figure 3 As shown, in shard A, there is a controller 1, which is responsible for monitoring and managing the running status of instance 1 and instance 2, including collecting their load data at various time steps, such as CPU utilization, memory utilization, etc., caching the load data locally, and saving the load data to the database.

[0044] This embodiment maps instances to a hash ring and divides them into multiple initial shards, each managed by an independent controller. As the scaling group grows, the number of shards and controllers can be dynamically adjusted without significantly impacting overall performance, thus enhancing the scalability of the scaling group. Furthermore, since each shard is managed by an independent controller, each controller only needs to focus on the instances within its assigned shard, reducing the need to check all instances each time, shortening the polling cycle, and thereby accelerating fault response and resource adjustment.

[0045] In an exemplary embodiment, determining N second load data of the target instance at a second time step based on N first load data of the target instance at N first time steps under the target resource dimension includes: extracting fifth load data from the N first load data, wherein the fifth load data is load data greater than a first preset threshold among the N first load data, and the time step corresponding to the fifth load data is any time step among the N first time steps; and determining the fifth load data as the second load data.

[0046] Optionally, the fifth load data can be the maximum load data in the first load data or the average load data in the first load data. Therefore, the first preset threshold can be flexibly set according to actual needs.

[0047] Optionally, the first load data of the target instance over the most recent N first time steps is collected, and the maximum value among them (i.e., the fifth load data) is selected as the predicted load data of the target instance for the next time step in the target resource dimension (i.e., the second load data). in, Let N be the load data of target instance i at time step t and resource dimension k; N is the size of the time window. In rapidly changing scenarios, a smaller value of N can be selected, and the prediction results will be more sensitive to recent load changes. In scenarios with smooth load fluctuations, a larger value of N can be selected, and the prediction results will be relatively more stable and suitable.

[0048] The embodiment focuses on identifying the time steps with abnormally high load under the target resource dimension, i.e., the fifth load data, which reflects the condition that the resource usage reaches or exceeds the first preset threshold in a specific time period. Since the abnormally high load data often indicates the high demand that may occur in the future, using these data as the prediction basis for the second time step can more accurately predict the resource demand and avoid the risk of underestimating the real load situation caused by the prediction based on the average value or a single indicator.

[0049] In an example embodiment, determining the third load data of the target shard at the second time step based on the second load data comprises: calculating a load data sum value of the target instances based on the second load data, wherein the load data sum value is the sum value of the second load data of one or more target instances included in the target shard; and determining the load data sum value as the third load data.

[0050] Optionally, the third load data is the sum of the second load data of all target instances included in the target shard to obtain the shard-level load data. For example, a distributed scaling group is being managed, which is divided into multiple shards, each shard contains several instances such as containers or virtual machines, the target shard refers to a specific shard containing target instances, and the target resource dimension is CPU utilization. For the sake of simplicity, there are only three target instances in the target shard: instance A, instance B, and instance C. First, N first load data of the target instances under the target resource dimension (such as CPU utilization) are collected. Second, for instance A, the CPU utilization data in the N first time steps include: 70%, 80%, 85%, 90%, 92%. By analyzing the N first load data, it is determined that the second load data of instance A at the second time step is: 92% (which is the only load data exceeding the first preset threshold of 90% in the N first time steps). For instance B and instance C, through similar analysis process, the second load data at the second time step is: 88% and 95% respectively. Third, before the second time step arrives, the third load data of the target shard is calculated based on the second load data of the target instances: instance A, instance B, and instance C. Specifically, the CPU utilization prediction value (third load data) of the target shard is the sum of the second load data of instances A, B, and C. In this example, the third load data is: 92% + 88% + 95% = 275%.

[0051] The embodiment calculates the third load data by aggregating the second load data of the target instances in the target shard, which can implement efficient resource allocation strategy based on these predictions, and achieve the purpose of cost optimization in large-scale, high-concurrency distributed service management.

[0052] In an example embodiment, after determining the third load data of the target shard at the second time step based on the second load data, the method further comprises: calculating a ratio of the third load data to a resource capacity between the target instances, to obtain a first capacity, wherein the first capacity is used to represent a number of target instances allowed to be accommodated by the target shard under a target resource dimension; determining a target capacity from a plurality of second capacities corresponding to the resource dimension of the target shard, wherein the target capacity is a capacity in the plurality of second capacities that is less than a second preset threshold, the second capacity includes the first capacity, and the target capacity is used to represent a number of target instances allowed to be accommodated by the target shard at the third time step.

[0053] Optionally, the resource capacity between the target instances can be an average resource capacity of the resource capacities of the plurality of target instances, or can be a maximum resource capacity in the resource capacities of the plurality of target instances. Specifically, the first capacity N is determined by the following formula: k : Wherein, L k (t+1) is the third load data under the target resource dimension, C k is the resource capacity between the target instances, and C k is an average resource capacity of the resource capacities of the plurality of target instances. The resource dimensions include the target resource dimension, and the target capacity can be a second capacity with the smallest capacity in a plurality of second capacities corresponding to the resource dimensions, or can be an average capacity of the plurality of second capacities, or can be a median capacity in the plurality of second capacities. Therefore, the second preset threshold can be flexibly set according to actual needs. For example, the first capacity (also the second capacity) corresponding to the target resource dimension CPU utilization rate is 9, the second capacity corresponding to the resource dimension bandwidth is 7, and the second capacity corresponding to the resource dimension memory utilization rate is 8. Therefore, the target capacity can be 7 or 8.

[0054] In an example embodiment, based on the N first load data, the third load data, and the fourth load data, the target instances included in the target shard are adjusted at the third time step, comprising: calculating a target average load change rate of the target shard within the N first time steps based on the N first load data; calculating a target load difference between the load data of the future time step and the actual load data based on the third load data and the fourth load data; and generating an adjustment signal to adjust the target instances included in the target shard based on the target average load change rate and the target load difference.

[0055] Optionally, the target average load change rate R k is calculated by the following formula: Wherein, T is the time step window size of the trend analysis, generally T=N. The target load difference ΔL k is calculated by the following formula: ΔL k = L k (t+1)-Lk (t), wherein L k (t+1) is the third load data, L k (t) is the fourth load data.

[0056] The embodiment can make resource adjustment decisions in advance of the second time step by calculating the target average load change rate and the target load difference, without waiting until the actual load surges to make a response, thereby achieving proactive management of resources and improving the response speed and adaptability of instance adjustment.

[0057] In one example embodiment, based on the target average load change rate and the target load difference, an adjustment signal is generated to adjust target instances included in a target shard, including one of: in the case that the target average load change rate or the target load difference is greater than zero, generating a first adjustment signal to instruct a controller corresponding to the target shard to migrate M target instances included in the target shard to a first shard, wherein the first shard is a shard with an average load change rate and a load difference less than zero; in the case that the target average load change rate and the target load difference are less than zero, generating a second adjustment signal to instruct a controller corresponding to a second shard to migrate M target instances included in the second shard to the target shard, wherein the second shard is a shard with an average load change rate or a load difference greater than zero; wherein the value of M is a value determined based on the target capacity.

[0058] Optionally, the first adjustment signal is generated in the case that the target average load change rate or the target load difference is greater than zero, instructing the target shard (a shard with an upcoming increase in load) to migrate M target instances to a first shard (a shard with a predicted decrease in load), and the signal is used to balance resource load and prevent resource shortage in the target shard. For example, when the average load change rate of the target shard is 5% and the target load difference is 20%, it indicates that the resource demand of the target shard is increasing, and at this time the first adjustment signal is generated, instructing the migration of 3 instances in the target shard to a first shard, which is shown in the previous analysis to have an average load change rate and a load difference less than zero, indicating that it is relatively abundant in resources.

[0059] Optionally, the second adjustment signal is generated in the case that the target average load change rate and the target load difference are less than zero, instructing the migration of M target instances in a second shard (a shard with excess resources) to a target shard (a shard that may be short of resources), and the signal is used to optimize resource allocation and avoid resource waste. For example, if the average load change rate of the target shard is -5% and the target load difference is -15%, it indicates that the resource demand of the target shard is decreasing, and at this time the second adjustment signal is generated, instructing the migration of 3 instances from a second shard (which has an average load change rate of 8% and a load difference of 25%, indicating an increase in resource demand) to the target shard to optimize resource distribution and meet the dynamic changes in resource demand.

[0060] Optionally, the value of M refers to the number of target instances that need to be migrated in the adjustment signal, which is determined based on the target capacity to ensure that the target shard can still maintain the required resource capacity after adjustment to cope with future load changes. The way to determine the value of M includes but is not limited to direct difference determination, machine learning prediction model determination. Among them, the direct difference determination: directly determine the value of M according to the difference between the target capacity and the current instance number, for example, the target capacity is X, and the current instance number is Y, then M = X-Y, M is positive, indicating that the instance needs to be increased; M is negative, indicating that the instance needs to be reduced. Among them, the machine learning prediction model determination: train a machine learning model using historical data, determine the value of M according to the gap between the target capacity predicted by the model and the current instance number, and combine other influencing factors.

[0061] The embodiment can allocate instances in the shard with excess resources to the shard with rising demand by generating the first adjustment signal and the second adjustment signal to migrate instances, which helps to dynamically balance resources among different shards, ensures that the resource utilization rate of each shard remains within a reasonable range, avoids local tension and waste of resources, and improves the overall resource utilization rate.

[0062] The application will be described in conjunction with specific embodiments as follows:

[0063] The embodiment takes a central coordinator designed on top of each controller as an example for illustration. As shown in FIG. 1, the central coordinator is in a master-backup mode, and is mainly used for shard division of all instances in the scalable group, maintenance of the instance view between instances and shards, monitoring of load data, coordination and maintenance of the relationship between controllers, and distribution of configuration changes to the controller, such as adjustment signals or load data checking parameters. Figure 3 As shown in FIG. 2, the flowchart of the adjustment method of one example of the specific embodiment of the application includes the following steps: Figure 4 As shown in FIG. 2, the flowchart of the adjustment method of one example of the specific embodiment of the application includes the following steps: Figure 4

[0064] ​S402, the central coordinator maps the identifiers of all instances in the scalable group to a consistent hashing ring through a consistent hashing algorithm, and assigns an independent controller to each shard. Each controller only processes part of the instances, mainly performs tasks such as load checking, resource monitoring, instance scheduling, and the like, and the controllers operate in parallel, so that the control plane can be linearly expanded with the number of shards. To ensure high availability, the controllers of each shard are designed in a master-slave mode. Each controller has a long connection with the instances in its shard to monitor the load state of the instances in real time, and caches the monitored load data locally. Each controller periodically synchronizes the instance load data to a distributed key-value store (such as a key-value store system or a database), wherein the specific key-value pairs include but are not limited to the unique identifier of the scalable group, the identifier of the controller, the unique identifier of the instance in the scalable group, and the specific load data: CPU utilization, memory usage.

[0065] S404, the central coordinator collects the first load data of the target instance in the last N first time steps from the database, and selects the maximum value (i.e., the fifth load data) as the predicted load data (i.e., the second load data) of the target instance in the next time step in the target resource dimension, that is, wherein, is the load data of the target instance i in the time step t in the resource dimension k; N is the time step window size, in a fast changing scenario, a smaller N value can be selected, and the prediction result will be more sensitive to the recent load change, and in a smooth load fluctuation scenario, a larger N value can be selected, and the prediction result is relatively more stable.

[0066] S406, the second load data of all target instances included in the target shard is added to obtain the third load data at the shard level.

[0067] S408, the central coordinator determines the first capacity N k : wherein, L k (t+1) is the third load data in the target resource dimension, C k is the resource capacity between the target instances, and C k is the average resource capacity of the resource capacities of the plurality of target instances. The second capacity with the smallest capacity among the plurality of second capacities corresponding to the resource dimension is determined as the target capacity.

[0068] The central coordinator calculates the target average load change rate R k : wherein, T is the time step window size of the trend analysis, generally T=N. The target load difference ΔL k is calculated by the following formula: ΔL k = L k(t+1)-L k (t), wherein, L k (t+1) is the third load data, L k (t) is the fourth load data. If ΔL k > 0 or R k > 0, indicating that the load rises, the central coordinator generates a first adjustment signal based on the target capacity, and sends the first adjustment signal to the controller corresponding to the target shard to trigger the expansion of the shard in the scalable group. If ΔL k < and R k < 0, indicating that the load drops, the central coordinator generates a second adjustment signal based on the target capacity, and sends the second adjustment signal to the controller corresponding to the target shard to trigger the contraction of the shard in the scalable group.

[0069] S410, the controller receives the adjustment signal, and migrates the instances in the shard managed by the controller based on the value of M carried in the adjustment signal, and updates the instance view of the relationship between the controller and the instances.

[0070] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment.

[0071] The embodiments of the present application also provide an instance adjustment device, as shown in Figure 5 , comprising:

[0072] The first determination module 502 is configured to determine the second load data of the target instance at the second time step based on the N first load data of the target instance at N first time steps, wherein the first load data is the load data under the target resource dimension, the second time step is a future time step, and N is an integer greater than 0;

[0073] The second determination module 504 is configured to determine the third load data of the target shard at the second time step based on the second load data, wherein the target shard includes at least one target instance;

[0074] The first adjustment module 506 is configured to adjust the target instances included in the target shard at the third time step based on the N first load data, the third load data, and the fourth load data, wherein the fourth load data is the actual load data of the instance at the third time step, and the third time step is a time step corresponding to the current time between the second time step and the second time step.

[0075] In an example embodiment, the apparatus further includes: a first mapping module configured to, before determining the N second load data of the target instance at the second time step based on the N first load data of the target instance at the N first time steps in the target resource dimension, map a plurality of instances included in the stretch group to a hash ring based on identifiers of the plurality of instances, wherein the plurality of instances include the target instance, and one instance corresponds to one hash value in the hash ring; a first dividing module configured to divide the plurality of instances in the hash ring into a plurality of initial shards, wherein at least one instance is included in one initial shard; a third determining module configured to determine a target shard from the plurality of initial shards, wherein the target instance is included in the target shard; and a first obtaining module configured to obtain the load data of the target instance through a controller corresponding to the target shard to obtain the N first load data.

[0076] In an example embodiment, the first determining module 502 includes: a first extracting submodule configured to extract a fifth load data from the N first load data, wherein the fifth load data is a load data greater than a first preset threshold in the N first load data, and the time step corresponding to the fifth load data is any time step in the N first time steps; and a first determining submodule configured to determine the fifth load data as the second load data.

[0077] In an example embodiment, the second determining module 504 includes: a first calculating submodule configured to calculate a load data sum and a value of the target instance based on the second load data, wherein the load data sum and the value are a sum of the second load data of one or more target instances included in the target shard; and a second determining submodule configured to determine the load data sum and the value as the third load data.

[0078] In an example embodiment, the apparatus further includes: a first calculating module configured to, after determining the third load data of the target shard at the second time step based on the second load data, calculate a ratio of a resource capacity between the third load data and the target instance to obtain a first capacity, wherein the first capacity is used to represent a number of the target instance allowed to be accommodated by the target shard in the target resource dimension; and a fourth determining module configured to determine a target capacity from a plurality of second capacities corresponding to the resource dimension in the target shard, wherein the target capacity is a capacity less than a second preset threshold in the plurality of second capacities, the second capacity includes the first capacity, and the target capacity is used to represent a number of the target instance allowed to be accommodated by the target shard in the third time step.

[0079] In an example embodiment, the first adjusting module 506 includes: a second calculating submodule configured to calculate a target average load change rate of the target shard in the N first time steps based on the N first load data; a third calculating submodule configured to calculate a target load difference between the load data of the future time step and the actual load data based on the third load data and the fourth load data; and a first generating submodule configured to generate an adjusting signal to adjust the target instances included in the target shard based on the target average load change rate and the target load difference.

[0080] In an example embodiment, the first generating submodule includes one of: a first generating unit configured to generate a first adjusting signal to instruct a controller corresponding to the target shard to migrate M target instances included in the target shard to a first shard in a case where the target average load change rate or the target load difference is greater than zero, wherein the first shard is a shard with a load change rate and a load difference less than zero; and a second generating unit configured to generate a second adjusting signal to instruct a controller corresponding to a second shard to migrate M target instances included in the second shard to the target shard in a case where the target average load change rate and the target load difference are less than zero, wherein the second shard is a shard with a load change rate or a load difference greater than zero; wherein the value of M is a value determined based on the target capacity.

[0081] The features of the embodiments of the adjusting device can be understood with reference to the related descriptions of the embodiments of the adjusting method, which will not be repeated here.

[0082] Embodiments of the present application also provide an electronic device including a memory and a processor, the memory storing a computer program, and the processor being configured to execute the computer program to perform the steps in the embodiments of the adjusting method of any of the examples.

[0083] Embodiments of the present application also provide a computer readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in the embodiments of the adjusting method of any of the examples when executed.

[0084] In an example embodiment, the computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0085] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program realizes the steps in the adjustment method embodiment of any one of the examples when executed by a processor.

[0086] The embodiment of the present application further provides another computer program product, which comprises a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program realizes the steps in the adjustment method embodiment of any one of the examples when executed by a processor.

[0087] Those skilled in the art can further understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been described in the above description in general terms. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0088] The adjustment method of one example provided by the present application is described in detail above. The principles and implementation manners of the present application are described by applying specific examples herein, and the above description of the examples is only used to help understand the method of the present application and its core idea. It should be pointed out that, for those skilled in the art, some improvements and modifications can be made to the present application without departing from the principles of the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. An adjustment method of an instance, characterized by, The method comprises the following steps: determining second load data of a target instance at a second time step based on N first load data of the target instance at N first time steps in a target resource dimension, wherein the first load data is load data in the target resource dimension, the second time step is a future time step, and N is an integer greater than 0; determining third load data of a target shard at the second time step based on the second load data, wherein the target shard comprises at least one target instance; adjusting the target instance included in the target shard at a third time step based on N first load data, the third load data and fourth load data, wherein the fourth load data is actual load data of the instance at the third time step, and the third time step is a time step corresponding to a current time between the second time step and the second time step.

2. The method of claim 1, wherein, Before determining N second load data of a target instance at a second time step based on N first load data of the target instance at N first time steps in a target resource dimension, the method further comprises the following steps: mapping a plurality of instances included in a scaling group to a hash ring based on the identification of the plurality of instances, wherein the plurality of instances comprises the target instance, and one instance corresponds to one hash value in the hash ring; dividing the plurality of instances in the hash ring into a plurality of initial shards, wherein at least one instance is included in one initial shard; determining the target shard from the plurality of initial shards, wherein the target shard comprises the target instance; obtaining load data of the target instance through a controller corresponding to the target shard to obtain N first load data.

3. The method of claim 1, wherein, Determining N second load data of a target instance at a second time step based on N first load data of the target instance at N first time steps in a target resource dimension comprises the following steps: extracting fifth load data from N first load data, wherein the fifth load data is load data greater than a first preset threshold in N first load data, and the time step corresponding to the fifth load data is any time step in N first time steps; determining the fifth load data as the second load data.

4. The method of claim 3, wherein, Determining third load data of a target shard at the second time step based on the second load data comprises the following steps: calculating load data and a value of the target instance based on the second load data, wherein the load data and the value are the sum of the second load data of one or more target instances included in the target shard; determining the load data and the value as the third load data.

5. The method of claim 1, wherein, After determining the third load data of the target shard at the second time step based on the second load data, the method further comprises the following steps: calculating a ratio of resource capacity between the third load data and the target instance to obtain a first capacity, wherein the first capacity is used to represent the number of target instances allowed to be accommodated by the target shard in the target resource dimension; determine a target capacity from a plurality of second capacities corresponding to the resource dimension of the target shard, wherein the target capacity is a capacity of the plurality of second capacities that is less than a second preset threshold, the first capacity is included in the plurality of second capacities, and the target capacity is used to represent a number of the target instances that the target shard is allowed to accommodate in the third time step.

6. The method of claim 5, wherein, adjust the target instances included in the target shard in a third time step based on N first load data, the third load data, and fourth load data, including: calculating a target average load change rate of the target shard in N first time steps based on N first load data; calculating a target load difference between load data of the future time step and the actual load data based on the third load data and the fourth load data; generating an adjustment signal to adjust the target instances included in the target shard based on the target average load change rate and the target load difference.

7. The method of claim 6, wherein, generating an adjustment signal to adjust the target instances included in the target shard based on the target average load change rate and the target load difference, including one of: generating a first adjustment signal to instruct a controller corresponding to the target shard to migrate M target instances included in the target shard to a first shard in a case where the target average load change rate or the target load difference is greater than zero, wherein the first shard is a shard with an average load change rate and a load difference less than zero; generating a second adjustment signal to instruct a controller corresponding to a second shard to migrate M target instances included in the second shard to the target shard in a case where the target average load change rate and the target load difference are less than zero, wherein the second shard is a shard with an average load change rate or a load difference greater than zero; wherein the value of M is a numerical value determined based on the target capacity.

8. An adjustment device of an example, characterized by including: a first determination module configured to determine second load data of a target instance in a second time step based on N first load data of the target instance in N first time steps, wherein the first load data is load data under a target resource dimension, the second time step is a future time step, and N is an integer greater than 0; a second determination module configured to determine third load data of a target shard in the second time step based on the second load data, wherein the target shard includes at least one target instance; a first adjustment module configured to adjust the target instances included in the target shard in a third time step based on N first load data, the third load data, and fourth load data, wherein the fourth load data is actual load data of the instance in the third time step, and the third time step is a time step corresponding to a current time between the second time step and the second time step.

9. An electronic device, comprising: including: a memory configured to store a computer program; a processor configured to implement steps of the adjustment method of the instance of any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the adjustment method of the example of any one of claims 1 to 7.