Cluster load evaluation method and electronic equipment
By calculating the load and resource sharing of each server, we can accurately assess the server cluster load, solve the problem of uneven resource distribution, optimize cluster performance and availability, and reduce latency and power consumption.
Patent Information
- Application Number
- CN202410872739.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-01
AI Technical Summary
Existing technology makes it difficult to accurately assess server cluster load, resulting in uneven resource distribution, high latency and power consumption, and inability to effectively optimize cluster performance and availability.
By calculating the load of each server and counting the cluster load, the amount of shared resources of the resource sharing cluster is determined, and the target cluster load is calculated based on the initial cluster load and the amount of shared resources, and the resource sharing situation is considered to optimize the load.
It achieves accurate assessment of server cluster load, supports subsequent load optimization, improves resource utilization and performance, and reduces latency and power consumption.
Smart Images

Figure CN118394622B
Abstract
Description
Technical Field
[0001] The present application relates to the field of server operation and maintenance technology, and in particular to a cluster load evaluation method and electronic equipment. Background Art
[0002] Server clustering is a technology that combines multiple servers into an overall logical unit, which can efficiently utilize computing resources and improve the availability and performance of applications. Cluster load evaluation and analysis is to evaluate and analyze the load of the server cluster to determine whether the server cluster can meet current and future needs, so as to optimize and upgrade it in a targeted manner and improve the performance and availability of the entire cluster.
[0003] For example, due to the rapid increase in the number of IoT devices, the traditional end-to-cloud model will cause network congestion and delay. Based on this, an end-to-edge-to-cloud working mode has been developed to reduce the network pressure on the cloud by deploying edge servers at base stations. However, as the number of edge servers increases, resources become uneven. For example, some base stations have a large number of edge servers and less pressure, but some base stations have fewer edge servers, resulting in high delays and power consumption. Therefore, it is necessary to evaluate the load of the edge server cluster corresponding to each base station to achieve subsequent optimization.
[0004] How to accurately evaluate the load of a server cluster is an urgent problem to be solved by those skilled in the art. Summary of the invention
[0005] The present application at least provides a cluster load evaluation method and electronic device.
[0006] In a first aspect, the present application provides a cluster load evaluation method, the method comprising: calculating the load of each server in each cluster to obtain the server load; combining the server load of each server in each cluster to respectively obtain the initial cluster load of each cluster; determining the current target cluster and the resource sharing cluster corresponding to the current target cluster, and based on the initial cluster load of the resource sharing cluster, calculating the amount of shared resources that the resource sharing cluster can provide to the current target cluster; based on the initial cluster load of the current target cluster and the amount of shared resources of each resource sharing cluster, calculating the target cluster load of the current target cluster.
[0007] In one embodiment, the load of each server in each cluster is calculated to obtain the server load, including: detecting the task response time and operating power consumption of the server; and calculating the server load of the server based on the task response time and the operating power consumption.
[0008] In one embodiment, the server load of the server is calculated based on the task response time and the operating power consumption, including: normalizing the task response time and the operating power consumption respectively to obtain a normalized time value and a normalized power consumption value; and performing weighted summation of the normalized time value and the normalized power consumption value to obtain the server load of the server.
[0009] In one embodiment, the initial cluster load of each cluster is statistically obtained by combining the server load of each server in each cluster, including: obtaining the server load of each server in the cluster; summing the server load of each server in the cluster to obtain the initial cluster load of the cluster.
[0010] In one embodiment, based on the initial cluster load of the resource sharing cluster, the amount of shared resources that the resource sharing cluster can provide to the current target cluster is calculated, including: detecting the cluster distance between the resource sharing cluster and the current target cluster; based on the cluster distance and the initial cluster load of the resource sharing cluster, calculating the amount of shared resources that the resource sharing cluster can provide to the current target cluster.
[0011] In one embodiment, based on the cluster distance and the initial cluster load of the resource sharing cluster, the amount of shared resources that the resource sharing cluster can provide to the current target cluster is calculated, including: normalizing the cluster distance to obtain a distance normalization value; and obtaining a sharing weight corresponding to the resource sharing cluster; combining the initial cluster load of the resource sharing cluster, the distance normalization value and the sharing weight to calculate the amount of shared resources that the resource sharing cluster can provide to the current target cluster.
[0012] In one embodiment, the target cluster load of the current target cluster is calculated based on the initial cluster load of the current target cluster and the amount of shared resources of each resource sharing cluster, including: subtracting the initial cluster load of the current target cluster from the amount of shared resources of each resource sharing cluster to obtain the target cluster load of the current target cluster.
[0013] In one embodiment, after calculating the target cluster load of the current target cluster based on the initial cluster load of the current target cluster and the shared resource amount of each resource sharing cluster, the method further includes: determining the number of recommended servers corresponding to the current target cluster based on the target cluster load of the current target cluster.
[0014] In one embodiment, the server is an edge server.
[0015] The second aspect of the present application provides a cluster load evaluation device, which includes: a server load calculation module, which is used to calculate the load of each server in each cluster to obtain the server load; an initial load calculation module, which is used to combine the server load of each server in each cluster and separately obtain the initial cluster load of each cluster; a shared resource quantity calculation module, which is used to determine the current target cluster and the resource sharing cluster corresponding to the current target cluster, and based on the initial cluster load of the resource sharing cluster, calculate the shared resource quantity that the resource sharing cluster can provide to the current target cluster; a target load calculation module, which is used to calculate the target cluster load of the current target cluster based on the initial cluster load of the current target cluster and the shared resource quantity of each resource sharing cluster.
[0016] A third aspect of the present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned cluster load evaluation method.
[0017] A fourth aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, which implement the above-mentioned cluster load evaluation method when the program instructions are executed by a processor.
[0018] The above scheme obtains the server load by calculating the load of each server in each cluster; combines the server load of each server in each cluster to respectively obtain the initial cluster load of each cluster; determines the current target cluster and the resource sharing cluster corresponding to the current target cluster, and calculates the amount of shared resources that the resource sharing cluster can provide to the current target cluster based on the initial cluster load of the resource sharing cluster; calculates the target cluster load of the current target cluster based on the initial cluster load of the current target cluster and the amount of shared resources of each resource sharing cluster, so that when evaluating the load of the current target cluster, in addition to considering the load of the current target cluster itself, the amount of shared resources that the current target cluster can receive is also considered, so that the target cluster load of the current target cluster obtained is more accurate, which is convenient for performing subsequent load optimization operations.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0021] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;
[0022] Figure 2is a flow chart of a cluster load evaluation method shown in an exemplary embodiment of the present application;
[0023] Figure 3 is a schematic diagram of determining the number of edge servers shown in an exemplary embodiment of the present application;
[0024] Figure 4 is a block diagram of a cluster load evaluation device shown in an exemplary embodiment of the present application;
[0025] Figure 5 is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present application;
[0026] Figure 6 It is a schematic diagram of the structure of a computer-readable storage medium shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0027] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0028] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0029] The term "and / or" in this article is only an association information describing the associated objects, indicating that there may be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previous and next associated objects are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.
[0030] The cluster load evaluation method provided in the embodiment of the present application is described below.
[0031] Please refer to Figure 1 , which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application. The solution implementation environment may include a load evaluation device 110 and multiple clusters 120, and the load evaluation device 110 and the clusters 120 are connected to each other for communication.
[0032] The cluster 120 contains multiple servers, which may be physical servers, cloud servers, edge servers, etc. This application does not limit the type of servers.
[0033] The load evaluation device 110 may be other servers outside the cluster 120 , or any server within the cluster 120 , or a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto.
[0034] In one example, the load evaluation device 110 can obtain the server load of each server in each cluster 120 to calculate the target cluster load of each cluster 120. Of course, the load evaluation device 110 can store the calculated target cluster load locally, and can also generate a load optimization strategy for each cluster 120 based on the target cluster load, and can also transmit the target cluster load and / or load optimization strategy to other terminals, etc.
[0035] It should be noted that, in the cluster load evaluation method provided in the embodiment of the present application, the execution subject of each step can be the load evaluation device 110, or the cluster 120, or the load evaluation device 110 and the cluster 120 can be executed in an interactive manner, that is, part of the steps of the method are executed by the load evaluation device 110 and the other part of the steps are executed by the cluster 120.
[0036] See also Figure 2 , Figure 2 is a flow chart of a cluster load evaluation method shown in an exemplary embodiment of the present application. The cluster load evaluation method can be applied to Figure 1 It should be understood that the method can also be applied to other exemplary implementation environments and be specifically executed by devices in other implementation environments, and this embodiment does not limit the implementation environment to which the method is applicable.
[0037] like Figure 2 As shown, the cluster load evaluation method includes at least steps S210 to S240, which are described in detail as follows:
[0038] Step S210: Calculate the load of each server in each cluster to obtain the server load.
[0039] The cluster contains multiple servers. The load of each server is calculated to obtain the server load.
[0040] Exemplarily, the task response time and / or operating power consumption of the server processing the task can be detected. The task response time refers to the time required for the server to complete the task, and the operating power consumption refers to the power loss required to run the server per unit time. The greater the task response time and the operating power consumption, the greater the load on the server; the smaller the task response time and the operating power consumption, the smaller the load on the server.
[0041] Exemplarily, the utilization rate of the central processing unit (CPU) and the memory utilization rate of the server may also be detected, and the server load may be obtained according to the CPU utilization rate and the memory utilization rate.
[0042] It is understandable that the load factors used as reference for server load calculation can be flexibly selected according to the actual scenario. For example, the server load can also be calculated by comprehensively considering task response time, operating power consumption, CPU utilization, memory utilization, etc. This application does not limit this.
[0043] Step S220: combining the server load of each server in each cluster, respectively obtain the initial cluster load of each cluster.
[0044] After obtaining the server load of each server in the cluster, the initial cluster load of the cluster is further calculated.
[0045] Exemplarily, the server load of each server in the cluster may be summed up and the summed result may be used as the initial cluster load of the cluster.
[0046] Exemplarily, the server load of each server in the cluster may also be averaged and the average result may be used as the initial cluster load of the cluster.
[0047] Exemplarily, the weight of each server can also be obtained. The weight of the server can be obtained based on the type of server and / or the importance of the task assigned to the server. The loads of each server are weighted and summed according to the weight of each server, and the weighted sum result is used as the initial cluster load of the cluster.
[0048] It is understandable that the specific calculation method used for the initial cluster load calculation can be flexibly selected according to the actual scenario, and this application does not limit this.
[0049] Step S230: determining the current target cluster and the resource sharing cluster corresponding to the current target cluster, and calculating the amount of shared resources that the resource sharing cluster can provide to the current target cluster based on the initial cluster load of the resource sharing cluster.
[0050] There is resource sharing between clusters in this application. For example, cluster 1 can share idle resources with cluster 2.
[0051] The shared resources include but are not limited to servers, CPUs, and memory.
[0052] The current target cluster refers to a cluster that needs to be load evaluated, and can be any cluster among multiple clusters.
[0053] The resource sharing cluster corresponding to the current target cluster refers to a cluster that can share resources with the current target cluster. The resource sharing cluster corresponding to the current target cluster can be determined based on historical resource sharing records between clusters and / or cluster types and / or distances between clusters.
[0054] For each resource sharing cluster corresponding to the current target cluster, the amount of shared resources that the resource sharing cluster can provide to the current target cluster is calculated according to the initial cluster load of the resource sharing cluster.
[0055] Exemplarily, the initial cluster load is directly converted into the amount of shared resources that the resource sharing cluster can provide to the current target cluster. Specifically, the greater the initial cluster load of the resource sharing cluster, the smaller the amount of shared resources that the resource sharing cluster can provide to the current target cluster; conversely, the smaller the initial cluster load of the resource sharing cluster, the larger the amount of shared resources that the resource sharing cluster can provide to the current target cluster.
[0056] Exemplarily, multiple initial cluster loads of the resource sharing cluster within a preset time period can also be recorded, and then the load changes of the resource sharing cluster can be analyzed, and the load of the resource sharing cluster in a future time period can be predicted based on the load changes. According to the predicted load of the resource sharing cluster, the amount of shared resources that the resource sharing cluster can provide to the current target cluster can be calculated.
[0057] Optionally, in addition to calculating the amount of shared resources that the resource sharing cluster can provide based on the initial cluster load of the resource sharing cluster, the amount of shared resources can be further determined in combination with other resource sharing influencing factors of the resource sharing cluster. For example, resource sharing influencing factors include but are not limited to the distance between the current target cluster and the resource sharing cluster, the initial cluster load of all clusters that can share resources corresponding to the resource sharing cluster, etc. This application does not limit this.
[0058] For example, all clusters that can share resources corresponding to the resource sharing cluster are determined, and these clusters are used as the sharing candidate clusters corresponding to the resource sharing cluster. The sharing candidate cluster contains the current target cluster, and the initial cluster load of each sharing candidate cluster is obtained. Each sharing candidate cluster can be sorted in descending order according to the size of the initial cluster load of each sharing candidate cluster to obtain a sorting result. In addition, according to the initial cluster load of the resource sharing cluster, the total amount of shared resources that the resource sharing cluster can provide is obtained. Then, the sorting position of the current target cluster in the sorting result is determined, and the amount of shared resources that the resource sharing cluster can provide to the current target cluster is obtained by combining the above total amount of shared resources and the sorting position. For example, if the sorting position indicates that the current target cluster is higher in the sorting result, the current target cluster can obtain a larger amount of shared resources from the total amount of shared resources. Conversely, the current target cluster can obtain a smaller amount of shared resources from the total amount of shared resources.
[0059] Step S240: Calculate the target cluster load of the current target cluster based on the initial cluster load of the current target cluster and the amount of shared resources of each resource sharing cluster.
[0060] The target cluster load of the current target cluster is calculated by combining the initial cluster load of the current target cluster and the amount of shared resources of each resource sharing cluster.
[0061] Exemplarily, the shared resource amount of each resource sharing cluster corresponding to the current target cluster is converted into the load that can be reduced, and the difference between the initial cluster load of the current target cluster and the load that can be reduced is calculated to obtain the target cluster load of the current target cluster.
[0062] When performing load evaluation on the current target cluster, the present application not only considers the load of the current target cluster itself, but also considers the amount of shared resources that the current target cluster can receive, so that the target cluster load of the current target cluster is more accurate and convenient for performing subsequent load optimization operations.
[0063] Next, some embodiments of the present application are described in further detail.
[0064] In some implementations, calculating the load of each server in each cluster in step S210 to obtain the server load includes:
[0065] Step S211: Detect the task response time and operating power consumption of the server.
[0066] Step S212: Calculate the server load of the server based on the task response time and the running power consumption.
[0067] Exemplarily, the task response time and the running power consumption are normalized respectively to obtain a normalized time value and a normalized power consumption value; the normalized time value and the normalized power consumption value are weightedly summed to obtain the server load of the server.
[0068] For example, assuming that the task response time is D, the preset minimum delay is Dmin, and the preset maximum delay is Dmax, the normalization method for the task response time D can be referred to the following formula 1:
[0069] d=(D - Dmin) / (Dmax - Dmin) (Formula 1)
[0070] Among them, d is the normalized value of the duration. The larger d is, the longer the delay of the server's task response is and the greater the network load pressure is.
[0071] For example, assuming that the operating power consumption is P, the preset minimum power consumption accepted by the server is Pmin, and the preset maximum power consumption is Pmax, then the normalization method for the operating power consumption P can refer to the following formula 2:
[0072] p = (P - Pmin) / (Pmax - Pmin) (Formula 2)
[0073] Among them, p is the normalized value of power consumption. The larger p is, the greater the power consumption of the server is and the more network requests it processes.
[0074] Furthermore, a weighted sum is performed on the normalized value of the duration and the normalized value of the power consumption to obtain the server load of the server.
[0075] Specifically, the weighting coefficients corresponding to the normalized duration value and the normalized power consumption value are obtained, so as to perform weighted summation on the normalized duration value and the normalized power consumption value according to the weighting coefficients.
[0076] Among them, the weighting coefficient can be a preset value or a value flexibly determined according to actual conditions. For example, the weighting coefficient is determined according to the type of server, the importance of the tasks processed by the server, etc. For example, the more important the task processed by the server, the larger the weighting coefficient corresponding to the normalized value of the duration, so as to ensure that the task can be responded to in a timely manner.
[0077] For example, the formula for weighted summing of the normalized value of duration and the normalized value of power consumption can be referred to the following formula 3:
[0078] k=μ·d+(1-μ)·p (Formula 3)
[0079] Among them, d is the normalized value of duration, p is the normalized value of power consumption, μ is the weighting coefficient, and k is the server load.
[0080] The above embodiment comprehensively considers the task response time and operating power consumption of the server. When load balancing is subsequently performed based on the calculated target cluster load, the number of servers can be reasonably arranged according to their power consumption, thereby reducing server overheating and overheating, reducing server failure rates, and ensuring that task response delays are reduced and task processing efficiency is improved.
[0081] After obtaining the server load, the initial cluster load of the cluster is obtained based on the server loads of all servers in the cluster, so as to calculate the amount of shared resources that the resource sharing cluster can provide to the current target cluster based on the initial cluster load of the resource sharing cluster.
[0082] In some implementations, in step S230, based on the initial cluster load of the resource sharing cluster, calculating the amount of shared resources that the resource sharing cluster can provide to the current target cluster includes:
[0083] Step S231: Detecting the cluster distance between the resource sharing cluster and the current target cluster.
[0084] Step S232: Based on the cluster distance and the initial cluster load of the resource sharing cluster, the amount of shared resources that the resource sharing cluster can provide to the current target cluster is calculated.
[0085] Exemplarily, the cluster distance is normalized to obtain a distance normalization value; and the sharing weight corresponding to the resource sharing cluster is obtained; and the initial cluster load, distance normalization value and sharing weight of the resource sharing cluster are combined to calculate the amount of shared resources that the resource sharing cluster can provide to the current target cluster.
[0086] For example, assume that the current target cluster and the surrounding n clusters share resources, and the cluster distance between the current target cluster and the surrounding resource sharing clusters is represented by Li, i=1, 2...n. Suppose the preset closest distance radius of the current target cluster to the resource sharing base station is Lmin, and the farthest distance radius to the resource sharing base station is Lmax. The normalization of the cluster distance corresponding to each resource sharing cluster can be seen in the following formula 4:
[0087] li=(Li - Lmin) / (Lmax - Lmin) (Formula 4)
[0088] Among them, li indicates the normalized value of the distance between the current target cluster and the i-th resource sharing cluster. The larger the li is, the farther the distance between the current target cluster and the i-th resource sharing cluster is.
[0089] In addition, the sharing weight corresponding to each resource sharing cluster is obtained. The sharing weight corresponding to the resource sharing cluster can be pre-set, or can be flexibly determined based on the importance of the location of the resource sharing cluster, the load fluctuation of the resource sharing cluster in the historical time period, the resource sharing between the resource sharing cluster and the current target cluster in the historical time period, the bandwidth utilization of the resource sharing cluster, etc. For example, the less important the location of the resource sharing cluster, the smaller the load fluctuation of the resource sharing cluster in the historical time period, and the greater the resource sharing amount between the resource sharing cluster and the current target cluster in the historical time period, the greater the sharing weight corresponding to the resource sharing cluster; otherwise, the smaller the sharing weight corresponding to the resource sharing cluster.
[0090] Then, the amount of shared resources that the resource sharing cluster can provide to the current target cluster is calculated by combining the initial cluster load, the distance normalization value, and the sharing weight of the resource sharing cluster.
[0091] For example, the initial cluster load of the i-th resource sharing cluster is ki, the distance normalization value is li, and the sharing weight is λi. Then the amount of shared resources that the resource sharing cluster can provide to the current target cluster is expressed as λi·li·ki.
[0092] Since network delay is related to distance, the longer the distance, the greater the delay. Therefore, considering the cluster distance between the resource sharing cluster and the current target cluster when calculating the amount of shared resources can improve the accuracy of the calculated shared resource amount and facilitate subsequent load balancing.
[0093] Exemplarily, in step S240, the target cluster load of the current target cluster is calculated based on the initial cluster load of the current target cluster and the shared resource amount of each resource sharing cluster, including: subtracting the initial cluster load of the current target cluster and the shared resource amount of each resource sharing cluster to obtain the target cluster load of the current target cluster.
[0094] For example, the method for calculating the target cluster load can refer to the following formula 5:
[0095] N = ∑k-∑λ1·l1·k1-∑λ2·l2·k2-...-∑λn·ln·kn (Formula 5)
[0096] Among them, ∑k refers to the sum of the server loads of all servers in the current target cluster, that is, the initial cluster load of the current target cluster; ∑λ1·l1·k1 refers to the amount of shared resources that the first resource sharing cluster can provide to the current target cluster; ∑λ2·l2·k2 refers to the amount of shared resources that the second resource sharing cluster can provide to the current target cluster; ∑λn·ln·kn refers to the amount of shared resources that the nth resource sharing cluster can provide to the current target cluster; N is the target cluster load of the current target cluster.
[0097] After obtaining the target cluster load, the target cluster load can be displayed to the technical staff to prompt the technical staff to adjust the resources of each cluster; a load balancing strategy can also be generated according to the target cluster load. If the target cluster load indicates that the cluster load is large, the load balancing strategy is to increase the number of edge servers.
[0098] Exemplarily, after calculating the target cluster load of the current target cluster based on the initial cluster load of the current target cluster and the amount of shared resources of each resource sharing cluster, the method further includes: determining the number of recommended servers corresponding to the current target cluster based on the target cluster load of the current target cluster.
[0099] For example, multiple threshold intervals are pre-set, and different threshold intervals correspond to different numbers of servers. The threshold interval in which the value of the target cluster load N calculated by the above embodiment is located is detected, and the number of servers corresponding to the threshold interval is used as the recommended number of servers corresponding to the current target cluster. The recommended number of servers indicates the optimal number of servers that need to be deployed in the current target cluster under the target cluster load N. The recommended number of servers matches the load situation of the cluster and balances the server deployment cost and load.
[0100] Taking edge servers as an example, the process of determining the number of servers is explained as follows:
[0101] For example, see Figure 3 , Figure 3 This is a schematic diagram of determining the number of edge servers shown in an exemplary embodiment of the present application, such as Figure 3 As shown, each base station corresponds to a cluster. The current target base station contains m edge servers. The server load of each edge server is calculated to obtain server load 1, server load 2, ..., server load m. According to server load 1, server load 2, ..., server load m, the initial base station load of the current target base station is calculated. Then, the resource sharing base station corresponding to the current target base station is determined to obtain n resource sharing base stations. Similarly, the initial cluster load of each resource sharing base station is calculated, expressed as shared base station load 1, shared base station load 2, ..., shared base station load n. Combined with the target base station load and shared base station load 1, shared base station load 2, ..., shared base station load n, the final target base station load is calculated to determine the recommended number of servers corresponding to the current target base station according to the target base station load, that is, the optimal number of edge servers deployed for the current target base station under the current load conditions.
[0102] The cluster load evaluation method provided in the present application obtains the server load by calculating the load of each server in each cluster; combines the server load of each server in each cluster to respectively obtain the initial cluster load of each cluster; determines the current target cluster and the resource sharing cluster corresponding to the current target cluster, and based on the initial cluster load of the resource sharing cluster, calculates the amount of shared resources that the resource sharing cluster can provide to the current target cluster; based on the initial cluster load of the current target cluster and the amount of shared resources of each resource sharing cluster, calculates the target cluster load of the current target cluster, so that when performing load evaluation on the current target cluster, in addition to considering the load situation of the current target cluster itself, the amount of shared resources that the current target cluster can receive is also considered, so that the target cluster load of the current target cluster obtained is more accurate, which is convenient for performing subsequent load optimization operations.
[0103] Figure 4 FIG. 1 is a block diagram of a cluster load evaluation device shown in an exemplary embodiment of the present application. Figure 4 As shown, the exemplary cluster load evaluation device 400 includes: a server load calculation module 410, an initial load calculation module 420, a shared resource quantity calculation module 430 and a target load calculation module 440. Specifically:
[0104] A server load calculation module 410 is used to calculate the load of each server in each cluster to obtain the server load;
[0105] An initial load calculation module 420 is used to combine the server load of each server in each cluster and obtain the initial cluster load of each cluster by statistics;
[0106] A shared resource amount calculation module 430 is used to determine the current target cluster and the resource sharing cluster corresponding to the current target cluster, and calculate the shared resource amount that the resource sharing cluster can provide to the current target cluster based on the initial cluster load of the resource sharing cluster;
[0107] The target load calculation module 440 is used to calculate the target cluster load of the current target cluster based on the initial cluster load of the current target cluster and the amount of shared resources of each resource sharing cluster.
[0108] It should be noted that the cluster load evaluation device provided in the above embodiment and the cluster load evaluation method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the cluster load evaluation device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0109] See also Figure 5 , Figure 5 1 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 500 includes a memory 501 and a processor 502, and the processor 502 is used to execute program instructions stored in the memory 501 to implement the steps in any of the above cluster load evaluation method embodiments. In a specific implementation scenario, the electronic device 500 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 500 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0110] Specifically, the processor 502 is used to control itself and the memory 501 to implement the steps in any of the above-mentioned cluster load evaluation method embodiments. The processor 502 can also be called a central processing unit (CPU). The processor 502 may be an integrated circuit chip with signal processing capabilities. The processor 502 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 502 can be implemented by an integrated circuit chip.
[0111] See also Figure 6 , Figure 6 The computer-readable storage medium 600 stores program instructions 610 that can be executed by a processor, and the program instructions 610 are used to implement the steps in any of the above cluster load evaluation method embodiments.
[0112] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0113] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0114] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0115] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
Claims
1. A cluster load evaluation method, It is characterized in that There are multiple clusters, each cluster contains multiple servers, and resources are shared among the clusters. The method includes: Calculating the load of each server in each cluster to obtain the server load; Combining the server load of each server in each cluster, respectively obtaining the initial cluster load of each cluster by statistics; Determine a current target cluster and a resource sharing cluster corresponding to the current target cluster, and calculate the amount of shared resources that the resource sharing cluster can provide to the current target cluster based on an initial cluster load of the resource sharing cluster; Performing a subtraction operation on the initial cluster load of the current target cluster and the amount of shared resources of each of the resource sharing clusters to obtain a target cluster load of the current target cluster; The step of calculating the amount of shared resources that the resource sharing cluster can provide to the current target cluster based on the initial cluster load of the resource sharing cluster includes: converting an initial cluster load of the resource sharing cluster into an amount of shared resources that the resource sharing cluster can provide to the current target cluster, wherein the initial cluster load is inversely correlated with the amount of shared resources; Alternatively, based on a plurality of initial cluster loads of the resource sharing cluster within a preset time period, a load change of the resource sharing cluster is calculated, and based on the load change, an amount of shared resources that the resource sharing cluster can provide to the current target cluster is calculated; Alternatively, all clusters corresponding to the resource sharing cluster that can perform resource sharing are determined to obtain a sharing candidate cluster corresponding to the resource sharing cluster, wherein the sharing candidate cluster contains the current target cluster, and each sharing candidate cluster is sorted in descending order according to the size of the initial cluster load of each sharing candidate cluster to obtain a sorting result, and, based on the initial cluster load of the resource sharing cluster, the total amount of shared resources that can be provided by the resource sharing cluster is obtained; based on the sorting position of the current target cluster in the sorting result, the amount of shared resources obtained by dividing the current target cluster from the total amount of shared resources is determined; Alternatively, the cluster distance between the resource sharing cluster and the current target cluster is detected; and based on the cluster distance and the initial cluster load of the resource sharing cluster, the amount of shared resources that the resource sharing cluster can provide to the current target cluster is calculated.
2. The method according to claim 1, It is characterized in that The calculating the load of each server in each cluster to obtain the server load includes: Detecting the task response time and operating power consumption of the server; The server load of the server is calculated based on the task response time and the running power consumption.
3. The method according to claim 2, It is characterized in that The calculating the server load of the server based on the task response time and the running power consumption includes: Normalizing the task response time and the running power consumption respectively to obtain a normalized time value and a normalized power consumption value; A weighted sum is performed on the normalized value of the duration and the normalized value of the power consumption to obtain a server load of the server.
4. The method according to claim 1, It is characterized in that The combining the server load of each server in each cluster to obtain the initial cluster load of each cluster includes: Obtaining a server load of each server in the cluster; The server load of each server in the cluster is summed to obtain an initial cluster load of the cluster.
5. The method according to claim 1, It is characterized in that Calculating the amount of shared resources that the resource sharing cluster can provide to the current target cluster based on the cluster distance and the initial cluster load of the resource sharing cluster includes: Normalizing the cluster distance to obtain a distance normalization value; and obtaining a sharing weight corresponding to the resource sharing cluster; The amount of shared resources that the resource sharing cluster can provide to the current target cluster is calculated by combining the initial cluster load of the resource sharing cluster, the normalized distance value, and the sharing weight.
6. The method according to claim 1, It is characterized in that After calculating the target cluster load of the current target cluster based on the initial cluster load of the current target cluster and the amount of shared resources of each of the resource sharing clusters, the method further includes: Based on the target cluster load of the current target cluster, the number of recommended servers corresponding to the current target cluster is determined.
7. The method according to any one of claims 1 to 6, It is characterized in that The server is an edge server.
8. An electronic device, It is characterized in that The electronic device comprises a memory and a processor, and the processor is used to execute program instructions stored in the memory to implement the steps in the method according to any one of claims 1 to 6.
