System resource dynamic expansion and contraction method, device, computer equipment and storage medium
By analyzing the business data and resource usage of the target system in real time and dynamically adjusting system resources, the problem of resource scheduling lag in the existing technology is solved, and the system stability and resource utilization efficiency are improved.
Patent Information
- Application Number
- CN201811552783.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-18
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2038-12-18
AI Technical Summary
Existing system resource scheduling methods lag in response to business data concurrency, resulting in low resource allocation timeliness and reducing system stability.
By capturing the system log of the target system in real time, the current business data and allocated resources are obtained, and the business operation indicators and resource usage are analyzed according to the preset business indicator rules. If the usage is less than the lower limit, a reduction instruction will be sent. If used If the situation is greater than the upper limit, an expansion command will be sent to realize dynamic expansion and contraction of system resources.
It improves the timeliness of resource allocation in the system resource pool, enhances the business stability of the target system, responds to business data concurrency in a timely manner, and avoids system downtime.
Smart Images

Figure CN109766182B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system configuration, and in particular to a method, device, computer equipment and storage medium for dynamically expanding and contracting system resources. Background Art
[0002] With the rapid development of cloud computing technology, the system resource pool integrates the resources of multiple systems and can allocate different resources to different systems according to actual needs to meet the business needs of different systems. Among them, the allocation of system resources plays an extremely important role in the normal operation of the business.
[0003] In actual use, the system may face high concurrency of business data. For example, if the business corresponding to the system is on promotion and the number of users increases greatly, the system will be accessed by a sudden increase of users and generate a large amount of concurrent business data. At this time, if the system resources are insufficient, it is easy to cause unstable business operation or even system downtime. In this case, the general practice in the industry is to manually operate the system resource pool to expand and shrink resources for each system according to the concurrency of business data and complete the scheduling of system resources.
[0004] However, the existing system resource scheduling methods often lag behind the concurrency of business data, making it difficult to complete system resource scheduling in a timely manner, resulting in low timeliness of resource allocation in the system resource pool and reducing the stability of business operations in various systems. Summary of the invention
[0005] The embodiments of the present invention provide a method, apparatus, computer equipment and storage medium for dynamically expanding and contracting system resources to solve the problem of low timeliness of existing system resource scheduling and reduced system stability.
[0006] A method for dynamically expanding and contracting system resources, characterized by comprising:
[0007] Capture the system log of the target system in real time, and obtain the current business data of the target system from the system log;
[0008] Acquire the allocated system resources that have been allocated to the target system from the system resource pool;
[0009] Analyze the current business data according to preset business indicator rules to obtain the current business operation indicator of the target system, wherein the business operation indicator represents the operation status of the current business data on the target system;
[0010] Calculating a resource usage indicator of the target system according to the business operation indicator and the allocated system resources, wherein the resource usage indicator represents the degree of use of the allocated system resources by the target system;
[0011] If the resource usage indicator is less than a preset indicator lower limit, sending a shrinking instruction to the system resource pool, the shrinking instruction enables the system resource pool to release resources of the target system;
[0012] If the resource usage indicator is greater than a preset indicator upper limit, an expansion instruction is sent to the system resource pool, the expansion instruction causes the system resource pool to increase resource allocation for the target system, and the indicator upper limit is greater than the indicator lower limit.
[0013] A system resource dynamic expansion and contraction device, characterized by comprising:
[0014] A system log capture module is used to capture the system log of the target system in real time and obtain the current business data of the target system from the system log;
[0015] An allocated resource acquisition module, used for acquiring allocated system resources that have been allocated to the target system by a system resource pool;
[0016] A business data analysis module, used to analyze the current business data according to preset business indicator rules to obtain the current business operation indicator of the target system, wherein the business operation indicator represents the operation status of the current business data on the target system;
[0017] A resource usage calculation module, used to calculate a resource usage indicator of the target system according to the business operation indicator and the allocated system resources, wherein the resource usage indicator represents the degree of use of the allocated system resources by the target system;
[0018] A capacity reduction module, configured to send a capacity reduction instruction to the system resource pool if the resource usage indicator is less than a preset indicator lower limit, wherein the capacity reduction instruction causes the system resource pool to release resources of the target system;
[0019] The capacity expansion module is used to send a capacity expansion instruction to the system resource pool if the resource usage indicator is greater than a preset indicator upper limit value, and the capacity expansion instruction enables the system resource pool to increase resource allocation for the target system, and the indicator upper limit value is greater than the indicator lower limit value.
[0020] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for dynamically expanding and contracting system resources when executing the computer program.
[0021] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for dynamically expanding and contracting system resources.
[0022] The above-mentioned system resource dynamic expansion and contraction method, device, computer equipment and storage medium first capture the system log of the target system in real time, and obtain the current business data concurrency of the target system from the system log; then, obtain the allocated system resources that the system resource pool has allocated to the target system; analyze the current business data according to the preset business indicator rules to obtain the current business operation indicator of the target system, and the business operation indicator characterizes the operation status of the current business data on the target system; then, calculate the resource usage indicator of the target system according to the business operation indicator and the allocated system resources, and the resource usage indicator characterizes the degree of use of the allocated system resources by the target system; if the resource usage indicator is less than the preset indicator lower limit, send a reduction instruction to the system resource pool, and the reduction instruction enables the system resource pool to release the resources of the target system; if the resource usage indicator is greater than the preset indicator upper limit, send an expansion instruction to the system resource pool, and the expansion instruction enables the system resource pool to increase resource allocation for the target system. It can be seen that the present invention obtains the current business data concurrency of the target system by capturing the system log of the target system in real time, thereby ensuring timely knowledge of the business data concurrency situation and reducing the lag in the response of the system resource pool; in addition, the business data concurrency and the allocated resources of the target system are combined to comprehensively consider the system resource usage of the target system, and the upper and lower limits of the indicators are used to accurately determine whether the system needs to be expanded or reduced in capacity, and the target system is expanded or reduced accordingly, which can complete the resource scheduling of the target system in time, improve the timeliness of resource allocation of the system resource pool, and enhance the stability of the target system's business operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0024] Figure 1 This is a schematic diagram of an application environment of a method for dynamically expanding and contracting system resources in one embodiment of the present invention;
[0025] Figure 2 is a flow chart of a method for dynamically expanding and contracting system resources in one embodiment of the present invention;
[0026] Figure 3 This is a flow chart of step 104 of the method for dynamically scaling system resources in an application scenario in one embodiment of the present invention;
[0027] Figure 4 It is a flow chart of presetting upper and lower limits of indicators in an application scenario of a method for dynamically scaling system resources in one embodiment of the present invention;
[0028] Figure 5 It is a flow chart of generating a shrinking instruction in an application scenario in a method for dynamically expanding and shrinking system resources in one embodiment of the present invention;
[0029] Figure 6 It is a schematic diagram of a flow chart of generating a capacity expansion instruction in an application scenario of a method for dynamically expanding and contracting system resources in one embodiment of the present invention;
[0030] Figure 7 It is a schematic diagram of the structure of a device for dynamically expanding and contracting system resources in one embodiment of the present invention;
[0031] Figure 8 is a schematic diagram of the structure of the resource usage calculation module 604 in one embodiment of the present invention;
[0032] Fig. 9 It is a schematic diagram of the structure of the system resource dynamic expansion and contraction device in another application scenario in one embodiment of the present invention;
[0033] Fig.10 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] The system resource dynamic expansion and contraction method provided in this application can be applied to Figure 1 In an application environment, a system resource pool communicates with a server through a network. The server can be implemented as an independent server or a server cluster composed of multiple servers.
[0036] In one embodiment, if Figure 2 As shown, a method for dynamically expanding and contracting system resources is provided, and the method is applied in Figure 1 The server in the example is used as an example to illustrate the process, including the following steps:
[0037] 101. Capture a system log of a target system in real time, and obtain current business data of the target system from the system log;
[0038] In this embodiment, when the target system is running a business, the business data will be recorded in the system log of the target system. It should be noted that the current business data mentioned here does not require the specific data content of the business, but can also be the data statistical information of the current business. For example, the current business of the target system is to transmit a movie to the user. The current business data recorded in the system log may include the movie, or may not include the movie. Only the data statistical information of the current business can be recorded, such as the data volume, time consumed, transmission rate and other information of the movie transmitted this time. In addition, in different business scenarios, the current business data can also be set according to the specific business scenario. For example, in a financial management system, the current business data can be data such as the number of user logins, logouts, financial management purchases, recharge amounts, and reflected amounts.
[0039] It is understandable that the server executing the present method can be connected to the target system for communication and capture the system log of the target system in real time, so that the current business data of the target system can be obtained from the system log.
[0040] 102. Acquire the allocated system resources that have been allocated to the target system from the system resource pool;
[0041] like Figure 1 As shown, the system resource pool is connected to each system, manages the resources of each system, and completes the scheduling and allocation of each system resource. For the target system, the system resource pool currently has allocated some resources to the target system, that is, the allocated system resources. The server can initiate a request to the system resource pool to obtain the allocated system resources through communication connection with the system resource pool, and can also initiate a request to the target system to obtain the allocated system resources.
[0042] 103. Analyze the current business data according to a preset business indicator rule to obtain a current business operation indicator of the target system, where the business operation indicator represents the operation status of the current business data on the target system;
[0043] In this embodiment, the server may pre-set business indicator rules, which specify which indicators are used to characterize the operating status of business data on the system. Specifically, the business indicator rules may be set to use indicators such as business concurrency and business hit rate to characterize the operating status. That is, when the server executes step 103, the business concurrency and business hit rate of the current business data when running in the target system are obtained based on the current business data statistics as the current business operating status indicators. Among them, the business concurrency and the business hit rate are two business operating indicators, and their values are two parameter values corresponding to the two business operating indicators.
[0044] 104. Calculate a resource usage indicator of the target system according to the business operation indicator and the allocated system resources, wherein the resource usage indicator represents the degree of use of the allocated system resources by the target system;
[0045] It can be understood that, for the target system, the current resource usage of the target system can be comprehensively evaluated through the operation status of the current business and the allocated system resources of the target system. In this embodiment, the server uses the resource usage indicator to characterize this attribute. In this way, the resource usage of the target system is evaluated. Compared with the existing method, it combines the analysis with the current operation status of the business, which is more in line with the actual usage of the target system and can locate the resource requirements of the target system more accurately than the existing method. The larger the value of the resource usage indicator, the higher the target system's usage of the allocated system resources, and the more the target system needs to be expanded; conversely, the smaller the value of the resource usage indicator, the lower the target system's usage of the allocated system resources, and the more the target system needs to be reduced. The specific calculation of the above step 104 is described as follows.
[0046] Furthermore, the business operation indicator includes each first parameter value corresponding to each business indicator in the business indicator rule, and the allocated system resources include each second parameter value allocated to each performance in the target system, such as Figure 3 As shown, the above step 104 includes:
[0047] 201. For each of the first parameter values and the second parameter values, calculate the proportion of the target system in the system resource pool under each parameter value;
[0048] 202. Calculate the entropy value of each parameter value according to the proportion corresponding to each parameter value using an entropy method;
[0049] 203. Calculate the entropy redundancy of each parameter value according to the entropy value of each parameter value using an entropy method;
[0050] 204. Calculate the weight of each parameter value according to the entropy redundancy of each parameter value;
[0051] 205. After the weight of each parameter value is calculated, a resource usage score of the target system is calculated according to each parameter value and the weight of each parameter value as a resource usage indicator of the target system.
[0052] For the above step 201, it should be first explained that the business operation index may include various business indicators of the business indicator rule, such as business concurrency, business hit rate, etc., and the values of these business indicators are the first parameter values. Similarly, the allocated system resources of the target system may include various performances of the target system, such as memory usage, CPU occupancy, disk I / O usage, etc., and the values of these various performances are the second parameter values. In this embodiment, in order to comprehensively evaluate the resource utilization of the target system based on the business operation status and the allocated resources of the target system, the first parameter values and the second parameter values are used as parameter values for subsequent processing. Therefore, in step 201, for each parameter value, the proportion of the target system in the system resource pool under the parameter value is calculated. Specifically, the system resource pool manages resources of n systems, the target system is one of the n systems, and the above step 201 is specifically: for each of the first parameter values and the second parameter values, a first formula is used to calculate the proportion of the target system in the system resource pool under the parameter value, wherein the first formula is:
[0053]
[0054] Among them, x ij is the jth parameter value of the i-th system among the n systems, p ij is the weight corresponding to the jth parameter value in the ith system.
[0055] As can be seen from the first formula above, when calculating the weight corresponding to any parameter value, the server can combine the parameter values of all systems under the system resource pool to participate in the calculation. For example, assuming that the target system is the first system, n is 3, that is, the system resource pool manages 3 systems, and assuming that a certain parameter value is the value of CPU usage, the server can obtain the CPU usage values of the 3 systems, which are x 11 、x 21 and x 31 , where x 11 is the CPU usage of the target system, then the proportion of the CPU usage of the target system is calculated as p 11=x 11 / (x 11 +x 21 +x 31 ).
[0056] For the above step 202, it can be specifically: for each of the first parameter values and the second parameter values, the entropy value of the parameter value is calculated according to the proportion corresponding to the parameter value using a second formula, wherein the second formula is:
[0057]
[0058] Among them, e j is the entropy value of the j-th parameter value, the preset coefficient k is greater than 0, and ln is the natural logarithm.
[0059] For the above step 203, it can be specifically: for each parameter value in the first parameter value and each second parameter value, the entropy redundancy of the parameter value is calculated according to the entropy value of the parameter value using a third formula, wherein the third formula is:
[0060] d j =1-e j
[0061] Among them, d j is the entropy redundancy of the jth parameter value.
[0062] For the above step 204, it can be specifically: for each of the first parameter values and the second parameter values, a fourth formula is used to calculate the weight of the parameter value according to the entropy redundancy of the parameter value, wherein the fourth formula is:
[0063]
[0064] Among them, W j is the weight of the jth parameter, m is the total number of business indicators included in the business operation indicators and various performances included in the allocated system resources, which is equal to the sum of the number of each first parameter value and the number of each second parameter value.
[0065] For the above step 205, it can be specifically: after calculating the weight of each parameter value, using the fifth formula to calculate the resource usage score value of the target system according to each parameter value and the weight of each parameter value as the resource usage indicator of the target system, wherein the fifth formula is:
[0066]
[0067] Among them, S iA resource usage score value of an i-th system among the n systems.
[0068] It can be understood that the fifth formula is a formula for calculating the resource usage score of any system in the system resource pool. In this embodiment, the server needs to calculate the resource usage score of the target system only by knowing the number of the target system among the n systems, that is, knowing the i value corresponding to the target system, and then substituting it into the fifth formula to calculate the resource usage score of the target system. It should be particularly noted that although the present embodiment refers to the existing entropy method to calculate the resource usage score of the target system, the difference from the existing entropy method is that the present embodiment uses various business indicators of the comprehensive business operation status and various performances of the allocated resources of the target system as the input of the operation, so that the resource usage score of the target system outputted at the end can consider the degree of system resource usage from the business data level and the system resource level, thereby more accurately locating the resource requirements of the target system.
[0069] 105. If the resource usage indicator is less than a preset indicator lower limit, sending a reduction instruction to the system resource pool, so that the system resource pool releases the resources of the target system according to the reduction instruction;
[0070] 106. If the resource usage indicator is greater than a preset indicator upper limit, an expansion instruction is sent to the system resource pool so that the system resource pool increases resource allocation for the target system according to the expansion instruction, and the indicator upper limit is greater than the indicator lower limit.
[0071] For the above steps 105 and 106, it can be understood that the server can be pre-set with an indicator lower limit value and an indicator upper limit value, and the indicator lower limit value and the indicator upper limit value divide the normal range value of the resource usage indicator of the target system under normal use. Therefore, when the resource usage indicator is less than the preset indicator lower limit value, it indicates that the current resource usage of the target system is too low and difficult to reach the normal range, that is, it indicates that the system resource pool has allocated too many resources to the target system, so the server can send a reduction instruction to the system resource pool, and the system resource pool releases the resources of the target system according to the reduction instruction after receiving the reduction instruction; and when the resource usage indicator is greater than the preset indicator upper limit value, it indicates that the current resource usage of the target system is too high and exceeds the normal range, that is, it indicates that the resources allocated by the system resource pool to the target system are difficult to meet the actual needs of the target system, so the server can send an expansion instruction to the system resource pool, and the system resource pool increases resource allocation for the target system according to the expansion instruction after receiving the expansion instruction.
[0072] It should be noted that how the system resource pool releases or allocates resources to the target system according to the shrinking instruction or the expanding instruction belongs to the existing public technology and will not be described in detail in this embodiment.
[0073] Considering that whether the setting of the lower limit value and the upper limit value of the indicator is reasonable determines whether the resource adjustment of the system resource pool to the target system is appropriate, therefore, in this embodiment, the server sets the lower limit value and the upper limit value of the indicator of the system according to the historical resource usage of the system, so that different lower limit values and the upper limit values of the indicator can be set for different systems in a personalized manner, and the setting of the lower limit value and the upper limit value of the indicator is more reasonable, which is conducive to the reasonable and effective adjustment of the system resources by the system resource pool. Figure 4 As shown, the lower limit value of the indicator and the upper limit value of the indicator are preset by the following steps:
[0074] 301. Acquire various historical resource usage indicators of the target system in a recent time period, where the recent time period refers to a time period of a preset time length closest to the current system time;
[0075] 302. Calculate the average of each of the historical resource usage indicators to obtain an indicator average;
[0076] 303. Calculate the upper limit of the indicator according to the preset floating ratio and the indicator mean;
[0077] 304. Calculate the lower limit of the indicator according to a preset downward floating ratio and the indicator mean.
[0078] For the above step 301, it can be understood that the server can obtain the historical resource usage indicators of the target system in the recent period through the historical data of the target system, for example, it can obtain the various historical resource usage indicators of the target system in the recent week. Assuming that for the target system, 10 resource usage indicators are generated every day, the server can obtain a total of 70 historical resource usage indicators of the target system in the past week. The calculation and acquisition of historical resource usage indicators are consistent with the calculation and acquisition steps of the resource usage indicators of the target system in the above content, and will not be repeated here.
[0079] It should be noted that the most recent time period may refer to a time period of a preset time length that is closest to the current system time. The preset time length may be set based on actual usage, such as one week, one month, or 365 days. This embodiment does not limit this.
[0080] For the above step 302, after obtaining the various historical resource usage indicators of the target system in the recent time period, the server can calculate the average of the various historical resource usage indicators to obtain the indicator average. It can be understood that the indicator average can represent the average resource usage of the target system in the recent time period, and also reasonably reflects the resource usage of the target system in the normal use state in the recent time period to a certain extent, so the server can determine the normal range of the indicator of the target system based on the indicator average.
[0081] For the above steps 303 and 304, the server can preset a certain floating ratio and a floating ratio, for example, the floating ratio can be set to +30%, and the floating ratio can be set to -30%. After the mean value of the indicator is calculated, the upper limit value of the indicator can be calculated according to the preset floating ratio and the mean value of the indicator, and the lower limit value of the indicator can be calculated according to the preset floating ratio and the mean value of the indicator. For example, assuming that the calculated mean value of the indicator is 100, the floating ratio is +30%, and the floating ratio is -30%, then the upper limit value of the indicator is 100*(1+30%)=130, and the lower limit value of the indicator is 100*(1-30%)=70, that is, the normal range of the current indicator of the target system is [70, 130].
[0082] In step 105, the server sends a scaling-down instruction to the system resource pool so that the system resource pool releases the resources of the target system according to the scaling-down instruction. It should be understood that if too many resources of the target system are released, it may affect the normal operation of the target system. If too few resources are released, it will be difficult to effectively save resources and efficiently use resources. Therefore, in this embodiment, the server can further calculate the amount of resources to be released when generating the scaling-down instruction, so that the system resource pool can release the resources of the target system according to the amount of resources to be released specified in the scaling-down instruction, making the scaling-down operation more reasonable and effective. Furthermore, if Figure 5 As shown, the shrinking instruction is generated by the following steps:
[0083] 401. Determine an indicator median value according to the indicator lower limit value and the indicator upper limit value, where the indicator median value is the median value of the indicator interval determined by the indicator lower limit value and the indicator upper limit value;
[0084] 402. Calculate the difference between the median value of the indicator and the resource usage indicator to obtain a first difference value;
[0085] 403. Calculate the ratio of the first difference to the median of the indicator to obtain a first ratio;
[0086] 404. Calculate the product of the allocated system resources and the first ratio to obtain the amount of resources to be released;
[0087] 405 . Generate an instruction requiring the system resource pool to release the amount of resources to be released for the target system, and obtain a capacity reduction instruction.
[0088] For the above step 401, for example, assuming that the lower limit of the indicator is 70 and the upper limit of the indicator is 130, the median value of the indicator can be calculated to be 100.
[0089] For the above step 402 , assuming that the value of the resource usage indicator is 60, the first difference is calculated to be 100-60=40.
[0090] For step 403 , following the above example, the first ratio is 40 / 100=40%.
[0091] For step 404, continuing with the above example, assuming that the value of the allocated system resources is 500, it can be calculated that the amount of resources to be released is 500*40%=200, that is, 200 units of resources need to be released.
[0092] For step 405, after obtaining the amount of resources to be released, the server may generate an instruction requiring the system resource pool to release the amount of resources to be released for the target system, thereby obtaining a capacity reduction instruction.
[0093] In step 106, the server sends an expansion instruction to the system resource pool so that the system resource pool increases resource allocation for the target system according to the expansion instruction. It should be understood that if too many resources are added to the target system, it will cause a waste of resources and reduce resource utilization. If too few resources are added, it will be difficult to relieve the pressure on system operation and improve the quality of system services. Therefore, in this embodiment, the server can further calculate the amount of resources that need to be added when generating the expansion instruction, so that the system resource pool can increase resource allocation for the target system according to the amount of resources that need to be added specified in the expansion instruction, making the expansion operation more reasonable and effective. Further, if Figure 6 As shown, the expansion instruction is generated by the following steps:
[0094] 501. Determine an indicator median value according to the indicator lower limit value and the indicator upper limit value, wherein the indicator median value is the median value of the indicator interval determined by the indicator lower limit value and the indicator upper limit value;
[0095] 502. Calculate the difference between the resource usage indicator and the median value of the indicator to obtain a second difference value;
[0096] 503. Calculate the ratio of the second difference to the median value of the indicator to obtain a second ratio;
[0097] 504. Calculate the product of the allocated system resources and the second ratio to obtain the amount of resources that need to be additionally allocated;
[0098] 505. Generate an instruction requiring the system resource pool to increase the amount of resources to be allocated to the target system, and obtain a capacity expansion instruction.
[0099] For step 501, for example, assuming that the lower limit of the indicator is 70 and the upper limit of the indicator is 130, the median value of the indicator can be calculated to be 100.
[0100] For step 502 , assuming that the value of the resource usage indicator is 150, the second difference is calculated to be 150-100=50.
[0101] For step 503 , following the above example, the second ratio is 50 / 100=50%.
[0102] For step 504, following the above example, assuming that the value of the allocated system resources is 1000, it can be calculated that the amount of resources to be additionally allocated is 1000*50%=500, that is, 500 units of resources need to be additionally allocated.
[0103] For step 505, after obtaining the amount of resources that need to be additionally allocated, the server may generate an instruction to require the system resource pool to increase the allocation of the amount of resources that need to be additionally allocated to the target system, thereby obtaining a capacity expansion instruction.
[0104] Preferably, a webpage module can also be set on the server, which can display the resource allocation of the system resource pool to each system in real time through a webpage, and can also display the system log, system performance indicators, expansion and reduction of the target system in real time. The user can communicate with the server through the client to obtain the webpage content of the webpage module, so as to obtain the above web information.
[0105] In an embodiment of the present invention, first, the system log of the target system is captured in real time, and the current business data concurrency of the target system is obtained from the system log; then, the allocated system resources that have been allocated to the target system by the system resource pool are obtained; the current business data is analyzed according to a preset business indicator rule to obtain the current business operation indicator of the target system, and the business operation indicator characterizes the operation status of the current business data on the target system; then, the resource usage indicator of the target system is calculated according to the business operation indicator and the allocated system resources, and the resource usage indicator characterizes the degree of use of the allocated system resources by the target system; if the resource usage indicator is less than the preset indicator lower limit, a reduction instruction is sent to the system resource pool, so that the system resource pool releases the resources of the target system according to the reduction instruction; if the resource usage indicator is greater than the preset indicator upper limit, an expansion instruction is sent to the system resource pool, so that the system resource pool increases resource allocation for the target system according to the expansion instruction. It can be seen that the present invention obtains the current business data concurrency of the target system by capturing the system log of the target system in real time, thereby ensuring timely knowledge of the business data concurrency situation and reducing the lag in the response of the system resource pool; in addition, the business data concurrency and the allocated resources of the target system are combined to comprehensively consider the system resource usage of the target system, and the upper and lower limits of the indicators are used to accurately determine whether the system needs to be expanded or reduced in capacity, and the target system is expanded or reduced accordingly, which can complete the resource scheduling of the target system in time, improve the timeliness of resource allocation of the system resource pool, and enhance the stability of the target system's business operations.
[0106] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0107] In one embodiment, a system resource dynamic expansion and contraction device is provided, and the system resource dynamic expansion and contraction device corresponds to the system resource dynamic expansion and contraction method in the above embodiment. Figure 7 As shown, the system resource dynamic expansion and contraction device includes a system log capture module 601, an allocated resource acquisition module 602, a business data analysis module 603, a resource usage calculation module 604, a contraction module 605 and an expansion module 606. The functional modules are described in detail as follows:
[0108] The system log capture module 601 is used to capture the system log of the target system in real time and obtain the current business data of the target system from the system log;
[0109] An allocated resource acquisition module 602 is used to acquire the allocated system resources that have been allocated to the target system by the system resource pool;
[0110] The business data analysis module 603 is used to analyze the current business data according to a preset business indicator rule to obtain the current business operation indicator of the target system, wherein the business operation indicator represents the operation status of the current business data on the target system;
[0111] A resource usage calculation module 604, configured to calculate a resource usage indicator of the target system according to the business operation indicator and the allocated system resources, wherein the resource usage indicator represents the degree of use of the allocated system resources by the target system;
[0112] A shrinking module 605 is configured to send a shrinking instruction to the system resource pool if the resource usage indicator is less than a preset indicator lower limit, so that the system resource pool releases the resources of the target system according to the shrinking instruction;
[0113] The capacity expansion module 606 is used to send a capacity expansion instruction to the system resource pool if the resource usage indicator is greater than a preset indicator upper limit value, so that the system resource pool increases resource allocation for the target system according to the capacity expansion instruction, and the indicator upper limit value is greater than the indicator lower limit value.
[0114] like Figure 8 As shown, further, the business operation indicator includes each first parameter value corresponding to each business indicator in the business indicator rule, the allocated system resources include each second parameter value allocated to each performance in the target system, and the resource usage calculation module 604 may include:
[0115] The system weight calculation unit 6041 is used to calculate the weight of the target system in the system resource pool under each of the first parameter values and the second parameter values.
[0116] An entropy value calculation unit 6042 is used to calculate the entropy value of each parameter value according to the proportion corresponding to each parameter value by using an entropy method;
[0117] An entropy redundancy calculation unit 6043, configured to calculate the entropy redundancy of each parameter value according to the entropy value of each parameter value using an entropy method;
[0118] A weight calculation unit 6044 is used to calculate the weight of each parameter value according to the entropy redundancy of each parameter value;
[0119] The score value calculation unit 6045 is used to calculate the resource usage score value of the target system according to each parameter value and the weight of each parameter value after calculating the weight of each parameter value, as the resource usage indicator of the target system.
[0120] Furthermore, if Fig. 9 As shown, the lower limit value of the indicator and the upper limit value of the indicator can be preset by the following modules:
[0121] The historical usage acquisition module 607 is used to acquire various historical resource usage indicators of the target system in a recent time period, where the recent time period refers to a time period of a preset time length closest to the current system time;
[0122] The indicator mean calculation module 608 is used to calculate the mean of each of the historical resource usage indicators to obtain the indicator mean;
[0123] The indicator upper limit value calculation module 609 is used to calculate the indicator upper limit value according to a preset floating ratio and the indicator mean value;
[0124] The indicator lower limit value calculation module 610 is used to calculate the indicator lower limit value according to a preset downward floating ratio and the indicator mean value.
[0125] Furthermore, the shrinking instruction may be generated by the following modules:
[0126] A first indicator median determination module, configured to determine an indicator median according to the indicator lower limit value and the indicator upper limit value, wherein the indicator median value is a median value of an indicator interval determined jointly by the indicator lower limit value and the indicator upper limit value;
[0127] A first difference calculation module, used to calculate the difference between the median of the indicator and the resource usage indicator to obtain a first difference;
[0128] A first ratio calculation module, used for calculating the ratio of the first difference to the median of the index to obtain a first ratio;
[0129] A resource amount calculation module to be released, used for calculating the product of the allocated system resources and the first ratio to obtain the resource amount to be released;
[0130] The shrinking instruction generation module is used to generate an instruction requiring the system resource pool to release the amount of resources to be released for the target system, so as to obtain a shrinking instruction.
[0131] Furthermore, the capacity expansion instruction may be generated by the following steps:
[0132] A second indicator median determination module, used to determine an indicator median according to the indicator lower limit value and the indicator upper limit value, wherein the indicator median is the median of the indicator interval determined by the indicator lower limit value and the indicator upper limit value;
[0133] A second difference calculation module, used to calculate the difference between the resource usage indicator and the median of the indicator to obtain a second difference;
[0134] A second ratio calculation module, used for calculating the ratio of the second difference to the median of the index to obtain a second ratio;
[0135] A resource amount calculation module required for additional allocation is used to calculate the product of the allocated system resources and the second ratio to obtain the resource amount required for additional allocation;
[0136] The capacity expansion instruction generation module is used to generate an instruction requiring the system resource pool to increase the amount of resources required to be allocated to the target system, thereby obtaining a capacity expansion instruction.
[0137] For the specific definition of the system resource dynamic expansion and contraction device, please refer to the definition of the system resource dynamic expansion and contraction method above, which will not be repeated here. Each module in the above-mentioned system resource dynamic expansion and contraction device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0138] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data involved in the method for dynamic expansion and contraction of system resources. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for dynamic expansion and contraction of system resources is implemented.
[0139] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for dynamically scaling system resources in the above embodiment are implemented, for example: Figure 2Alternatively, when the processor executes the computer program, the functions of each module / unit of the system resource dynamic expansion and contraction device in the above embodiment are realized, for example Figure 7 The functions of modules 601 to 606 are shown in Figure 6. To avoid repetition, they are not described here.
[0140] In one embodiment, a computer-readable storage medium is provided on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for dynamically scaling system resources in the above embodiment are implemented, for example: Figure 2 Alternatively, when the computer program is executed by the processor, the functions of each module / unit of the system resource dynamic expansion and contraction device in the above embodiment are realized, for example Figure 7 The functions of modules 601 to 606 are shown in Figure 6. To avoid repetition, they are not described here.
[0141] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0142] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0143] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for dynamically expanding and contracting system resources, characterized in that: include: Capture the system log of the target system in real time, and obtain the current business data of the target system from the system log; Acquire the allocated system resources that have been allocated to the target system from the system resource pool; Analyze the current business data according to preset business indicator rules to obtain the current business operation indicator of the target system, wherein the business operation indicator represents the operation status of the current business data on the target system; Calculating a resource usage indicator of the target system according to the business operation indicator and the allocated system resources, wherein the resource usage indicator represents the degree of use of the allocated system resources by the target system; If the resource usage indicator is less than a preset indicator lower limit, sending a shrinking instruction to the system resource pool, the shrinking instruction enables the system resource pool to release resources of the target system; If the resource usage indicator is greater than a preset indicator upper limit, sending an expansion instruction to the system resource pool, the expansion instruction causes the system resource pool to increase resource allocation for the target system, and the indicator upper limit is greater than the indicator lower limit; The shrinking instruction is generated by the following steps: Determine an indicator median value according to the indicator lower limit value and the indicator upper limit value, wherein the indicator median value is the median value of the indicator interval determined by the indicator lower limit value and the indicator upper limit value; Calculate the difference between the median value of the indicator and the resource usage indicator to obtain a first difference value; Calculating the ratio of the first difference to the median of the indicator to obtain a first ratio; Calculating the product of the allocated system resources and the first ratio to obtain the amount of resources to be released; Generate an instruction requiring the system resource pool to release the amount of resources to be released for the target system, and obtain a capacity reduction instruction; The expansion instruction is generated by the following steps: Determine an indicator median value according to the indicator lower limit value and the indicator upper limit value, wherein the indicator median value is the median value of the indicator interval determined by the indicator lower limit value and the indicator upper limit value; Calculating the difference between the resource usage indicator and the median of the indicator to obtain a second difference; Calculating the ratio of the second difference to the median of the indicator to obtain a second ratio; Calculating the product of the allocated system resources and the second ratio to obtain the amount of resources that need to be additionally allocated; Generate an instruction requiring the system resource pool to increase the allocation of the required additional resources to the target system, and obtain a capacity expansion instruction; The lower limit value of the indicator and the upper limit value of the indicator are preset by the following steps: Obtaining various historical resource usage indicators of the target system in a recent time period, where the recent time period refers to a time period of a preset time length closest to the current system time; Calculate the average of each of the historical resource usage indicators to obtain an indicator average; The upper limit value of the indicator is calculated according to the preset floating ratio and the average value of the indicator; The lower limit value of the indicator is calculated based on the preset downward floating ratio and the indicator mean.
2. The method for dynamically expanding and contracting system resources according to claim 1, characterized in that: The business operation indicator includes each first parameter value corresponding to each business indicator in the business indicator rule, the allocated system resources include each second parameter value allocated to each performance in the target system, and the resource usage indicator of the target system calculated according to the business operation indicator and the allocated system resources includes: For each of the first parameter values and the second parameter values, calculate the proportion of the target system in the system resource pool under each parameter value; Calculate the entropy value of each parameter value according to the proportion corresponding to each parameter value using an entropy method; Calculating the entropy redundancy of each parameter value according to the entropy value of each parameter value using an entropy method; Calculate the weight of each parameter value according to the entropy redundancy of each parameter value; After the weight of each parameter value is calculated, a resource usage score value of the target system is calculated according to each parameter value and the weight of each parameter value as a resource usage indicator of the target system.
3. A system resource dynamic expansion and contraction device, characterized in that: include: A system log capture module is used to capture the system log of the target system in real time and obtain the current business data of the target system from the system log; An allocated resource acquisition module, used for acquiring allocated system resources that have been allocated to the target system by a system resource pool; A business data analysis module, used to analyze the current business data according to preset business indicator rules to obtain the current business operation indicator of the target system, wherein the business operation indicator represents the operation status of the current business data on the target system; A resource usage calculation module, used to calculate a resource usage indicator of the target system according to the business operation indicator and the allocated system resources, wherein the resource usage indicator represents the degree of use of the allocated system resources by the target system; A capacity reduction module, configured to send a capacity reduction instruction to the system resource pool if the resource usage indicator is less than a preset indicator lower limit, wherein the capacity reduction instruction causes the system resource pool to release resources of the target system; An expansion module, configured to send an expansion instruction to the system resource pool if the resource usage indicator is greater than a preset indicator upper limit value, wherein the expansion instruction causes the system resource pool to increase resource allocation for the target system, and the indicator upper limit value is greater than the indicator lower limit value; The shrinking instruction can be generated by the following modules: A first indicator median determination module, configured to determine an indicator median according to the indicator lower limit value and the indicator upper limit value, wherein the indicator median value is a median value of an indicator interval determined jointly by the indicator lower limit value and the indicator upper limit value; A first difference calculation module, used to calculate the difference between the median of the indicator and the resource usage indicator to obtain a first difference; A first ratio calculation module, used for calculating the ratio of the first difference to the median of the index to obtain a first ratio; A resource amount calculation module to be released, used for calculating the product of the allocated system resources and the first ratio to obtain the resource amount to be released; A shrinking instruction generating module, used to generate an instruction requiring the system resource pool to release the amount of resources to be released for the target system, so as to obtain a shrinking instruction; The expansion instruction can be generated by the following modules: A second indicator median determination module, used to determine an indicator median according to the indicator lower limit value and the indicator upper limit value, wherein the indicator median is the median of the indicator interval determined by the indicator lower limit value and the indicator upper limit value; A second difference calculation module, used to calculate the difference between the resource usage indicator and the median of the indicator to obtain a second difference; A second ratio calculation module, used for calculating the ratio of the second difference to the median of the index to obtain a second ratio; A module for calculating the amount of resources to be added, used for calculating the product of the allocated system resources and the second ratio to obtain the amount of resources to be added; A capacity expansion instruction generation module is used to generate an instruction requiring the system resource pool to increase the amount of resources to be allocated to the target system, thereby obtaining a capacity expansion instruction; The lower limit value of the indicator and the upper limit value of the indicator are preset by the following modules: A historical usage acquisition module, used to acquire various historical resource usage indicators of the target system in a recent time period, wherein the recent time period refers to a time period of a preset time length closest to the current system time; An indicator mean calculation module is used to calculate the mean of each of the historical resource usage indicators to obtain the indicator mean; An indicator upper limit value calculation module, used to calculate the indicator upper limit value according to a preset floating ratio and the indicator mean value; The indicator lower limit value calculation module is used to calculate the indicator lower limit value according to a preset downward floating ratio and the indicator mean value.
4. The system resource dynamic expansion and contraction device according to claim 3, characterized in that: The business operation indicator includes each first parameter value corresponding to each business indicator in the business indicator rule, the allocated system resources include each second parameter value allocated to each performance in the target system, and the resource usage calculation module includes: A system weight calculation unit, configured to calculate, for each of the first parameter values and the second parameter values, a weight of the target system in the system resource pool under each parameter value; An entropy value calculation unit, configured to calculate the entropy value of each parameter value according to the proportion corresponding to each parameter value by using an entropy method; An entropy redundancy calculation unit, configured to calculate the entropy redundancy of each parameter value according to the entropy value of each parameter value using an entropy method; A weight calculation unit, used for calculating the weight of each parameter value according to the entropy redundancy of each parameter value; The score value calculation unit is used to calculate the resource usage score value of the target system according to each parameter value and the weight of each parameter value after calculating the weight of each parameter value, as the resource usage indicator of the target system.
5. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for dynamically expanding and contracting system resources as described in any one of claims 1 to 2 are implemented.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for dynamically expanding and contracting system resources as described in any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
Self-adaptation load balancing job task scheduling method and device
CN103986766A
System and method for intelligently and flexibly scheduling data center resources
CN105577457A
Method and system for elastically scheduling resources
CN107733676A
