Service request implementation method and device, equipment, medium and product
By obtaining and analyzing the current instance comprehensive parameters of the service instance candidate set in the Kubernetes cluster, determining the target service instance and updating the number of service instances, the problem of resource waste when the service instance cannot support requests is solved, and load balancing and full resource utilization are achieved.
Patent Information
- Application Number
- CN202411640852.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-18
AI Technical Summary
In a Kubernetes cluster, when the service instance in the server cannot support service requests, the network application framework is adjusted to improve performance, but it may result in waste of server resources and the service instance cannot be fully utilized.
By obtaining the current instance comprehensive parameters of each service instance in the service instance candidate set of the server cluster, determining the target service instance, and updating the number of service instances in the service instance candidate set to achieve load balancing and resource full utilization.
The load balancing of service instances is realized, avoiding the problem that service instances cannot be fully utilized, thereby reducing the waste of server resources.
Smart Images

Figure CN119583556A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of big data technology, and specifically relates to a method, device, equipment, medium and product for implementing a service request. Background Art
[0002] A Kubernetes cluster is a group of load servers used to run containerized applications. The server includes multiple container sets, which can be used as service instances based on the deployment of different applications in the cluster. When a server receives a service request, it can allocate an appropriate service instance to the request to fulfill the request.
[0003] Generally, when a service instance in a server cannot support a service request, the server's network application framework can be adjusted to improve the current performance of the server, thereby improving the performance of the service instance, so that a service instance that can meet the service request can be selected. However, this may result in the inability to fully utilize server resources, thus causing a waste of server resources. Summary of the invention
[0004] The present disclosure is proposed in view of the above problems. The present disclosure provides a method, device, equipment, medium and product for implementing a service request, which reduces the waste of server resources.
[0005] According to one aspect of the present disclosure, a method for implementing a service request is provided, comprising:
[0006] When receiving a service request from a client, obtaining current instance comprehensive parameters of each service instance in a service instance candidate set of a server cluster, wherein the current instance comprehensive parameters are used to characterize a current performance state of the service instance, and each service instance in the service instance candidate set is a service instance that is currently allowed to receive the service request;
[0007] If there are at least a first preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters meet a preset instance comprehensive parameter condition, determining a target service instance from the service instances that meet the preset instance comprehensive parameter condition;
[0008] When there are at least a second preset proportion of the service instances in the service instance candidate set whose current instance comprehensive parameters do not meet the preset instance comprehensive parameter conditions, updating the number of service instances in the service instance candidate set, and determining the target service instance from the updated service instance candidate set;
[0009] The service request is executed based on the target service instance.
[0010] Optionally, updating the number of service instances in the service instance candidate set and determining the target service instance from the updated service instance candidate set includes:
[0011] Calculate the change in the number of service instances in the service instance candidate set according to the current instance comprehensive parameter of each of the service instances in the service instance candidate set, the number of service instances in the service instance candidate set, and a threshold value of the expected instance comprehensive parameter;
[0012] According to the change amount, the number of service instances, and the redundancy degree of the number of service instances, the number of service instances is updated to obtain an updated candidate set of service instances, wherein the redundancy degree of the number of service instances is used to characterize the proportion of the number of service instances that do not meet the preset instance comprehensive parameter condition in the candidate set of service instances;
[0013] The service instance with the minimum comprehensive parameters of the current instance in the updated service instance candidate set is used as the target service instance.
[0014] Optionally, updating the number of service instances according to the change amount, the number of service instances, and the redundancy degree of the number of service instances includes:
[0015] In the case where the redundancy degree of the number of service instances indicates that the number of service instances is insufficient, if it is determined that the sum of the change amount and the number of service instances is less than a preset maximum number of cluster service instances, then adding service instances whose number is the change amount to the service instance candidate set;
[0016] When the service instance quantity redundancy degree indicates an excess of service instances, if it is determined that the difference between the change amount and the service instance quantity is greater than a preset minimum cluster service instance quantity, service instances with the change amount are removed from the service instance candidate set.
[0017] Optionally, after calculating the change in the number of service instances in the service instance candidate set according to the current instance comprehensive parameter of each of the service instances in the service instance candidate set, the number of service instances in the service instance candidate set, and the threshold value of the expected instance comprehensive parameter, the method further includes:
[0018] If the sum of the change amount and the number of service instances is greater than the preset maximum number of cluster service instances, or the difference between the number of service instances and the change amount is less than the preset minimum number of cluster service instances, the current threshold of the instance operating status parameter that affects the setting of the preset instance comprehensive parameter condition is adjusted until the current instance comprehensive parameters of at least the first preset proportion of service instances meet the preset instance comprehensive parameter condition.
[0019] Optionally, the adjusting the current threshold of the instance running state parameter that affects the setting of the preset instance comprehensive parameter condition until the current instance comprehensive parameters of at least the first preset proportion of service instances meet the preset instance comprehensive parameter condition includes:
[0020] Calculate a first preset threshold value of the running state parameter of the instance to be adjusted according to the current instance comprehensive parameter of each of the service instances, the number of the service instances, the threshold value of the expected instance comprehensive parameter and the current threshold value of the running state parameter of the instance to be adjusted;
[0021] When it is determined that the current instance comprehensive parameters of at least a first preset proportion of the service instances meet the preset instance comprehensive parameter condition obtained based on the first preset threshold, the first preset threshold is used as the preset threshold of the instance running state parameter to be adjusted.
[0022] Optionally, determining the target service instance from the service instances that satisfy the preset instance comprehensive parameter condition includes:
[0023] The service instance with the smallest current instance comprehensive parameter in the service instance candidate set is used as the target service instance.
[0024] Optionally, the obtaining of the current instance comprehensive parameters of each service instance in the service instance candidate set of the server cluster includes:
[0025] Collecting current instance running status parameters of each service instance in the service instance candidate set, wherein the current instance running status parameters include multiple running indicator parameters;
[0026] Obtaining a performance score for each of the operating indicator parameters, wherein the performance score is used to characterize the service performance of the service instance in terms of the operating indicator parameter;
[0027] Based on the weight of each of the operating indicator parameters and each of the performance scores, current instance comprehensive parameters of each of the service instances are calculated.
[0028] According to another aspect of the present disclosure, a device for implementing a service request is provided, including:
[0029] An acquisition module, configured to, upon receiving a service request from a client, acquire a current instance comprehensive parameter of each service instance in a service instance candidate set of a server cluster, wherein the current instance comprehensive parameter is used to characterize a current performance state of the service instance, and each service instance in the service instance candidate set is a service instance that is currently allowed to receive a service request;
[0030] A first determining module is used to determine a target service instance from service instances that meet the preset instance comprehensive parameter condition when there are at least a first preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters meet the preset instance comprehensive parameter condition;
[0031] A second determination module is used to update the number of service instances in the service instance candidate set when there are at least a second preset proportion of the service instances in the service instance candidate set whose current instance comprehensive parameters do not meet the preset instance comprehensive parameter conditions, and determine the target service instance from the updated service instance candidate set;
[0032] An execution module is used to execute the service request based on the target service instance.
[0033] According to another aspect of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned method for implementing the service request.
[0034] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and the program is executed by a processor to implement the above-mentioned method for implementing the service request.
[0035] According to another aspect of the present disclosure, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes an implementation method for implementing the above-mentioned service request.
[0036] In the present disclosure, when a service request is received from a client, the current instance comprehensive parameters of each service instance in the service instance candidate set of the server cluster are obtained, and the current instance comprehensive parameters are used to characterize the current performance state of the service instance. Each service instance in the service instance candidate set is a service instance that is currently allowed to receive the service request. When there are at least a first preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters meet the preset instance comprehensive parameter conditions, the target service instance is determined from the service instances that meet the preset instance comprehensive parameter conditions. When there are at least a second preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters do not meet the preset instance comprehensive parameter conditions, the number of service instances in the service instance candidate set is updated, and the target service instance is determined from the updated service instance candidate set. The service request is executed based on the target service instance. In this way, the current performance state of the service instance is compared by the current instance comprehensive parameters, and the load balancing of the service instance is achieved based on the instance comprehensive parameters. And when the service instance candidate set cannot meet the preset instance comprehensive parameter conditions, the number of service instances allowed to receive the service request in the candidate set is changed, thereby avoiding the problem that the service instance cannot be fully utilized. Therefore, the waste of server resources can be reduced.
[0037] It is to be understood that both the foregoing general description and the following detailed description are exemplary, and are intended to provide further explanation of the technology as claimed. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0039] Figure 1 A flow chart of a method for implementing a service request provided by the present disclosure.
[0040] Figure 2 Another flow chart of a method for implementing a service request provided by the present disclosure.
[0041] Figure 3 A schematic diagram of the structure of a device for implementing a service request provided by the present invention.
[0042] Figure 4 A hardware block diagram of an electronic device provided by the present disclosure.
[0043] Figure 5 A schematic diagram of a computer program product provided by the present disclosure. DETAILED DESCRIPTION
[0044] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the application scenario of the solution of the present application is first described below.
[0045] The Automated Guided Vehicle (AGV) scheduling and management application is mainly used to realize the real-time scheduling and management of AGV carts in the factory. The real-time operation status of the AGV cart is realized through the autonomous data reporting of the cart. The implementation method is the HTTP interface. The interface data includes the car model, operating status, power, location and other information of the car. The data reporting time interval is about 100 milliseconds. The scheduling management application can be implemented based on the Kubernetes cluster. The Kubernetes cluster is a group of load servers for running containerized applications. The server includes multiple container sets, which can be used as service instances based on the deployment of different applications in the cluster. When the server receives a service request, such as a data reporting request based on the HTTP protocol, a suitable service instance can be assigned to the request to implement the request.
[0046] Since the number of AGVs in different factories and different workshops in the same factory may vary greatly, and the number of AGVs running at different times is also different, the pressure of reporting HTTP service requests received by the scheduling management application also fluctuates greatly, and there may be situations where server resources cannot be fully utilized. For example, when the number of service requests surges and the service instances in the server cannot support the service requests, the server's network application framework can be adjusted to improve the current performance of the server, thereby improving the performance of the service instances so that service instances that can meet the service requests can be selected. However, the number of service instances is not changed. While improving the performance of the server itself, service instance resources will be wasted. When the number of service requests is small, the number of service instances remains in the previous state, so that the service instance resources are not fully utilized. Therefore, server resources will be wasted.
[0047] In the present disclosure, when a service request is received from a client, the current instance comprehensive parameters of each service instance in the service instance candidate set of the server cluster are obtained, and the current instance comprehensive parameters are used to characterize the current performance state of the service instance. Each service instance in the service instance candidate set is a service instance that is currently allowed to receive the service request. When there are at least a first preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters meet the preset instance comprehensive parameter conditions, the target service instance is determined from the service instances that meet the preset instance comprehensive parameter conditions. When there are at least a second preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters do not meet the preset instance comprehensive parameter conditions, the number of service instances in the service instance candidate set is updated, and the target service instance is determined from the updated service instance candidate set. The service request is executed based on the target service instance. In this way, the current performance state of the service instance is compared by the current instance comprehensive parameters, and the load balancing of the service instance is achieved based on the instance comprehensive parameters. And when the service instance candidate set cannot meet the preset instance comprehensive parameter conditions, the number of service instances allowed to receive the service request in the candidate set is changed, thereby avoiding the problem that the service instance cannot be fully utilized. Therefore, the waste of server resources can be reduced.
[0048] In order to make the purpose, technical solution and advantages of the present disclosure more obvious, the exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.
[0049] Figure 1 A flow chart of a method for implementing a service request provided by the present disclosure. Figure 1 As shown, the method includes:
[0050] S101: upon receiving a service request from a client, obtaining current instance comprehensive parameters of each service instance in a service instance candidate set of a server cluster.
[0051] Specifically, in this embodiment, the client may be an AGV, which may report a service request to the server cluster when operating, wherein the service request may be a data reporting request including information such as the model, operating status, power, and location of the AGV, so as to implement the scheduling and management of the AGV by the server cluster. In this embodiment, the data reporting request may be implemented based on the HTTP protocol, and it is to be understood that the present disclosure does not specifically limit the implementation method of the service request.
[0052] The server cluster includes multiple service instances. Under the condition that the service request is executed normally and the service instance resources are not wasted, an initial value can be set, and some service instances in the server cluster are added to the service instance candidate set according to the preset initial value to determine the number of service instances in the service instance candidate set. When a service request is received later, the target service instance can be determined from the service instance candidate set to implement the service request. In other words, each service instance in the service instance candidate set is a service instance that is currently allowed to receive a service request.
[0053] After receiving the service request from the AGV, the server cluster obtains the current instance comprehensive parameters of each service instance in the service instance candidate set. Among them, the current instance comprehensive parameters are used to characterize the current performance status of the service instance. In other words, the current usage of the service instance can be judged based on the current instance comprehensive parameters. In this embodiment, the larger the current instance comprehensive parameters, the more service requests the service instance executes and the greater the load; the smaller the current instance comprehensive parameters, the fewer service requests the service instance executes and the service instance is not fully utilized.
[0054] S102: When there are at least a first preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters meet a preset instance comprehensive parameter condition, determine a target service instance from the service instances that meet the preset instance comprehensive parameter condition.
[0055] Specifically, the preset instance comprehensive parameter condition includes a preset minimum number of cluster service instances and a preset maximum number of cluster service instances. When the current instance comprehensive parameter of the service instance is within the range of the maximum value and the minimum value, it means that the current performance status of the service instance is good. When at least a first preset proportion of service instances in the service instance candidate set have a good current performance status, the target service instance can be determined from the service instances with a good current performance status.
[0056] S103: When there are at least a second preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters do not meet the preset instance comprehensive parameter conditions, update the number of service instances in the service instance candidate set, and determine the target service instance from the updated service instance candidate set.
[0057] Specifically, as mentioned above, when the current instance comprehensive parameters of the service instance are within the range of the maximum value and the minimum value, it means that the current performance status of the service instance is good. Similarly, when the current instance comprehensive parameters of the service instance exceed the range of the maximum value or the minimum value, it means that the service instance is overloaded or has excess load. In the service instance candidate set, when there are at least a second preset proportion of service instances whose current performance status is unhealthy, it is necessary to update the number of service instances in the service instance candidate set so that the updated service instance candidate set meets the condition requirements of S102, and determine the target service instance from the updated service instance candidate set. Among them, each service instance in the updated service instance candidate set is a service instance that is currently allowed to receive service requests.
[0058] S104: Execute the service request based on the target service instance.
[0059] Specifically, a determined target service instance is used to execute a service request from a client to ensure that the service request can be implemented normally.
[0060] In the present disclosure, when a service request is received from a client, the current instance comprehensive parameters of each service instance in the service instance candidate set of the server cluster are obtained, and the current instance comprehensive parameters are used to characterize the current performance state of the service instance. Each service instance in the service instance candidate set is a service instance that is currently allowed to receive the service request. When there are at least a first preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters meet the preset instance comprehensive parameter conditions, the target service instance is determined from the service instances that meet the preset instance comprehensive parameter conditions. When there are at least a second preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters do not meet the preset instance comprehensive parameter conditions, the number of service instances in the service instance candidate set is updated, and the target service instance is determined from the updated service instance candidate set. The service request is executed based on the target service instance. In this way, the current performance state of the service instance is compared by the current instance comprehensive parameters, and the load balancing of the service instance is achieved based on the instance comprehensive parameters. And when the service instance candidate set cannot meet the preset instance comprehensive parameter conditions, the number of service instances allowed to receive the service request in the candidate set is changed, thereby avoiding the problem that the service instance cannot be fully utilized. Therefore, the waste of server resources can be reduced.
[0061] In a possible embodiment, the number of service instances in the service instance candidate set is updated, and an exemplary method for determining a target service instance from the updated service instance candidate set includes:
[0062] According to the current instance comprehensive parameters of each service instance in the service instance candidate set, the number of service instances in the service instance candidate set, and the threshold of the expected instance comprehensive parameters, the change in the number of service instances in the service instance candidate set is calculated.
[0063] Specifically, the current instance comprehensive parameters of the service instance do not meet the preset instance comprehensive parameter conditions, including that the current instance comprehensive parameters are greater than the preset maximum number of cluster service instances or the current instance comprehensive parameters are less than the preset minimum number of cluster service instances. When it is greater than the maximum value, it means that the number of service instances in the current service instance candidate set is insufficient to support the number of service requests, and it is necessary to increase service instances and expand the service instance candidate set; when it is less than the minimum value, it means that the number of service instances in the current service instance candidate set is excessive, and the number of current service requests does not require so many service instances, and it is necessary to reduce service instances and shrink the service instance candidate set.
[0064] The change in the number of service instances in the service instance candidate set is calculated according to the following formula, and the service instance candidate set is expanded:
[0065]
[0066] Among them, T i is the current instance comprehensive parameter of the i-th instance in the service instance candidate set, T target is the threshold of the expected instance comprehensive parameter, N is the number of service instances in the current service instance candidate set, and N new The service instance change.
[0067] The change in the number of service instances in the service instance candidate set is calculated according to the following formula, and the service instance candidate set is scaled down:
[0068]
[0069] Among them, T i is the current instance comprehensive parameter of the i-th instance in the service instance candidate set, T tarhet is the threshold of the expected instance comprehensive parameter, N is the number of service instances in the current service instance candidate set, and N new The service instance change.
[0070] Afterwards, the number of service instances is updated according to the amount of change, the number of service instances, and the degree of redundancy of the number of service instances, to obtain an updated candidate set of service instances.
[0071] Specifically, when determining the redundancy degree of the number of service instances, the number of service instances and the change amount are used to calculate the number of service instances in the updated service instance candidate set, and the service instance candidate set is updated to obtain the updated service instance candidate set. The redundancy degree of the number of service instances is used to characterize the proportion of the number of service instances that do not meet the preset instance comprehensive parameter conditions in the service instance candidate set.
[0072] In addition, during the update of the service instance candidate set, the service requests received by the server cluster can be placed in the message queue and sorted according to the receiving timestamp. After the update of the service instance candidate set is completed, the service instance is allocated to the service request with a smaller receiving timestamp first according to the first-in-first-out rule of the message queue.
[0073] Afterwards, the service instance with the minimum comprehensive parameters of the current instance in the updated service instance candidate set is used as the target service instance.
[0074] Specifically, as mentioned above, the smaller the current instance comprehensive parameter is, the better the current performance status of the service instance is. Therefore, in this embodiment, the service instance with the smallest current instance comprehensive parameter in the updated service instance candidate set can be preferentially selected as the target service instance to achieve load balancing while executing the service request.
[0075] In a possible embodiment, an exemplary method for updating the number of service instances according to the change amount, the number of service instances, and the redundancy of the number of service instances includes:
[0076] When the redundancy degree of the number of service instances indicates that the number of service instances is insufficient, if it is determined that the sum of the change amount and the number of service instances is less than the preset maximum number of cluster service instances, service instances with the change amount are added to the service instance candidate set.
[0077] Specifically, the redundancy of the number of service instances indicates that the number of service instances is insufficient, which means that the number of service instances whose current instance comprehensive parameters are greater than the preset maximum number of cluster service instances accounts for a large proportion of the service instance candidate set. At present, the current performance status of most service instances in the service instance candidate set is poor, and there are few service instances with healthy current performance status, so it is impossible to continuously allocate suitable service instances to service requests. Therefore, the service instance candidate set can be expanded.
[0078] When expanding capacity, you can first sum the change amount and the number of service instances. If the sum is less than the preset maximum number of cluster service instances, it means that the calculated change amount is reasonable, and the updated number of service instances is within the maximum number of service instances allowed to run simultaneously in the current server cluster. You can add service instances with the change amount to the service instance candidate set.
[0079] For example, when the second preset ratio is 2 / 3, when the number of service instances whose current instance comprehensive parameters are greater than the preset maximum number of cluster service instances exceeds 2 / 3, it is determined that the service instance candidate set needs to be expanded. If the number of service instances in the service instance candidate set is 3, and there are 2 service instances whose current instance comprehensive parameters are greater than the preset maximum number of cluster service instances, the calculated change is 2. It is necessary to add 2 service instances to the service instance candidate set.
[0080] When the redundancy degree of the number of service instances indicates an excess number of service instances, if the difference between the variation and the number of service instances is determined to be greater than a preset minimum number of cluster service instances, service instances with the variation are removed from the service instance candidate set.
[0081] Specifically, the redundancy of the number of service instances indicates that the number of service instances is excessive, which means that the number of service instances whose current instance comprehensive parameters are less than the preset minimum number of cluster service instances accounts for a large proportion of the service instance candidate set. At present, the current performance status of most service instances in the service instance candidate set is idle, and the service instances cannot be fully utilized, resulting in resource waste. Therefore, the service instance candidate set can be reduced in capacity.
[0082] When scaling down, you can first calculate the difference between the number of service instances and the change amount. If the difference result is greater than the preset minimum number of cluster service instances, it means that the calculated change amount is reasonable, and the updated number of service instances is within the minimum number of service instances allowed to run simultaneously in the current server cluster. You can remove the service instances with the change amount from the service instance candidate set. Among them, the removed service instances stop receiving new service requests, which has no impact on the corresponding service instances that are currently executing, and they can continue to execute until the service request ends.
[0083] For example, when the second preset ratio is 1 / 2, if the number of service instances whose current instance comprehensive parameters are less than the preset minimum number of cluster service instances exceeds 1 / 2, it is determined that the service instance candidate set needs to be scaled down. If the number of service instances in the service instance candidate set is 3, and there are 2 service instances whose current instance comprehensive parameters are less than the preset minimum number of cluster service instances, the calculated change is 1. It is necessary to reduce 1 service instance from the service instance candidate set.
[0084] In a possible embodiment, after calculating the change in the number of service instances in the service instance candidate set according to the current instance comprehensive parameters of each service instance in the service instance candidate set, the number of service instances in the service instance candidate set, and the threshold value of the expected instance comprehensive parameter, the method further includes:
[0085] If the sum of the change amount and the number of service instances is greater than the preset maximum number of cluster service instances, or the difference between the number of service instances and the change amount is less than the preset minimum number of cluster service instances, the current threshold of the instance operating status parameter that affects the setting of the preset instance comprehensive parameter condition is adjusted until the current instance comprehensive parameters of at least a first preset proportion of service instances meet the preset instance comprehensive parameter condition.
[0086] Specifically, after the calculation of expansion or contraction, if the number of service instances in the updated service instance candidate set exceeds the preset range of the number of cluster service instances, it means that only adjusting the number of service instances in the service instance candidate set cannot meet the current service request. At this time, the current threshold of the instance operation status parameter set in the server cluster may be unreasonable, and it needs to be adjusted until the number of service instances in the service instance candidate set that meet the preset instance comprehensive parameter conditions reaches the first preset ratio. Among them, the current threshold of the instance operation status parameter is used to standardize the operation performance of the service instance.
[0087] For example, the method of adjusting the current threshold of the instance running state parameter that affects the preset instance comprehensive parameter condition setting until the current instance comprehensive parameter of at least a first preset proportion of service instances meets the preset instance comprehensive parameter condition includes:
[0088] A first preset threshold of the running state parameter of the instance to be adjusted is calculated according to the current instance comprehensive parameter of each service instance, the number of service instances, the threshold of the expected instance comprehensive parameter and the current threshold of the running state parameter of the instance to be adjusted.
[0089] Specifically, the instance running state parameter includes a plurality of running indicator parameters. In this embodiment, the priority of each running indicator parameter can be set, and the running indicator parameter with a high priority is used as the instance running state parameter to be adjusted, so as to adjust the threshold.
[0090] The first preset threshold of the instance running status parameter to be adjusted is calculated according to the following formula:
[0091]
[0092] Among them, T target is the threshold of the expected instance comprehensive parameter, T i is the current instance comprehensive parameter of the i-th service instance, C max is the current threshold of the instance running status parameter to be adjusted, C new The calculated first preset threshold value of the running status parameter of the instance to be adjusted.
[0093] When it is determined that the current instance comprehensive parameters of at least a first preset proportion of service instances meet a preset instance comprehensive parameter condition obtained based on a first preset threshold, the first preset threshold is used as the preset threshold of the instance running state parameter to be adjusted.
[0094] Specifically, according to the priority of each operation indicator parameter, the operation indicator parameters are adjusted in turn. When it is determined that the current instance comprehensive parameters of at least the first preset proportion of service instances meet the preset instance comprehensive parameter conditions obtained based on the first preset threshold, the first preset threshold can be used as the preset threshold of the instance operation status parameter to be adjusted, and the adjustment is stopped. By dynamically adjusting the current threshold of the instance operation status parameter in the server, it can ensure that the server can flexibly adapt to different business scenarios, reduce the inaccuracy of the experience preset, and reduce the static threshold configuration and maintenance costs.
[0095] For example, the current threshold settings of instance operation status parameters include the minimum CPU utilization of 30%, the minimum memory utilization of 40%, the maximum number of concurrent connections of 1000, the minimum number of cluster service instances of 2, etc. At a certain moment, the number of service instances obtained by scaling down has been reduced to the minimum number of cluster service instances of 2, and the number of concurrent connections of each instance has reached the maximum value of 1000, but the CPU utilization and memory utilization of the service instance are still less than the set minimum threshold. At this time, the maximum number of concurrent connections of the instance operation status parameters should be dynamically adjusted, such as to 2000, so as to increase the service request pressure of each service instance and avoid wasting resources.
[0096] In a possible embodiment, an exemplary method for determining a target service instance from service instances that meet a preset instance comprehensive parameter condition includes:
[0097] The service instance with the smallest comprehensive parameter among the current instances in the service instance candidate set is selected as the target service instance.
[0098] Specifically, as mentioned above, the smaller the comprehensive parameter of the current instance is, the better the current performance status of the service instance is. When selecting a target service instance, this embodiment may give priority to selecting a service instance with a better current performance status.
[0099] For example, assuming that the first preset ratio is 1 / 3, when the number of service instances that meet the preset instance comprehensive parameter conditions exceeds 1 / 3, it means that the current performance status of most service instances in the current service instance candidate set is healthy and can continue to execute service requests.
[0100] In a possible embodiment, an exemplary method for obtaining current instance comprehensive parameters of each service instance in a service instance candidate set of a server cluster includes:
[0101] Collect the current instance running status parameters of each service instance in the service instance candidate set.
[0102] Specifically, the current instance running status parameters include multiple running indicator parameters, such as the number of cluster service instances, CPU utilization, memory occupancy, request rate, response time, number of concurrent connections, and expected instance comprehensive parameters.
[0103] In this embodiment, the current instance running status parameters of each service instance in the service instance candidate set may be collected according to a preset collection period to ensure that the service instances in the current service instance candidate set can achieve load balancing when executing service requests.
[0104] Afterwards, obtain the performance scores of each operating indicator parameter.
[0105] Among them, the performance score is used to characterize the service performance of the service instance in terms of the operating index parameters. Specifically, a performance score table of operating index parameters can be pre-set, and different values of operating index parameters correspond to different performance scores, as shown in Table 1, which shows the performance scores corresponding to CPU utilization. According to the above-collected current instance operating status parameters, the corresponding performance score is obtained in the performance score table.
[0106] Table 1 Performance scores corresponding to CPU utilization
[0107] CPU utilization (%) <50 50-80 80-90 >90 Performance scores 100 80 40 10
[0108] The performance score table settings for other operating indicator parameters are similar and will not be described here one by one.
[0109] Afterwards, based on the weights of each operating indicator parameter and each performance score, the current instance comprehensive parameters of each service instance are calculated.
[0110] Specifically, different operating indicator parameters in the current instance operating state parameters have different importance for calculating the current instance comprehensive parameters of the service instance, so the weight of each operating indicator parameter can be preset. According to each performance score and the corresponding weight, the current instance comprehensive parameters of each service instance are calculated.
[0111] The current instance comprehensive parameters of each service instance are calculated according to the following formula:
[0112]
[0113] Among them, T cur_fusion is the current instance comprehensive parameter of the service instance, P cpu is the performance score of CPU utilization, P mem is the performance score of memory utilization, P tps is the performance score of the request rate, Prt is the performance score of the response time, P concurrency is the performance score of the number of concurrent connections, W cpu , is the weight of CPU utilization, W mem is the weight of memory utilization, W tps is the weight of the request rate, W rt is the weight of response time, W concurrency The weight of the number of concurrent connections.
[0114] In addition, in this embodiment, the maximum threshold and minimum threshold of the instance running state parameter are set, which constrains the range of the running index parameter, and the maximum instance comprehensive parameter and the minimum instance comprehensive parameter can be calculated according to the maximum threshold and the minimum threshold. Among them, the maximum instance comprehensive parameter and the minimum instance comprehensive parameter distribution are the maximum and minimum values of the preset instance comprehensive parameter conditions. The specific calculation method of the maximum instance comprehensive parameter and the minimum instance comprehensive parameter is the same as the method for calculating the current instance comprehensive parameter above, and will not be repeated here.
[0115] Figure 2 Another flow chart of a method for implementing a service request provided by the present disclosure. Figure 2 As shown, the method includes:
[0116] S201: Collect current instance running status parameters of each service instance in the service instance candidate set.
[0117] Specifically, assume that there are three service instances in the service instance candidate set, namely service instance 1, service instance 2, and service instance 3. The current instance running status parameters of the three service instances are collected respectively. The running indicator parameters of service instance 1 are CPU utilization 95%, memory utilization 92%, request rate 240, response time 2s, and concurrent connections 600; the running indicator parameters of service instance 2 are CPU utilization 90%, memory utilization 91%, request rate 220, response time 3s, and concurrent connections 450; the running indicator parameters of service instance 3 are CPU utilization 85%, memory utilization 81%, request rate 220, response time 1s, and concurrent connections 400.
[0118] S202: Calculate the current instance comprehensive parameters of each service instance.
[0119] Specifically, according to the data collected in S201 , it is calculated that the current instance comprehensive parameter of service instance 1 is 32; the current instance comprehensive parameter of service instance 2 is 35; and the current instance comprehensive parameter of service instance 3 is 52.
[0120] According to the preset maximum and minimum thresholds of the instance running status parameters, the maximum and minimum instance comprehensive parameters can be calculated. For example, the maximum CPU utilization can be preset to 90%, the minimum CPU utilization to 60%, the maximum memory utilization to 85%, the minimum memory utilization to 60%, the maximum request rate to 300, the minimum request rate to 30, the maximum response time to 3s, the minimum response time to 0.1s, the maximum number of concurrent connections to 800, and the minimum number of concurrent connections to 20. According to the calculation formula, the minimum instance comprehensive parameter is 40, and the maximum instance comprehensive parameter is 89.
[0121] From the above examples, it can be seen that the current instance comprehensive parameter of service instance 1 is less than the minimum instance comprehensive parameter, the current instance comprehensive parameter of service instance 2 is less than the minimum instance comprehensive parameter, and the current instance comprehensive parameter of service instance 3 is greater than the minimum instance comprehensive parameter and less than the maximum instance comprehensive parameter. At this time, service instance 1 and service instance 2 can generate alarm information.
[0122] S203: Determine the number of service instances that do not meet the preset instance comprehensive parameter conditions.
[0123] Specifically, according to the number of service instances generating alarms in S202, the number of service instances that do not meet the preset instance comprehensive parameter condition exceeds the preset second preset ratio. It is determined that the service instance candidate set needs to be updated.
[0124] S204: Service request temporary storage message queue.
[0125] Specifically, when it is determined to update the candidate set of service instances, it is necessary to suspend the allocation of service instances to service requests, and temporarily store all service requests in the suspended allocation stage in the message queue.
[0126] S205: Update the number of service instances in the service instance candidate set.
[0127] Specifically, according to the above example, the downsizing condition is met at this time, and the number of service instances needs to be reduced. According to the calculation formula, it is necessary to reduce 1 service instance at this time, and the number of service instances in the updated service instance candidate set is 2.
[0128] S206: Consume the service request in the message queue.
[0129] Specifically, when the number of service instances is updated to determine whether the service request can be executed normally, instances need to be reallocated for the service requests in the message queue.
[0130] Figure 3 A schematic diagram of a device for implementing a service request provided in an embodiment of the present disclosure. Figure 3As shown, the device 300 includes: an acquisition module 310 , a first determination module 320 , a second determination module 330 and an execution module 340 .
[0131] The acquisition module 310 is used to acquire the current instance comprehensive parameters of each service instance in the service instance candidate set of the server cluster when receiving the service request from the client, wherein the current instance comprehensive parameters are used to characterize the current performance state of the service instance, and each service instance in the service instance candidate set is a service instance that is currently allowed to receive the service request;
[0132] A first determining module 320 is configured to determine a target service instance from service instances that meet the preset instance comprehensive parameter condition if there are at least a first preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters meet the preset instance comprehensive parameter condition;
[0133] A second determination module 330 is configured to update the number of service instances in the service instance candidate set, and determine a target service instance from the updated service instance candidate set, if there are at least a second preset proportion of the service instances in the service instance candidate set whose current instance comprehensive parameters do not meet a preset instance comprehensive parameter condition;
[0134] The execution module 340 is used to execute the service request based on the target service instance.
[0135] Optionally, the second determining module is used to:
[0136] Calculate the change in the number of service instances in the service instance candidate set according to the current instance comprehensive parameter of each of the service instances in the service instance candidate set, the number of service instances in the service instance candidate set, and a threshold value of the expected instance comprehensive parameter;
[0137] According to the change amount, the number of service instances, and the redundancy degree of the number of service instances, the number of service instances is updated to obtain an updated candidate set of service instances, wherein the redundancy degree of the number of service instances is used to characterize the proportion of the number of service instances that do not meet the preset instance comprehensive parameter condition in the candidate set of service instances;
[0138] The service instance with the minimum comprehensive parameters of the current instance in the updated service instance candidate set is used as the target service instance.
[0139] Optionally, the second determining module is used to:
[0140] In the case where the redundancy degree of the number of service instances indicates that the number of service instances is insufficient, if it is determined that the sum of the change amount and the number of service instances is less than a preset maximum number of cluster service instances, then adding service instances whose number is the change amount to the service instance candidate set;
[0141] When the service instance quantity redundancy degree indicates an excess of service instances, if it is determined that the difference between the change amount and the service instance quantity is greater than a preset minimum cluster service instance quantity, service instances with the change amount are removed from the service instance candidate set.
[0142] Optionally, the second determining module is used to:
[0143] After calculating the change in the number of service instances in the service instance candidate set based on the current instance comprehensive parameters of each of the service instances in the service instance candidate set, the number of service instances in the service instance candidate set, and the threshold of the expected instance comprehensive parameters, if the sum of the change and the number of service instances is greater than a preset maximum number of cluster service instances, or the difference between the number of service instances and the change is less than a preset minimum number of cluster service instances, then the current threshold of the instance running status parameter that affects the setting of the preset instance comprehensive parameter condition is adjusted until the current instance comprehensive parameters of at least the first preset proportion of service instances meet the preset instance comprehensive parameter condition.
[0144] Optionally, the second determining module is used to:
[0145] Calculate a first preset threshold value of the running state parameter of the instance to be adjusted according to the current instance comprehensive parameter of each of the service instances, the number of the service instances, the threshold value of the expected instance comprehensive parameter and the current threshold value of the running state parameter of the instance to be adjusted;
[0146] When it is determined that the current instance comprehensive parameters of at least a first preset proportion of the service instances meet the preset instance comprehensive parameter condition obtained based on the first preset threshold, the first preset threshold is used as the preset threshold of the instance running state parameter to be adjusted.
[0147] Optionally, the first determining module is used to:
[0148] The service instance with the smallest current instance comprehensive parameter in the service instance candidate set is used as the target service instance.
[0149] Optionally, the acquisition module is used to:
[0150] Collecting current instance running status parameters of each service instance in the service instance candidate set, wherein the current instance running status parameters include multiple running indicator parameters;
[0151] Obtaining a performance score for each of the operating indicator parameters, wherein the performance score is used to characterize the service performance of the service instance in terms of the operating indicator parameter;
[0152] Based on the weight of each of the operating indicator parameters and each of the performance scores, current instance comprehensive parameters of each of the service instances are calculated.
[0153] The present application also provides an electronic device to implement the above service request implementation method. Figure 4 It shows a schematic diagram of an electronic device provided by some embodiments of the present application. Figure 4 As shown, the electronic device 4 includes: a processor 400, a memory 401, a bus 402 and a communication interface 403, wherein the processor 400, the communication interface 403 and the memory 401 are connected via the bus 402; the memory 401 stores a computer program that can be run on the processor 400, and when the processor 400 runs the computer program, it executes the implementation method of the service request provided in any of the aforementioned embodiments of the present application.
[0154] The memory 401 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the device network element and at least one other network element is realized through at least one communication interface 403 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0155] The bus 402 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 401 is used to store programs, and the processor 400 executes the programs after receiving the execution instruction. The implementation method of the service request disclosed in any implementation method of the embodiment of the present application may be applied to the processor 400, or implemented by the processor 400.
[0156] The processor 400 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 400. The above processor 400 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a readily available programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 401, and the processor 400 reads the information in the memory 401 and completes the steps of the above method in combination with its hardware.
[0157] The electronic device provided in the embodiment of the present application and the method for implementing the service request provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented therein.
[0158] An embodiment of the present application also provides a computer-readable storage medium corresponding to the method for implementing the service request provided by the aforementioned embodiment. The computer-readable storage medium shown may be a CD on which a computer program is stored. When the computer program is run by a processor, it will execute the method for implementing the service request provided by any of the aforementioned embodiments.
[0159] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.
[0160] The computer-readable storage medium provided in the above-mentioned embodiments of the present application and the method for implementing the service request provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.
[0161] The present application also provides a computer program product 500. Figure 5 The computer program product carries a computer program 501, and the instructions included in the program code can be used to execute the steps of the method for implementing the service request described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0162] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0163] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0164] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0165] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0166] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0167] Various changes, substitutions, and modifications of the techniques described herein may be made without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of the present disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and actions described above. Currently existing or later to be developed processes, machines, manufactures, compositions of events, means, methods, or actions that perform substantially the same functions or achieve substantially the same results as the corresponding aspects described herein may be utilized. Thus, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or actions within their scope.
[0168] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0169] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for implementing a service request, characterized in that: include: When receiving a service request from a client, obtaining current instance comprehensive parameters of each service instance in a service instance candidate set of a server cluster, wherein the current instance comprehensive parameters are used to characterize a current performance state of the service instance, and each service instance in the service instance candidate set is a service instance that is currently allowed to receive the service request; If there are at least a first preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters meet a preset instance comprehensive parameter condition, determining a target service instance from the service instances that meet the preset instance comprehensive parameter condition; When there are at least a second preset proportion of the service instances in the service instance candidate set whose current instance comprehensive parameters do not meet the preset instance comprehensive parameter conditions, updating the number of service instances in the service instance candidate set, and determining the target service instance from the updated service instance candidate set; The service request is executed based on the target service instance.
2. The method according to claim 1, characterized in that: The updating of the number of service instances in the service instance candidate set and determining the target service instance from the updated service instance candidate set includes: Calculate the change in the number of service instances in the service instance candidate set according to the current instance comprehensive parameter of each of the service instances in the service instance candidate set, the number of service instances in the service instance candidate set, and a threshold value of the expected instance comprehensive parameter; According to the change amount, the number of service instances, and the redundancy degree of the number of service instances, the number of service instances is updated to obtain an updated candidate set of service instances, wherein the redundancy degree of the number of service instances is used to characterize the proportion of the number of service instances that do not meet the preset instance comprehensive parameter condition in the candidate set of service instances; The service instance with the minimum comprehensive parameters of the current instance in the updated service instance candidate set is used as the target service instance.
3. The method according to claim 2, characterized in that The updating of the number of service instances according to the change amount, the number of service instances and the redundancy degree of the number of service instances includes: In the case where the redundancy degree of the number of service instances indicates that the number of service instances is insufficient, if it is determined that the sum of the change amount and the number of service instances is less than a preset maximum number of cluster service instances, then adding service instances whose number is the change amount to the service instance candidate set; When the service instance quantity redundancy degree indicates an excess of service instances, if it is determined that the difference between the change amount and the service instance quantity is greater than a preset minimum cluster service instance quantity, service instances with the change amount are removed from the service instance candidate set.
4. The method according to claim 2, characterized in that: After calculating the change in the number of service instances in the service instance candidate set according to the current instance comprehensive parameter of each of the service instances in the service instance candidate set, the number of service instances in the service instance candidate set, and the threshold of the expected instance comprehensive parameter, the method further includes: If the sum of the change amount and the number of service instances is greater than the preset maximum number of cluster service instances, or the difference between the number of service instances and the change amount is less than the preset minimum number of cluster service instances, the current threshold of the instance operating status parameter that affects the setting of the preset instance comprehensive parameter condition is adjusted until the current instance comprehensive parameters of at least the first preset proportion of service instances meet the preset instance comprehensive parameter condition.
5. The method according to claim 4, characterized in that The adjusting the current threshold of the instance running state parameter that affects the setting of the preset instance comprehensive parameter condition until the current instance comprehensive parameters of at least the first preset proportion of service instances meet the preset instance comprehensive parameter condition includes: Calculate a first preset threshold value of the running state parameter of the instance to be adjusted according to the current instance comprehensive parameter of each of the service instances, the number of the service instances, the threshold value of the expected instance comprehensive parameter and the current threshold value of the running state parameter of the instance to be adjusted; When it is determined that the current instance comprehensive parameters of at least a first preset proportion of the service instances meet the preset instance comprehensive parameter condition obtained based on the first preset threshold, the first preset threshold is used as the preset threshold of the instance running state parameter to be adjusted.
6. The method according to claim 1, characterized in that The determining of the target service instance from the service instances that meet the preset instance comprehensive parameter conditions includes: The service instance with the smallest current instance comprehensive parameter in the service instance candidate set is used as the target service instance.
7. The method according to claim 1, characterized in that The step of obtaining the current instance comprehensive parameters of each service instance in the service instance candidate set of the server cluster includes: Collecting current instance running status parameters of each service instance in the service instance candidate set, wherein the current instance running status parameters include multiple running indicator parameters; Obtaining a performance score for each of the operating indicator parameters, wherein the performance score is used to characterize the service performance of the service instance in terms of the operating indicator parameter; Based on the weight of each of the operating indicator parameters and each of the performance scores, current instance comprehensive parameters of each of the service instances are calculated.
8. A device for implementing a service request, characterized in that: include: An acquisition module, configured to, upon receiving a service request from a client, acquire a current instance comprehensive parameter of each service instance in a service instance candidate set of a server cluster, wherein the current instance comprehensive parameter is used to characterize a current performance state of the service instance, and each service instance in the service instance candidate set is a service instance that is currently allowed to receive a service request; A first determining module is used to determine a target service instance from service instances that meet the preset instance comprehensive parameter condition when there are at least a first preset proportion of service instances in the service instance candidate set whose current instance comprehensive parameters meet the preset instance comprehensive parameter condition; A second determination module is used to update the number of service instances in the service instance candidate set when there are at least a second preset proportion of the service instances in the service instance candidate set whose current instance comprehensive parameters do not meet the preset instance comprehensive parameter conditions, and determine the target service instance from the updated service instance candidate set; An execution module is used to execute the service request based on the target service instance.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor runs the computer program to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The invention comprises a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes any one of claims 1 to 7.
Citation Information
Patent Citations
Method, device and equipment for dynamically reducing and expanding capacity of micro service
CN114490078A
Method and device for adjusting number of application examples
CN114844843A
Service creation method and device, equipment, storage medium and program product
CN117421065A
Techniques for decentralized load balancing
US20180239651A1