Example processing methods, electronic devices, and storage media
By allocating devices to instances at the device group level and dynamically adjusting device groups, the problem of excessively high instance water levels leading to excessively high device water levels was solved, thereby achieving stability of instance performance and reducing operation and maintenance costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2023-02-17
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies have issues with instances having excessively high water levels, leading to excessively high equipment water levels. Furthermore, different instances require different numbers of new devices, making operation and maintenance management difficult.
Devices are allocated to instances at the device group level. By periodically monitoring traffic data and load levels, the expansion or contraction of device groups is dynamically adjusted to ensure instance performance and reduce operation and maintenance costs.
It effectively addresses sudden increases in instance traffic data, significantly reduces equipment load, improves anti-vibration capabilities, and lowers the difficulty and cost of operation and maintenance management.
Smart Images

Figure CN116302329B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an instance processing method, electronic device, and storage medium. Background Technology
[0002] An instance is the smallest unit of service provided by a cloud service provider. In practice, cloud service providers offer various types of instances, such as load balancer instances, database instances, and cloud server instances. In scenarios with elastic instances, there may be a sudden increase in instance traffic (which can be understood as an increase in instance load). Traffic data includes, but is not limited to, QPS (Query Per Second), CPS (Connections Per Second), and maxConn (maximum number of connections). Taking the load balancer instance as an example, which consists of various virtual network elements such as containers, virtual machines, or cloud virtual hosts, if the traffic to the load balancer instance suddenly increases, the load pressure on these virtual network elements will also suddenly increase significantly. Obviously, an excessively high instance load will lead to an excessively high device load (which can be understood as a significant increase in device load), affecting instance performance and service reliability. Summary of the Invention
[0003] This application provides an instance processing method, electronic device, and storage medium to effectively solve the problem of excessively high original equipment water level caused by excessively high instance water level.
[0004] This application provides an instance processing method, including: running a target instance on at least one first device group; periodically acquiring the current traffic data of the target instance; determining whether the current traffic data of the target instance in at least one period within a first preset time period meets the high instance water level condition at the instance dimension, wherein the high instance water level condition at the instance dimension refers to the current traffic data of the target instance being greater than a first traffic data threshold; if the current traffic data of the target instance in at least one period within the first preset time period meets the high instance water level condition at the instance dimension, then performing device group expansion processing on the target instance.
[0005] This application also provides an electronic device, including: a memory and a processor; the memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to perform steps in an instance processing method.
[0006] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the instance processing method.
[0007] In this embodiment, devices are allocated to instances at the device group level. The newly added device groups can effectively cope with sudden increases in instance traffic data. After adding device groups to instances, the capacity of existing running instances can be significantly reduced, exhibiting strong anti-jitter capabilities and ensuring instance performance. In addition, each instance runs on devices in one or more device groups, reducing the difficulty and cost of operation and maintenance management. Attached Figure Description
[0008] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0009] Figure 1 Exemplary application scenario diagrams provided for embodiments of this application;
[0010] Figure 2 A flowchart illustrating an instance processing method provided in this application embodiment;
[0011] Figure 3 A flowchart illustrating another instance processing method provided in this application embodiment;
[0012] Figure 4 A flowchart illustrating another instance processing method provided in this application embodiment;
[0013] Figure 5 This is a schematic diagram of the structure of an instance processing device provided in an embodiment of this application;
[0014] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0016] In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the access relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone, where A and B can be singular or plural. In the textual description of this application, the character " / " generally indicates that the preceding and following associated objects have an "or" relationship. Furthermore, in the embodiments of this application, "first," "second," "third," etc., are only used to distinguish the content of different objects and have no other special meaning.
[0017] Currently, to address instances with excessively high water levels, one or more devices are added to each instance at the device level. However, adding one or more devices at the device level cannot effectively solve the problem of existing devices having excessively high water levels due to instances having excessively high water levels. Furthermore, the number of new devices required varies for different instances, resulting in inconsistent device counts for each instance over time, causing difficulties in operation and maintenance management.
[0018] Therefore, embodiments of this application provide an instance processing method, an electronic device, and a storage medium. By allocating devices to instances at the device group level, the newly added device groups can effectively handle sudden increases in instance traffic data. After adding device groups to instances, the resource consumption of existing running instances can be significantly reduced, exhibiting strong anti-jitter capabilities and ensuring instance performance. Furthermore, each instance runs on devices within one or more device groups, reducing the difficulty and cost of operation and maintenance management.
[0019] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0020] Figure 1 An exemplary application scenario diagram provided for embodiments of this application. See also... Figure 1 Devices are allocated to instances at the device group level. An instance can be assigned one or more device groups, and different instances may be assigned to the same device group. Devices in a device group can be virtual devices or hardware devices, including but not limited to containers, virtual machines (VMs), and cloud servers. For example, previously instance 1 only ran on device groups 1 and 2. Over time, the water level of instance 1 increased significantly, so device group 4 was added, giving instance 1 three device groups. Previously instance 2 only ran on device group 1. Over time, the water level of instance 2 increased significantly, so device group 3 was added, giving instance 2 two device groups. Previously instance 3 only ran on device group 2. Over time, the water level of instance 3 remained relatively stable, so no new device group was needed for instance 3.
[0021] Figure 2 This is a flowchart illustrating an instance processing method provided in an embodiment of this application. The method can be executed by an instance processing device, which may consist of software and / or hardware, and is generally configured in an electronic device. See also... Figure 2 The method may include the following steps:
[0022] 201. Run the target instance on at least one first device group.
[0023] 202. Periodically obtain the current traffic data of the target instance.
[0024] 203. Determine whether the current traffic data of at least one periodic target instance within the first preset time period meets the high instance water level condition at the instance level. If the determination result is yes, proceed to step 204.
[0025] 204. Perform device group expansion on the target instance.
[0026] In this embodiment, the target instance can be various types of instances, including but not limited to: load balancer instances, database instances, and cloud server instances, etc. One or more device groups are allocated to the target instance at the device group granularity, and the target instance runs on the allocated one or more device groups. For ease of understanding and distinction, the device group on which the target instance runs is referred to as the first device group. In practical applications, one or more first device groups are randomly selected from multiple device groups. Further optionally, to better guarantee instance performance, the current load level of at least one device group can be determined based on the current operating status data of at least one device group; at least one first device group is selected from the at least one device group according to the current load level in ascending order.
[0027] In practical applications, the current operating status data of a device group can include the current operating status data of each device in the group. The current operating status data of a device can include one or more dimensions of sub-operating status data. Sub-operating status data includes, but is not limited to, CPU (Central Processing Unit) utilization, GPU (Graphics Processing Unit) utilization, and memory utilization, etc.
[0028] In this embodiment, the current load level of the device group can be determined by the current load level of each device in the device group. If the current load levels of all devices in the device group are the same, the current load level of the device group is the same. If the current load levels of the devices in the device group are different, the number of each current load level is counted, and the current load level with the most counts is taken as the load level of the device group. Alternatively, if the current load levels of the devices in the device group are different, the highest current load level is taken as the load level of the device group. Or, if the current load levels of the devices in the device group are different, the current load levels of each device are weighted and summed to obtain the load level of the device group. Of course, there is no limitation on the specific implementation method in which the current load level of the device group is determined by the current load levels of each device in the device group. For example, if the device group includes 5 devices, of which 3 devices are at the first load level and 2 devices are at the second load level, then the load level of the device group can be the first load level.
[0029] In this embodiment, a current load level of the device can be evaluated based on sub-operational state data of one dimension, and the overall current load level of the device can be evaluated based on the current load level of at least one dimension. For example, if the current load levels of all dimensions of the device are the same, the overall current load level of the device is the same. If the current load levels of all dimensions of the device are different, the current load level of the most relevant sub-operational state data is taken as the overall load level of the device. Alternatively, if the current load levels of all dimensions of the device are different, the number of each current load level is counted, and the current load level with the most counts is taken as the overall load level of the device. Alternatively, if the current load levels of all dimensions of the device are different, the highest current load level is taken as the overall current load level of the device. Or, if the current load levels of all dimensions of the device are different, a weighted sum of the current load levels of all dimensions is performed to obtain the overall load level of the device. Of course, there are no restrictions on the specific implementation method of evaluating the overall current load level of the device based on the current load level of at least one dimension of the device. For example, if the device has five dimensions of current load level, where the first load level has three dimensions and the second load level has two dimensions, then the load level of the device can be the first load level. In this embodiment, a current load level of the device is evaluated based on sub-operational status data of one dimension. For each sub-operational status data, an upper limit and a lower limit for resource utilization are set, with the upper limit being greater than the lower limit. If the sub-operational status data is greater than the upper limit, the device's load level in that dimension is the first load level; if the sub-operational status data is greater than or equal to the lower limit but less than or equal to the upper limit, the device's load level in that dimension is the second load level; if the sub-operational status data is less than the lower limit, the device's load level in that dimension is the third load level. The load levels are ordered from highest to lowest as the first, second, and third load levels. For example, if the device's current CPU utilization is greater than the upper limit of CPU utilization, the device's load level in the CPU dimension is the first load level; if the device's current CPU utilization is less than or equal to the upper limit of CPU utilization, and the device's current CPU utilization is greater than or equal to the lower limit of CPU utilization, the device's load level in the CPU dimension is the second load level; if the device's current CPU utilization is less than the lower limit of CPU utilization, the device's load level in the CPU dimension is the third load level.For example, if the device's current memory utilization is greater than the upper limit of memory utilization, the device's load level in the memory dimension is the first load level; if the device's current memory utilization is less than or equal to the upper limit of memory utilization, and the device's current memory utilization is greater than or equal to the lower limit of memory utilization, the device's load level in the memory dimension is the second load level; if the device's current memory utilization is less than the lower limit of memory utilization, the device's load level in the memory dimension is the third load level.
[0030] In this embodiment, selecting at least one first device group from the at least one device group according to the current load level from low to high can ensure that at least one first device group with a lighter load pressure is selected.
[0031] Further optionally, in order to ensure better selection of at least one first device group with a lighter load pressure, when selecting at least one first device group from the at least one device group according to the current load level in ascending order, it can be determined whether there is at least one candidate device group among the at least one device group whose current load level meets the low load condition; if there is at least one candidate device group whose current load level meets the low load condition, then the at least one first device group is selected from the at least one candidate device group according to the current load level in ascending order.
[0032] Specifically, at least one candidate device group that meets the low load condition is first selected from at least one device group, and then at least one first device group is selected from at least one candidate device group that meets the low load condition.
[0033] In practical applications, low-load and high-load conditions are flexibly set. If a device group meets the low-load condition, it indicates a light load; if it meets the high-load condition, it indicates a heavy load. For example, the load levels can be sorted from highest to lowest as first, second, and third load levels. If the current load level of a device group is greater than or equal to the second load level, it can be considered to meet the high-load condition; if it is less than or equal to the second load level, it can be considered to meet the low-load condition. Similarly, if the current load level is equal to the first load level, it can be considered to meet the high-load condition; if it is equal to the third load level, it can be considered to meet the low-load condition. Again, if the current load level is equal to the first load level, it can be considered to meet the high-load condition; if it is less than or equal to the second load level, it can be considered to meet the low-load condition.
[0034] In this embodiment, after selecting at least one first device group to run the target instance, the target instance is run on at least one first device group. Additionally, the current traffic data of the target instance is periodically acquired. This current traffic data includes, but is not limited to, QPS, CPS, and maxConn. In practical applications, a period can be flexibly set, for example, 1 millisecond, 1 second, 1 minute, etc. For each period within a first preset time period, the current traffic data of the target instance in that period is evaluated to determine whether it meets the high instance watermark condition at the instance level. The first preset time period can be flexibly set as needed, for example, the most recent 1 second, the most recent 1 minute, or the most recent 5 minutes, etc.
[0035] In this embodiment, the high instance water level condition at the instance dimension refers to the current traffic data of the target instance being greater than the first traffic data threshold. In this case, the instance water level of the target instance is high.
[0036] If the current traffic data includes one of the following: QPS, CPS, and maxConn, then the number of first traffic data thresholds is one. If the current traffic data of the target instance is greater than the corresponding first traffic data threshold, then the current traffic data of the target instance meets the high instance watermark condition at the instance level, and device group expansion processing is required for the target instance; if the current traffic data of the target instance is less than or equal to the corresponding first traffic data threshold, then the current traffic data of the target instance does not meet the high instance watermark condition at the instance level, and device group expansion processing is not required for the target instance.
[0037] If the current traffic data includes multiple traffic metrics such as QPS, CPS, and maxConn, then there are multiple first traffic data thresholds, including but not limited to: QPS threshold, CPS threshold, and maxConn threshold. When the current traffic data of the target instance includes multiple traffic metrics, for each type of traffic data, if the traffic data is greater than the corresponding first traffic data threshold, then the traffic data satisfies the high instance watermark condition at the instance level; if the traffic data is less than or equal to the corresponding first traffic data threshold, then the traffic data does not satisfy the high instance watermark condition at the instance level. If one or more of the multiple traffic metrics of the target instance satisfy the high instance watermark condition at the instance level, then device group expansion processing is required for the target instance. If none of the multiple traffic metrics of the target instance satisfy the high instance watermark condition at the instance level, then device group expansion processing is not required for the target instance.
[0038] In this embodiment, when expanding the device group capacity of the target instance, one or more new device groups are added to the target instance at the device group granularity. This increases the number of device groups running the target instance. The newly added device groups can distribute the load across the existing running instance's devices, thus significantly reducing the load and improving the instance's resilience. The newly added device groups can be selected using the same method as the first device group selection for the running target instance, which will not be elaborated further.
[0039] In some optional embodiments, after running the target instance on the at least one first device group, it can be determined whether a faulty instance has appeared on the at least one first device group; if there is a first device group with the faulty instance, the faulty instance is migrated to a sandbox device group where no instance is running.
[0040] Specifically, in addition to the possibility of multiple instances running in the first device group, a faulty instance can affect the performance of other instances running in the same first device group. Therefore, to reduce the impact of a faulty instance on the performance of other instances, the faulty instance can be migrated to a sandbox device group. A sandbox device group refers to a device group that has not yet been assigned to any instances. After the faulty instance is migrated to the sandbox device group, only the faulty instance will be running in the sandbox device group.
[0041] The technical solution provided in this embodiment, when determining that the instance's water level is high, allocates devices to the instance at the device group level. The newly added device groups can effectively cope with sudden increases in instance traffic data. After adding device groups to the instance, the water level of the original running instance can be significantly reduced, exhibiting strong anti-jitter capability and ensuring instance performance. In addition, each instance runs on devices in one or more device groups, reducing the difficulty and cost of operation and maintenance management.
[0042] In practical applications, as time goes on, the instance water level will rise, and the device group water level (which can be understood as the load pressure of the device group) will also rise. The need for device group expansion can be determined by combining the instance water level and the device group water level. Therefore, this application also provides an instance processing method.
[0043] Figure 3 A flowchart illustrating another instance processing method provided in an embodiment of this application. This method can be executed by an instance processing device, which may consist of software and / or hardware, and is generally configured in an electronic device. See also... Figure 3 The method may include the following steps:
[0044] 301. Run the target instance on at least one first device group and perform steps 302 and 304.
[0045] 302. Periodically obtain the current traffic data of the target instance.
[0046] 303. Determine whether the current traffic data of at least one periodic target instance within the first preset time period meets the high instance water level condition of the instance dimension. The high instance water level condition of the instance dimension means that the current traffic data of the target instance is greater than the first traffic data threshold. If the determination result is yes, proceed to step 306.
[0047] 304. Periodically obtain the current load level of at least one first device group.
[0048] 305. Determine whether there is a first device group whose current load level meets the high load condition in at least one cycle within the second preset time period. If the determination result is yes, proceed to step 306.
[0049] 306. Perform device group expansion on the target instance.
[0050] The implementation methods for steps 301, 302, 303, and 306 can be found in the relevant descriptions of the foregoing embodiments, and will not be repeated here. Furthermore, there are no restrictions on the execution order of steps 302 and 304; they can be executed synchronously or asynchronously.
[0051] In this embodiment, the need for device group expansion is assessed both from the perspective of instance water level and from the perspective of device group water level. The current load level of at least one first device group is periodically acquired. In practical applications, a period can be flexibly set, such as 1 millisecond, 1 second, 1 minute, etc. For each period within a second preset time period, it is determined whether a first device group exists whose current load level meets the high load condition. If a first device group exists whose current load level meets the high load condition, it indicates that device group expansion is required for the target instance. The second preset time period can be flexibly set as needed, such as the most recent 1 second, the most recent 1 minute, or the most recent 5 minutes, etc.
[0052] In this embodiment, if the current traffic data of at least one periodic target instance meets the high instance water level condition within the first preset time period, or if a first device group with a current load level meeting the high load condition appears within the second preset time period, then device group expansion processing is required for the target instance. If the current traffic data of no at least one periodic target instance meets the high instance water level condition within the first preset time period and no first device group with a current load level meeting the high load condition appears within the second preset time period, then device group expansion processing is not required for the target instance.
[0053] The technical solution provided in this embodiment, when it is determined that the water level of an instance or a device group is high, allocates devices to the instance at the device group level. The newly added device groups can effectively cope with situations where the instance's traffic data suddenly increases or the water level of the existing running instance's devices is too high. After adding device groups to an instance, the water level of the existing running instance's devices can be significantly reduced, resulting in strong anti-vibration capabilities and ensuring instance performance. In addition, each instance runs on devices in one or more device groups, reducing the difficulty and cost of operation and maintenance management.
[0054] Figure 4 A flowchart illustrating another instance processing method provided in an embodiment of this application. This method can be executed by an instance processing device, which may consist of software and / or hardware, and is generally configured in an electronic device. See also... Figure 4 The method may include the following steps:
[0055] 401. Run the target instance on at least one first device group and perform steps 402 and 404.
[0056] 402. Periodically obtain the current traffic data of the target instance.
[0057] 403. Determine whether the current traffic data of at least one periodic target instance within the first preset time period meets the high instance water level condition of the instance dimension. The high instance water level condition of the instance dimension means that the current traffic data of the target instance is greater than the first traffic data threshold. If the determination result is yes, proceed to step 406.
[0058] 404. Periodically obtain the current load level of at least one first device group, and perform steps 405 and 407.
[0059] 405. Determine whether a first device group whose current load level meets the high load condition exists in at least one cycle within the second preset time period. If the determination result is yes, execute step 406 or execute step 409.
[0060] 406. Perform device group expansion on the target instance.
[0061] 407. Determine whether the number of first equipment groups whose current load level meets the low load condition in at least one cycle within the second preset time period is greater than or equal to the preset number; if the determination result is yes, proceed to step 408.
[0062] 408. Perform device group downsizing on the target instance.
[0063] 409. Select at least one second device group from at least one device group other than the at least one first device group, whose current load level meets the low load condition.
[0064] 410. Migrate instances running on the first device group that meet the high load conditions to the at least one second device group.
[0065] The implementation methods for steps 401 to 406 can be found in the relevant descriptions of the foregoing embodiments, and will not be repeated here.
[0066] In this embodiment, in order to improve the resource utilization of the device group, the device group of the target instance can also be scaled down, that is, the number of device groups running the target instance can be reduced. The number of device groups to be reduced can be flexibly set as needed, such as 1, 2 or 3, etc.
[0067] In this embodiment, the current load level of at least one first device group is periodically acquired. For each period within a second preset time period, it can also be determined whether the number of first device groups whose current load level meets the low load condition in at least one period within the second preset time period is greater than or equal to a preset number. The preset number can be flexibly set as needed, and the number of at least one period is not limited, for example, 1, 2, or 3 periods. If the number of first device groups whose current load level meets the low load condition in at least one period within the second preset time period is greater than or equal to the preset number, it indicates that the resource utilization of many first device groups is low, and device group scaling down can be performed on the target instance. If the number of first device groups whose current load level meets the low load condition in at least one period within the second preset time period is less than the preset number, it indicates that the resource utilization of many first device groups is high, and device group scaling down is not required for the target instance.
[0068] In practical applications, the water level of a device group may be low, but the water level of an instance may be high. If device group scaling down is performed on an instance, it will affect instance performance. Therefore, optionally, to ensure instance performance, if the number of first device groups whose current load level meets the low load condition in at least one period within the second preset time period is greater than or equal to a preset number, then the aggregated traffic characteristics of the first device groups whose current load level meets the low load condition in at least one period within the second preset time period are obtained. The aggregated traffic characteristics of the first device group in each period are obtained by aggregating the current traffic data of at least one instance running in the first device group in each period. If the first device group whose current load level meets the low load condition in at least one period within the second preset time period meets the low instance water level condition at the device group level, where the low instance water level condition at the device group level means that the aggregated traffic characteristics of the first device group are less than a second traffic data threshold, then device group scaling down is performed on the target instance.
[0069] If the first device group whose current load level meets the low load condition in at least one period within the second preset time period meets the high instance water level condition of the device group dimension, and the high instance water level condition of the device group dimension means that the aggregated flow characteristic of the first device group is greater than or equal to the third flow data threshold, then the third flow data threshold is increased.
[0070] In this embodiment, the second traffic data threshold is less than the third traffic data threshold, and the second and third traffic data thresholds can be flexibly set as needed.
[0071] In this embodiment, when the number of first device groups whose current load level meets the low load condition is large within several cycles of the second preset time period, it can be further determined whether the first device group whose current load level meets the low load condition in at least one cycle of the second preset time period meets the low instance water level condition at the device group level or the high instance water level condition at the device group level. If the first device group meets the low instance water level condition at the device group level, it indicates that the instance water level of the first device group is low; if the first device group meets the high instance water level condition at the device group level, it indicates that the instance water level of the first device group is high.
[0072] Specifically, for the first device group whose current load level meets the low load condition, the current traffic data of at least one instance running in the first device group in each period is aggregated to obtain the aggregated traffic characteristics of the first device group in each period. For example, if the current traffic data is QPS, various operations such as accumulation, averaging, or weighted summation are performed on the QPS of all instances running in the first device group in each period to obtain the aggregated traffic characteristics of the first device group in that period. As another example, if the current traffic data is CPS, various operations such as accumulation, averaging, or weighted summation are performed on the CPS of all instances running in the first device group in each period to obtain the aggregated traffic characteristics of the first device group in that period. As yet another example, if the current traffic data is maxConn, various operations such as accumulation, averaging, or weighted summation are performed on the maxConn of all instances running in the first device group in each period to obtain the aggregated traffic characteristics of the first device group in that period.
[0073] If the current traffic data includes one of the following: QPS, CPS, and maxConn, then the number of second and third traffic data thresholds is one. For each period, if the aggregated traffic characteristic of the first device group that meets the low load condition is less than the second traffic data threshold, then the target instance undergoes device group scaling down. If the aggregated traffic characteristic of the first device group that meets the low load condition is greater than the third traffic data threshold, then the third traffic data threshold is increased.
[0074] If the current traffic data includes multiple traffic metrics such as QPS, CPS, and maxConn, then the first device group will have multiple aggregated traffic characteristics, and the number of second and third traffic data thresholds will also be multiple. For each period, if one or more aggregated traffic characteristics of the first device group that currently meets the low load condition are less than the corresponding second traffic data threshold, then the target instance will undergo device group scaling down. If one or more aggregated traffic characteristics of the first device group that currently meets the low load condition are greater than the corresponding third traffic data threshold, then the corresponding third traffic data threshold will be increased.
[0075] Further optional, see Figure 4 If, within at least one period of the second preset time period, the first device group whose current load level meets the high load condition, in addition to performing step 406 to expand the device group of the target instance, step 409 can also be performed to migrate the instance to another device group. Of course, either expanding the device group or migrating the instance to another device group can be performed, and there is no restriction on this.
[0076] Specifically, if a first device group whose current load level meets the high load condition appears in at least one period within the second preset time period, then at least one second device group whose current load level meets the low load condition is selected from at least one device group other than the at least one first device group; and the instances running on the first device group that meets the high load condition are migrated to the at least one second device group.
[0077] It is understandable that migrating instances from the first device group with higher load pressure to the second device group with lower load pressure can reduce the load pressure on the first device group, thereby ensuring the instance performance of the instances running on the first device group.
[0078] The technical solution provided in this embodiment, when determining that the water level of an instance or a device group is high, allocates devices to the instance at the device group level. The newly added device groups can effectively cope with sudden increases in instance traffic data or excessively high water levels of existing running instances. After adding device groups to an instance, the water level of the existing running instances can be significantly reduced, exhibiting strong anti-jitter capabilities and ensuring instance performance. Furthermore, each instance runs on devices within one or more device groups, reducing the difficulty and cost of operation and maintenance. Further, device group scaling down can be performed to improve the resource utilization of the device group, and instances from high-load device groups can even be migrated to low-load device groups, reducing the load on the device groups and thus ensuring the performance of instances running on the device groups.
[0079] Figure 5This is a schematic diagram of the structure of an example processing device provided in an embodiment of this application. Figure 5 As shown, the device may include:
[0080] Run module 51 is used to run the target instance on at least one first device group;
[0081] The acquisition module 52 is used to periodically acquire the current traffic data of the target instance;
[0082] The judgment module 53 is used to determine whether the current traffic data of the target instance in at least one period within a first preset time period meets the high instance water level condition of the instance dimension, wherein the high instance water level condition of the instance dimension means that the current traffic data of the target instance is greater than the first traffic data threshold.
[0083] The expansion module 54 is used to perform device group expansion processing on the target instance if the current traffic data of the target instance in at least one period within the first preset time period meets the high instance water level condition of the instance dimension.
[0084] Optionally, the acquisition module 52 is also configured to periodically acquire the current load level of the at least one first device group;
[0085] The judgment module 53 is also used to determine whether, within at least one period of the second preset time period, there is a first device group whose current load level meets the high load condition.
[0086] The expansion module 54 is also used to perform device group expansion processing on the target instance if a first device group whose current load level meets the high load condition appears in at least one period within the second preset time period.
[0087] Further optionally, the above device also includes: a scaling-down module, used to perform device group scaling-down processing on the target instance if the number of first device groups whose current load level meets the low load condition is greater than or equal to a preset number in at least one period during the second preset time period.
[0088] Further optionally, the scaling-down module is specifically used for: if the number of first device groups whose current load level meets the low load condition in at least one period within the second preset time period is greater than or equal to a preset number, then obtaining the aggregated traffic characteristics of the first device groups whose current load level meets the low load condition in at least one period within the second preset time period, wherein the aggregated traffic characteristics of the first device group in each period are obtained by aggregating the current traffic data of at least one instance running by the first device group in each period; if the first device groups whose current load level meets the low load condition in at least one period within the second preset time period meet the low instance water level condition at the device group dimension, wherein the low instance water level condition at the device group dimension means that the aggregated traffic characteristics of the first device group are less than the second traffic data threshold, then performing device group scaling-down processing on the target instance.
[0089] Further optionally, the scaling-down module is also used to: if the first device group whose current load level meets the low load condition in at least one period within the second preset time period meets the high instance water level condition of the device group dimension, wherein the high instance water level condition of the device group dimension means that the aggregated traffic characteristic of the first device group is greater than or equal to the third traffic data threshold, then the third traffic data threshold is increased.
[0090] Further optionally, the above-mentioned device also includes: a selection module and a migration module;
[0091] The selection module is used to select at least one second device group whose current load level meets the low load condition from at least one device group other than the at least one first device group if a first device group whose current load level meets the high load condition appears in at least one period within a second preset time period.
[0092] A migration module is used to migrate instances running on a first device group that meet high load conditions to the at least one second device group.
[0093] Further optionally, the selection module is also configured to: determine the current load level of at least one device group based on the current operating status data of at least one device group; and select at least one first device group from the at least one device group according to the current load level in ascending order.
[0094] Further optionally, when the selection module selects at least one first device group from the at least one device group in ascending order of current load level, it is specifically used to: determine whether there is at least one candidate device group in the at least one device group whose current load level meets the low load condition based on the current load level of the at least one device group; if there is at least one candidate device group whose current load level meets the low load condition, then select the at least one first device group from the at least one candidate device group in ascending order of current load level.
[0095] Optionally, the migration module is further configured to: determine whether a faulty instance has appeared on the at least one first device group; if a first device group with a faulty instance exists, then migrate the faulty instance to a sandbox device group where no instance is running.
[0096] Figure 5 The device shown can perform Figures 2 to 4 The implementation principle and technical effects of the method shown will not be elaborated further. Regarding the above embodiments... Figure 5 The specific ways in which each module and unit of the device performs operations have been described in detail in the embodiments of the method, and will not be elaborated here.
[0097] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 201 to 203 can be device A; or the execution subject of steps 201 and 202 can be device A, and the execution subject of steps 203 and 204 can be device B; and so on.
[0098] Furthermore, in some of the processes described in the above embodiments and accompanying drawings, multiple operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 201, 202, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.
[0099] 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 used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0100] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device includes: a memory 61 and a processor 62;
[0101] Memory 61 is used to store computer programs and can be configured to store various other data to support operation on the computing platform. Examples of this data include instructions for any application or method operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc.
[0102] The memory 61 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0103] Processor 62, coupled to memory 61, is used to execute computer programs in memory 61 for performing steps in the instance processing method.
[0104] Furthermore, such as Figure 6 As shown, the electronic device also includes other components such as a communication component 63, a display 64, a power supply component 65, and an audio component 66. Figure 6 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 6 The components shown. Additionally... Figure 6 The components within the dashed box are optional, not mandatory, and their specific requirements depend on the product form of the electronic device. The electronic device in this embodiment can be a desktop computer, laptop computer, smartphone, or IoT (Internet of Things) device, or a server-side device such as a conventional server, cloud server, or server array. If the electronic device in this embodiment is a desktop computer, laptop computer, or smartphone, it may include... Figure 6 The components within the dashed box; if the electronic device in this embodiment is implemented as a conventional server, cloud server, or server array, it may be omitted. Figure 6 The component within the dashed box.
[0105] For a detailed description of the implementation process of each action by the processor, please refer to the relevant descriptions in the foregoing method embodiments or device embodiments, which will not be repeated here.
[0106] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be performed by an electronic device in the above method embodiments.
[0107] Accordingly, this application also provides a computer program product, including a computer program / instructions, which, when executed by a processor, enables the processor to perform the steps that can be executed by an electronic device in the above method embodiments.
[0108] The aforementioned communication components are configured to facilitate wired or wireless communication between the device containing the communication components and other devices. The device containing the communication components can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G / LTE, 5G, or combinations thereof. In one exemplary embodiment, the communication components receive broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication components also include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.
[0109] The aforementioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation.
[0110] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.
[0111] The aforementioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.
[0112] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0113] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0114] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0115] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0116] In a typical configuration, a computing device includes one or more processors (central processing unit, CPU), input / output interfaces, network interfaces, and memory.
[0117] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0118] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. 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 RAM (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, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. As defined in this article, computer-readable media do not include transient media, such as modulated data signals and carrier waves.
[0119] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0120] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. An instance processing method, characterized in that, include: Run the target instance on at least one first device group; Periodically obtain the current traffic data of the target instance; Determine whether the current traffic data of the target instance within at least one period in the first preset time period meets the high instance water level condition of the instance dimension, wherein the high instance water level condition of the instance dimension means that the current traffic data of the target instance is greater than the first traffic data threshold. If the current traffic data of the target instance meets the high instance water level condition at least once within the first preset time period, then the target instance will be expanded by device group. Periodically obtain the current load level of the at least one first device group; Determine whether, within at least one cycle of the second preset time period, there is a first device group whose current load level meets the high load condition; If, within at least one period of the second preset time period, a first device group whose current load level meets the high load condition appears, then the target instance will be expanded to include more devices.
2. The method according to claim 1, characterized in that, Also includes: If the number of first device groups whose current load level meets the low load condition in at least one period within the second preset time period is greater than or equal to a preset number, then the target instance will be processed to reduce the number of device groups.
3. The method according to claim 2, characterized in that, If the number of first device groups whose current load level meets the low load condition in at least one period within the second preset time period is greater than or equal to a preset number, then the device group scaling-down process for the target instance includes: If the number of first device groups whose current load level meets the low load condition in at least one period within the second preset time period is greater than or equal to a preset number, then the aggregated traffic characteristics of the first device groups whose current load level meets the low load condition in at least one period within the second preset time period are obtained. The aggregated traffic characteristics of the first device group in each period are obtained by aggregating the current traffic data of at least one instance running by the first device group in each period. If the first device group whose current load level meets the low load condition in at least one period within the second preset time period meets the low instance water level condition in the device group dimension, where the low instance water level condition in the device group dimension means that the aggregated traffic characteristic of the first device group is less than the second traffic data threshold, then the target instance is subjected to device group scaling down.
4. The method according to claim 3, characterized in that, Also includes: If the first device group whose current load level meets the low load condition in at least one period within the second preset time period meets the high instance water level condition of the device group dimension, and the high instance water level condition of the device group dimension means that the aggregated flow characteristic of the first device group is greater than or equal to the third flow data threshold, then the third flow data threshold is increased.
5. The method according to claim 1, characterized in that, Also includes: If a first device group whose current load level meets the high load condition appears in at least one period within the second preset time period, then at least one second device group whose current load level meets the low load condition is selected from at least one device group other than the at least one first device group. Instances running on the first device group that meet the high load conditions will be migrated to the at least one second device group.
6. The method according to any one of claims 1 to 5, characterized in that, Before running the target instance on at least one first device group, the following is also included: Based on the current operating status data of at least one device group, determine the current load level of at least one device group; At least one first device group is selected from the at least one device group according to the current load level in ascending order.
7. The method according to claim 6, characterized in that, Based on the current load level in ascending order, at least one first device group is selected from the at least one device group, including: Based on the current load level of the at least one device group, determine whether there is at least one candidate device group whose current load level meets the low load condition; If there is at least one candidate device group whose current load level meets the low load condition, then the at least one first device group is selected from the at least one candidate device group in order of current load level from low to high.
8. The method according to any one of claims 1 to 5, characterized in that, After running the target instance on the at least one first device group, the process further includes: Determine whether a fault instance has occurred on at least one of the first device groups; If a first device group has the faulty instance, then the faulty instance is migrated to a sandbox device group where no instance is running.
9. An electronic device, characterized in that, include: Memory and processor; The memory is used to store computer programs; The processor is coupled to the memory for executing the computer program to perform the steps of the method according to any one of claims 1-8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method according to any one of claims 1-8.