A method for optimizing workload of a computing device and related devices
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN YUNWANG WULIAN TECH CO LTD
- Filing Date
- 2023-03-16
- Publication Date
- 2026-08-07
AI Technical Summary
计算设备的处理速度和工作量之间并非简单的线性关系,还有阶梯突变的特性:例如某台计算设备,在特定范围的工作量之下,处理速度和工作量之间会有特定的线性关系,处理速度总是优秀的,但是工作量再往上升超出特定范围,处理速度就会突降,并且之后会呈现不同的线性/非线性关系
[0065]本申请中,淘汰不值得进行优化的计算设备,筛选值得进行优化的计算设备并确定为目标计算设备,使得对计算设备的工作量优化更有针对性,避免在难以优化或无法优化的计算设备上浪费运算资源。在对目标计算设备进行工作量优化时,考虑了工作量和处理速度之间的变化关系,并根据变化关系的目标突变位置为目标计算设备确定目标工作量。在目标突变位置前目标计算设备处理速度随工作量的增加而减小的幅度,相比在目标突变位置后目标计算设备处理速度随工作量的增加而减小的幅度,差异最显著,即在目标突变位置目标计算设备处理速度随工作量的增加而减小的幅度陡增。所以,在目标突变位置如果继续增大工作量,则处理速度将迅速损失。本申请根据目标突变位置确定目标工作量,使得目标计算设备能够同时兼顾工作量和处理速度,即在工作量尽量多的情况下,处理速度尽量高,或者说,在工作量尽量多的情况下,处理速度减慢得尽量少,对计算设备的工作量分配更加合理。
Smart Images

Figure CN116227726B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, specifically to a method for optimizing the workload of computing devices and related equipment. Background Technology
[0002] Currently, PCDN services utilize various types of computing devices from different regions. Due to differences in service clients and their own characteristics, these devices exhibit vastly different processing speeds under varying workloads. The relationship between processing speed and workload is not a simple linear one; it also exhibits a step-like abrupt change. For example, a particular computing device may show a specific linear relationship between processing speed and workload within a certain range, consistently achieving excellent processing speed. However, as the workload increases beyond a certain range, the processing speed will suddenly drop, and subsequently, it will display different linear / non-linear relationships.
[0003] The current common method of workload allocation is to allocate workload based on the level of computing equipment, which results in an unreasonable allocation of workload for computing equipment. Summary of the Invention
[0004] This application provides a method and related equipment for optimizing the workload of computing devices, which is used to optimize the workload and processing speed of computing devices.
[0005] The first aspect of this application provides a method for optimizing the workload of a computing device, including:
[0006] Obtain the relationship between the processing speed and workload of the target computing device within a preset time period. The target computing device is selected from at least one candidate computing device.
[0007] Based on at least one target mutation location in the change relationship, determine the target workload of the target device. The target mutation location is the location where the difference in the magnitude of the change in the processing speed of the target computing device with the workload is most significant.
[0008] Based on the first aspect of the embodiments of this application, in a first implementation of the first aspect of the embodiments of this application, determining the target workload of the target device according to at least one target mutation position in the change relationship specifically includes:
[0009] Based on the target mutation location of the change relationship, the segmentation point is determined, and the preset duration is divided into multiple segmentation intervals;
[0010] If among multiple segmented intervals there exists a target segmented interval whose workload and processing speed meet the first preset conditions, then the target workload is determined in the target segmented interval.
[0011] Based on the first aspect or the first implementation of the embodiments of this application, in the second implementation of the first aspect of the embodiments of this application, determining the segmentation point according to the target mutation position of the change relationship specifically includes:
[0012] The preset duration is divided into multiple windows, and the processing speed and workload are fitted within each window to obtain multiple window loss functions.
[0013] Calculate the window residuals of processing speed and workload relative to the window loss function within each window, and determine the target mutation location and the segmentation point based on the difference between the window residuals.
[0014] Based on any one of the first aspect, the first implementation, and the second implementation of the embodiments of this application, in the third implementation of the first aspect of this application, the preset time is divided into multiple windows, and the processing speed and workload are fitted within each window to obtain multiple window loss functions, specifically including:
[0015] Determine the window width, and divide the preset duration into multiple first windows based on the window width;
[0016] Merge two adjacent first windows into one second window;
[0017] The processing speed and workload are fitted within each first window to obtain multiple single-window loss functions;
[0018] The processing speed and workload are fitted within each second window to obtain multiple double-window loss functions;
[0019] Calculate the windowing residuals of processing speed and workload relative to the windowing loss function within each window. Based on the differences between the windowing residuals, determine the target abrupt change location and the cutoff point. Specifically, this includes:
[0020] Calculate the single-window residuals of processing speed and workload relative to the single-window loss function within each first window;
[0021] Calculate the average single-window residual of two adjacent first windows to obtain the average single-window residual;
[0022] Calculate the double-window residuals of processing speed and workload relative to the double-window loss function within each second window;
[0023] Calculate the difference between the double-window residuals corresponding to two adjacent first windows and the average single-window residual to obtain the residual difference;
[0024] The intersection points of several groups of adjacent first windows with the largest absolute value of residual difference are determined as the target mutation locations and the segmentation points.
[0025] Based on the first aspect of the embodiments of this application, and any one of the first to third implementations of the first aspect, in the fourth implementation of the first aspect of the embodiments of this application, determining the window width specifically includes:
[0026] The window width is set to 2*N^(1 / 2), where N is the preset duration.
[0027] Based on the first aspect of the embodiments of this application, and any one of the first to fourth implementations of the first aspect, in the fifth implementation of the first aspect of the embodiments of this application, the windowing loss function is a linear loss function.
[0028] Based on the first aspect of the embodiments of this application, and any one of the first to fifth implementations of the first aspect, in the sixth implementation of the first aspect of the embodiments of this application, if there exists a target segmentation interval among multiple segmentation intervals whose workload and processing speed satisfy the first preset condition, then the target workload is determined in the target segmentation interval, specifically including:
[0029] If among multiple segmentation intervals, there exists a target segmentation interval where the first correlation between workload and processing speed is the greatest and greater than the first correlation threshold, then the target workload is determined within the target segmentation interval.
[0030] Based on the first aspect of the embodiments of this application, and any one of the first to sixth implementations of the first aspect, in the seventh implementation of the first aspect of the embodiments of this application, before determining the target workload in the target segmentation interval, the method further includes:
[0031] Linear fitting is performed on the workload and processing speed within the segmentation interval with the highest first correlation to obtain the fitting coefficients;
[0032] If a target segmentation interval exists among multiple segmentation intervals, and the workload and processing speed meet the first preset condition, then the target workload is determined within the target segmentation interval, specifically including:
[0033] If among multiple segmentation intervals, there exists a target segmentation interval where the first correlation between workload and processing speed is the greatest and greater than the first correlation threshold, and the fitting coefficient is greater than or equal to the fitting coefficient threshold, then the target workload is determined within the target segmentation interval.
[0034] Based on any one of the first to seventh implementations of the embodiments of this application, in the eighth implementation of the first aspect of the embodiments of this application, the first correlation is the Pearson correlation.
[0035] Based on the first aspect of the embodiments of this application, and any one of the first to eighth implementations of the first aspect, in the ninth implementation of the first aspect of the embodiments of this application, determining the target workload in the target segmentation interval specifically includes:
[0036] Determine whether the minimum workload of the target segmentation interval is less than or equal to the minimum workload threshold;
[0037] If the minimum workload of the target segmentation interval is less than or equal to the minimum workload threshold, the maximum workload of the target segmentation interval is determined as the target workload.
[0038] If the minimum workload of the target segmentation interval is greater than the minimum workload threshold, the minimum workload of the target segmentation interval is determined as the target workload.
[0039] Based on any one of the first to ninth implementations of the embodiments of this application, in the tenth implementation of the first aspect of the embodiments of this application, after determining the target workload of the target device according to at least one target mutation position in the change relationship, the method further includes:
[0040] Send the target workload to the target computing device so that the target computing device can complete the target workload.
[0041] Based on any one of the first to tenth implementations of the embodiments of this application, in the eleventh implementation of the first aspect of the embodiments of this application, before obtaining the relationship between the processing speed and workload of the target computing device within a preset time period, the method further includes:
[0042] The second correlation between the workload and processing speed of the computing device within a preset time period;
[0043] Determine whether the second correlation between the workload and processing speed of the computing device within a preset time period is greater than the second correlation threshold;
[0044] If the value is greater than the second relevance threshold, then the computing device is determined to be the target computing device.
[0045] Based on the first aspect of the embodiments of this application, and any one of the first to eleventh implementations of the first aspect, in the twelfth implementation of the first aspect of the embodiments of this application, the second correlation between the workload and processing speed of the computing device within a preset time period specifically includes:
[0046] The preset duration is divided into multiple bins, and the workload index of each bin and the processing speed index of each bin are calculated.
[0047] Based on the workload and processing speed indicators of each sub-bin, the second correlation between workload and processing speed is calculated.
[0048] Based on the first aspect of the embodiments of this application, and any one of the first to twelfth implementations of the first aspect, in the thirteenth implementation of the first aspect of the embodiments of this application, the preset duration is divided into multiple sub-boxes, specifically including:
[0049] Calculate the coefficient of variation of workload within the preset time period;
[0050] If the coefficient of variation is greater than or equal to the coefficient of variation threshold, then equal-frequency binning is used to divide the preset duration into multiple bins;
[0051] If the coefficient of variation is less than the coefficient of variation threshold, then equal-width binning is used to divide the preset duration into multiple bins.
[0052] Based on any one of the first to thirteenth implementations of the first aspect of the present application, in the fourteenth implementation of the first aspect of the present application, the second correlation is Spearman rank ratio correlation.
[0053] Based on any one of the first to fourteenth implementations of the embodiments of this application, in the fifteenth implementation of the first aspect of this application, before obtaining the relationship between the processing speed and workload of the target computing device within a preset time period, the method further includes:
[0054] Determine whether the work record indicators of the computing device meet the second preset condition within a preset time period. The work record indicators are used to represent the amount of data that the computing device has recorded while working normally.
[0055] If the work record indicators meet the second preset condition, then the computing device is determined to be the target computing device.
[0056] Based on the first aspect of the embodiments of this application, and any one of the first to fifteenth implementations of the first aspect, in the sixteenth implementation of the first aspect of the embodiments of this application, determining whether the working record indicators of the computing device within a preset time period meet the second preset condition specifically includes:
[0057] Determine whether the first record quantity of the computing device's workload and processing speed within a preset time period is greater than the first record quantity threshold;
[0058] If the first record count is greater than the first record count threshold, then the computing device is determined to meet the second preset condition; or / and
[0059] Determine whether the number of times the workload of the computing device is zeroed within a preset time period is less than the zeroing threshold;
[0060] If the number of zeroing cycles is less than the zeroing threshold, then the computing device is determined to meet the second preset condition; or / and
[0061] Determine multiple workload intervals and statistically calculate the second record of the workload and processing speed of the equipment in each workload interval within a preset time period;
[0062] Determine whether the second record quantity in each workload interval is greater than the second record quantity threshold;
[0063] If the second record quantity in each workload interval is greater than the second record quantity threshold, then the computing device is determined to meet the second preset condition.
[0064] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0065] In this application, computing devices that are not worth optimizing are eliminated, while those worth optimizing are selected and identified as target computing devices. This makes workload optimization of computing devices more targeted, avoiding wasting computing resources on devices that are difficult or impossible to optimize. When optimizing the workload of target computing devices, the relationship between workload and processing speed is considered, and the target workload is determined based on the target abrupt change in this relationship. The decrease in processing speed with increasing workload before the target abrupt change is most significant compared to the decrease after the target abrupt change; that is, the decrease in processing speed with increasing workload increases sharply at the target abrupt change. Therefore, if the workload continues to increase at the target abrupt change, the processing speed will rapidly decrease. This application determines the target workload based on the target abrupt change, enabling the target computing device to simultaneously balance workload and processing speed—that is, maximizing processing speed while maximizing workload, or minimizing the slowdown in processing speed while maximizing workload—resulting in a more rational allocation of workload to the computing device.
[0066] A second aspect of this application provides a computing device workload optimization apparatus, comprising:
[0067] The acquisition unit is used to acquire the relationship between the processing speed and workload of the target computing device within a preset time period. The target computing device is selected from at least one candidate computing device.
[0068] The determination unit is used to determine the target workload of the target device based on at least one target mutation position in the change relationship. The target mutation position is the position where the difference in the magnitude of the change in the processing speed of the target computing device with the workload is most significant, and the processing speed of the target device is optimal when it completes the target workload.
[0069] A third aspect of this application provides a computer device, including:
[0070] Central processing unit, memory, input / output interfaces, wired or wireless network interfaces, and power supply;
[0071] The memory can be either temporary or permanent storage.
[0072] The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method of the first aspect.
[0073] A fourth aspect of this application provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the method of the first aspect.
[0074] A fifth aspect of this application provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the method of the first aspect.
[0075] A sixth aspect of this application provides a chip system including at least one processor and a communication interface, the communication interface and the at least one processor being interconnected via a line, the at least one processor being used to run a computer program or instructions to perform the method of the first aspect. Attached Figure Description
[0076] Figures 1 to 12 These are various flowcharts illustrating the computational device workload optimization method according to embodiments of this application;
[0077] Figure 13 These are experimental effect diagrams of embodiments of this application;
[0078] Figure 14 This is a structural diagram of the computer in an embodiment of this application. Detailed Implementation
[0079] like Figure 1 As shown in the figure, this application provides a method for optimizing the workload of a computing device, including:
[0080] 101. Obtain the relationship between the processing speed and workload of the target computing device within a preset time period. The target computing device is selected from at least one alternative computing device.
[0081] In PCDN services, for a single computing device, the overall trend is that the larger the workload assigned, the slower the processing speed; conversely, the smaller the workload assigned, the faster the processing speed. There is a negative correlation between processing speed and workload; the processing speed decreases as the workload increases, or increases as the workload decreases. To quantify this relationship, data on the target computing device's processing speed and workload within a preset timeframe is needed. The preset timeframe can be one day, one week, one hour, five hours, etc. It can be continuous or segmented. Workload and processing speed data can be at the minute level, or at the second or hour level; there are no specific limitations.
[0082] Because each computing device has different performance and statistical data, there may be computing devices that are not suitable or cannot be used for workload optimization. Therefore, it is necessary to select target computing devices that are suitable or can be used for workload optimization from the candidate computing devices.
[0083] Workload can also be referred to as volume, and processing speed can be simply called speed. Processing speed can also be referred to as quality, because in PCDN services, service quality is evaluated based on processing speed; the faster the processing speed, the higher the service quality, and the slower the processing speed, the lower the service quality.
[0084] PCDN can also be written as P2P CDN, which stands for P2P Content Delivery Network. It is a low-cost, high-quality content delivery network service built on P2P technology by leveraging the massive fragmented and idle resources of edge networks. P2P is short for Peer to Peer, meaning peer-to-peer network.
[0085] 102. Based on at least one target mutation location in the change relationship, determine the target workload of the target device. The target mutation location is the location where the difference in the magnitude of the change in the processing speed of the target computing device with the workload is most significant.
[0086] The magnitude of the change in processing speed with workload differs before and after the mutation point; that is, the change relationship has different magnitudes before and after the mutation point. The magnitude of the change relationship refers to the drastic change in processing speed with workload, which can be expressed using slope, derivative, etc. For example, the change relationship is linear before the mutation point and non-linear after; the change relationship is non-linear before the mutation point and linear after; the change relationship is linear before the mutation point with a first-order coefficient of -1, and linear after the mutation point with a first-order coefficient of -2. The mutation point can be a mutation point or a mutation interval; there is no specific limitation.
[0087] The difference in processing speed as a function of workload refers to the difference in the drastic degree to which processing speed changes with workload. At the target mutation location, the difference in the magnitude of the change in processing speed with workload on the target computing device reaches its maximum. The difference in the magnitude of the change in processing speed with workload on the target computing device is greatest compared to before and after the target mutation location. It should be noted that the terms "maximum difference" and "most significant difference" here are selected or compared from various known or calculated mutation locations.
[0088] When there is only one target mutation location, the target mutation location is the location with the greatest difference in the magnitude of change; when there are multiple target mutation locations, the target mutation locations are the multiple locations with the greatest difference in the magnitude of change.
[0089] After determining the target mutation location, various methods can be used to determine the target workload of the target device. For example, if there is only one target mutation location, the workload of the target mutation location is determined as the target workload; if there are multiple target mutation locations, the average workload of the target mutation locations is determined as the target workload; if there are multiple target mutation locations, the workload of one target mutation location is randomly selected and determined as the target workload; if there are multiple target mutation locations, the workload of one target mutation location is selected through specific steps and determined as the target workload. The methods for determining the target workload are flexible and diverse, and no specific limitation is imposed.
[0090] In this application, computing devices that are not worth optimizing are eliminated, while those worth optimizing are selected and identified as target computing devices. This makes workload optimization of computing devices more targeted, avoiding wasting computing resources on devices that are difficult or impossible to optimize. When optimizing the workload of target computing devices, the relationship between workload and processing speed is considered, and the target workload is determined based on the target abrupt change in this relationship. The decrease in processing speed with increasing workload before the target abrupt change is most significant compared to the decrease after the target abrupt change; that is, the decrease in processing speed with increasing workload increases sharply at the target abrupt change. Therefore, if the workload continues to increase at the target abrupt change, the processing speed will rapidly decrease. This application determines the target workload based on the target abrupt change, enabling the target computing device to simultaneously balance workload and processing speed—that is, maximizing processing speed while maximizing workload, or minimizing the slowdown in processing speed while maximizing workload—resulting in a more rational allocation of workload to the computing device.
[0091] like Figure 2As shown, in one implementation of this application embodiment, determining the target workload of the target device based on at least one target mutation position in the change relationship specifically includes:
[0092] 201. Determine the segmentation point based on the target mutation location of the change relationship, and divide the preset duration into multiple segmentation intervals;
[0093] After determining the target mutation location, if the target mutation location is a target mutation point, the time corresponding to the target mutation point is used as the dividing point; if the target mutation location is a target mutation interval, the dividing point is selected from the time period corresponding to the target mutation interval. Using the dividing points, the preset duration is divided into multiple intervals.
[0094] 202. If there is a target segmentation interval among multiple segmentation intervals, and the workload and processing speed meet the first preset conditions, then the target workload is determined in the target segmentation interval.
[0095] Determine if a target segment exists among all the segmented intervals, satisfying the first preset condition regarding workload and processing speed. If a target segment exists, determine the target workload from that segment. The method for determining the target workload from the target segment is flexible and varied; for example, the minimum, maximum, average, or median workload of the target segment can be selected as the target workload, without any specific limitation.
[0096] Optionally, if no target segmentation interval exists, the target computing device is discarded and no workload optimization is performed on it.
[0097] like Figure 3 As shown, in one implementation of this application embodiment, determining the segmentation point based on the target mutation position of the change relationship specifically includes:
[0098] 301. Divide the preset duration into multiple windows, fit the processing speed and workload within each window, and obtain multiple window loss functions;
[0099] After dividing the preset duration into multiple windows, a window loss function that combines processing speed and workload is fitted to each window, resulting in multiple window loss functions.
[0100] Optionally, all windowed loss functions are linear loss functions. Using linear loss functions is simpler to calculate, saves computational resources, and improves scalability. The windowed loss function can also be a non-linear loss function; there is no specific limitation. Both single-window and double-windowed loss functions are linear loss functions.
[0101] Optionally, the residuals after linear fitting are used, hence the name linear loss function, as shown in the formula:
[0102]
[0103] A linear loss function can be used to establish a linear relationship between workload and processing speed within a window and to obtain the residuals.
[0104] Optionally, the window should satisfy the following formula:
[0105] d(y a..t y t..b )=c(y a..b )-c(y t..t )-c(y t..b (1≤a<t<b≤T).°
[0106] The pseudocode for the window swiping operation is as follows:
[0107]
[0108] 302. Calculate the window residuals of processing speed and workload relative to the window loss function within each window. Based on the differences between the window residuals, determine the target mutation location and the segmentation point.
[0109] After obtaining the windowing loss function for each window, calculate the windowing residuals of processing speed and workload within each window on the windowing loss function. Calculate the difference between the windowing residuals of a specific window, which can be an adjacent window or an intersecting window. The magnitude of the difference between the windowing residuals characterizes the magnitude of the difference in processing speed of the target computing device with varying workload. A larger difference indicates a larger magnitude of difference in processing speed with varying workload; a smaller difference indicates a smaller magnitude of difference. Based on the magnitude of the difference between the windowing residuals, select the target abrupt change location and determine the cutoff point based on the target abrupt change location.
[0110] like Figure 4 As shown, in one implementation of this application embodiment, a preset time period is divided into multiple windows. Within each window, processing speed and workload are fitted to obtain multiple window loss functions. The window residuals of processing speed and workload relative to the window loss functions within each window are calculated. Based on the differences between the window residuals, the target mutation location and the segmentation point are determined. Specifically, this includes:
[0111] 401. Determine the window width, and divide the preset duration into multiple first windows according to the window width;
[0112] After determining the window width, the preset duration is divided into multiple first windows using the windowing method.
[0113] A narrow window width makes the window susceptible to extreme values, while a wide window width reduces sensitivity. Therefore, a suitable window width needs to be selected. Optionally, the window width can be set to 2*N^(1 / 2), where N is the preset duration. Other values for the window width are also possible and are not limited.
[0114] 402. Merge two adjacent first panes into one second pane;
[0115] Each pair of adjacent first windows is merged into a single second window. For example, if the preset duration is divided into 5 first windows: window a, window b, window c, window d, and window e, then first windows a and b are merged into second window A, b and c into second window B, c and d into second window C, and d and e into second window D. This results in 4 second windows: second window A, second window B, second window C, and second window D. The number of first windows can be greater than 2, and the specific number is not limited.
[0116] 403. Fit the processing speed and workload within each first window to obtain multiple single-window loss functions;
[0117] After dividing the preset duration into multiple first windows, a single-window loss function that combines processing speed and workload is fitted to each first window, resulting in multiple single-window loss functions.
[0118] 404. Fit the processing speed and workload within each second window to obtain multiple double-window loss functions;
[0119] After dividing the preset duration into multiple second windows, a double-window loss function that combines processing speed and workload is fitted to each second window, resulting in multiple double-window loss functions.
[0120] It should be noted that steps 403 and 404 are not related in terms of timing. In addition to being executed in the above order, the execution order can be reversed or they can be executed synchronously. There are no specific restrictions on the timing.
[0121] 405. Calculate the single-window residuals of processing speed and workload relative to the single-window loss function within each first window;
[0122] After obtaining the single-window loss function for each first window, calculate the single-window residuals of processing speed and workload within each first window on the single-window loss function.
[0123] 406. Calculate the average value of the single-slide window residuals of two adjacent first-slide windows to obtain the average single-slide window residual;
[0124] The average single-window residual is obtained by averaging the single-window residuals of two adjacent first windows. For example, the preset duration is divided into 5 first windows, namely first window a, first window b, first window c, first window d, and first window e. The average single-window residual of first window a and first window b is calculated. The average single-window residual of first window a and first window b is calculated. The average single-window residual of first window b and first window c is calculated. The average single-window residual of first window c and first window d is calculated. The average single-window residual of first window d and first window e is calculated. Five first-slit windows were used to calculate four average single-slit window residuals.
[0125] 407. Calculate the double-window residuals of processing speed and workload relative to the double-window loss function within each second window;
[0126] After obtaining the double-window loss function for each second window, calculate the double-window residuals of processing speed and workload within each second window on the double-window loss function.
[0127] It should be noted that steps 405 and 407 are not related in terms of timing. In addition to being executed in the above order, the execution order can be reversed or they can be executed synchronously. There are no specific restrictions on the timing.
[0128] 408. Calculate the difference between the double-window residuals corresponding to two adjacent first-scan windows and the average single-window residuals to obtain the residual difference value;
[0129] The residual difference is obtained by subtracting the average single-window residual of the two adjacent first windows from the double-window residual of the second window; or by subtracting the double-window residual of the corresponding second window from the average single-window residual of the two adjacent first windows. For example, subtract the average single-window residual of first windows a and b from the double-window residual of second window A; subtract the average single-window residual of first windows b and c from the double-window residual of second window B; subtract the average single-window residual of first windows c and d from the double-window residual of second window C; and subtract the average single-window residual of first windows d and e from the double-window residual of second window D. Five first windows and four second windows result in four residual differences.
[0130] 409. Determine the intersection points of two adjacent first windows with the largest absolute value of residual difference as the target mutation locations and determine the split points.
[0131] The absolute value of the residual difference can be taken, and the residual differences can be sorted from largest to smallest. A preset number of residual differences or those greater than a threshold can be selected. The intersection points of several groups of adjacent first windows corresponding to the selected residual differences are determined as the target mutation locations, and these intersection points are also determined as the split points.
[0132] In one implementation of this application, if a target segmentation interval exists among multiple segmentation intervals, and the workload and processing speed satisfy a first preset condition, then a target workload is determined within the target segmentation interval, specifically including:
[0133] If among multiple segmentation intervals, there exists a target segmentation interval where the first correlation between workload and processing speed is the greatest and greater than the first correlation threshold, then the target workload is determined within the target segmentation interval.
[0134] Calculate the first correlation between workload and processing speed in each segmentation interval. The first preset condition for selecting the target segmentation interval is: the first correlation of the target segmentation interval is the highest among the segmentation intervals, and the first correlation of the target segmentation interval is greater than the first correlation threshold. The target segmentation interval that meets the first preset condition, with the highest first correlation and greater than the first correlation threshold, is the most suitable segmentation interval for workload optimization. The first preset condition can also be other, to filter the most suitable segmentation interval for workload optimization, and is not specifically limited.
[0135] Optionally, the first correlation is a Pearson correlation. Alternatively, the first correlation can also be a correlation calculated using other methods, without any specific limitation.
[0136] The formula for the Pearson correlation coefficient is as follows:
[0137]
[0138] In one implementation of this application, before determining the target workload in the target segmentation interval, the method further includes:
[0139] Linear fitting is performed on the workload and processing speed within the segmentation interval with the highest first correlation to obtain the fitting coefficients;
[0140] After determining the segmentation interval with the highest correlation, linearly fit the workload and processing speed within that interval to obtain the fitting coefficient. Alternatively, linearly fit the workload and processing speed across all segmentation intervals to obtain the fitting coefficient for each interval.
[0141] Optionally, the fit coefficient is adj R-Square (Adjusted R-Square, adjusted R-squared). 2The fitting coefficient is used to describe the degree of fit, but it can also be other values; there are no specific limitations.
[0142] If a target segmentation interval exists among multiple segmentation intervals, and the workload and processing speed meet the first preset condition, then the target workload is determined within the target segmentation interval, specifically including:
[0143] If among multiple segmentation intervals, there exists a target segmentation interval where the first correlation between workload and processing speed is the greatest and greater than the first correlation threshold, and the fitting coefficient is greater than or equal to the fitting coefficient threshold, then the target workload is determined within the target segmentation interval.
[0144] After calculating the first correlation and the fitting coefficient, target segmentation intervals are selected based on the first correlation threshold and the fitting coefficient threshold. The first preset condition for selecting target segmentation intervals is: the first correlation of the target segmentation interval is the largest among the segmentation intervals, the first correlation of the target segmentation interval is greater than the first correlation threshold, and the fitting coefficient of the target segmentation interval is greater than or equal to the fitting coefficient threshold.
[0145] Optionally, the first correlation coefficient is Pearson correlation with a threshold of 0.5; the fit coefficient is adj R-squared with a threshold of 0.3. Other values for the first correlation coefficient threshold and the fit coefficient threshold can be selected as needed, without specific limitations.
[0146] like Figure 5 As shown, in one implementation of this application embodiment, determining the target workload within the target segmentation interval specifically includes:
[0147] 501. Determine whether the minimum workload of the target segmentation interval is less than or equal to the minimum workload threshold;
[0148] Determine the minimum workload for the target segmentation interval and check if this minimum workload is less than or equal to a minimum workload threshold. The minimum workload threshold can be 0, 1MB, 100MB, 1GB, etc., and can be determined according to actual needs; no specific limit is imposed.
[0149] 502. If the minimum workload of the target segmentation interval is less than or equal to the minimum workload threshold, the maximum workload of the target segmentation interval shall be determined as the target workload.
[0150] If the minimum workload of the target segmentation interval is less than or equal to the minimum workload threshold, it means that the minimum workload of the target segmentation interval cannot meet the condition. Therefore, the maximum workload of the target segmentation interval is determined as the target workload.
[0151] 503. If the minimum workload of the target segmentation interval is greater than the minimum workload threshold, the minimum workload of the target segmentation interval shall be determined as the target workload.
[0152] If the minimum workload of the target segmentation interval is greater than the minimum workload threshold, it means that the minimum workload of the target segmentation interval meets the condition. Therefore, the minimum workload of the target segmentation interval is determined as the target workload.
[0153] It should be noted that there are other methods for selecting the target workload from the target segmentation interval, such as selecting the average value, median value, etc., and there are no specific limitations.
[0154] In one implementation of this application, after determining the target workload of the target device based on at least one target mutation position in the change relationship, the method further includes:
[0155] Send the target workload to the target computing device so that the target computing device can complete the target workload.
[0156] After determining the target workload, the target workload is sent to the target computing device. This can be done in two ways: either by sending the target workload value directly to the target computing device, which then receives and completes the task based on that value; or by assigning the task corresponding to the target workload to the target computing device, which then completes the assigned task.
[0157] like Figure 6 As shown in one implementation of this application embodiment, before obtaining the relationship between the processing speed and workload of the target computing device within a preset time period, the method further includes:
[0158] 601. The second correlation between the workload and processing speed of the computing device within a preset time period;
[0159] The second correlation between workload and processing speed of the computing devices is calculated within a preset time period. Devices with a high correlation between workload and processing speed are selected to maximize the effectiveness of workload optimization. When the correlation between workload and processing speed is low, adjusting the workload has little, no, or irregular impact on processing speed, making workload optimization unsuitable.
[0160] Optionally, the second correlation is the Spearman rank ratio correlation. The Spearman rank ratio correlation performs better when dealing with imperfectly matched data that still exhibits a monotonic positive correlation. The second correlation can also be calculated using other methods; there are no specific limitations.
[0161] The formula for Spearman's rank-ratio correlation coefficient is as follows:
[0162]
[0163] 602. Determine whether the second correlation between the workload and processing speed of the computing device within a preset time period is greater than the second correlation threshold;
[0164] Determine the second correlation threshold based on the actual situation, and judge whether the second correlation of the computing device is greater than the second correlation threshold.
[0165] Optionally, the second correlation is Spearman rank ratio correlation, with the threshold selected between 0.5 and 0.7. Other values are also acceptable for the second correlation threshold; no specific limitation is imposed.
[0166] 603. If the value is greater than the second correlation threshold, then the computing device is determined to be the target computing device.
[0167] If the second correlation of the computing device is greater than the second correlation threshold, it indicates that the workload and processing speed of the computing device are highly correlated, making it suitable for workload optimization. Therefore, the computing device is identified as the target computing device. Optionally, if the second correlation of the computing device is less than or equal to the second correlation threshold, it indicates that the workload and processing speed of the computing device are lowly correlated, making it unsuitable for workload optimization. Therefore, the computing device is discarded and no further workload optimization is performed.
[0168] like Figure 7 As shown, in one implementation of this application embodiment, the second correlation between the workload and processing speed of the computing device within a preset time period specifically includes:
[0169] 701. Divide the preset duration into multiple bins, calculate the workload index of each bin, and calculate the processing speed index of each bin.
[0170] Because minute-level data fluctuates significantly, binning is necessary for fuzzy data preprocessing to smooth out the impact of extreme values. To reduce the complexity of calculating the second correlation, the preset duration is divided into multiple bins, and workload and processing speed metrics are calculated for each bin. The workload metric represents the workload of each bin, and the processing speed metric represents the processing speed of each bin. This reduces the amount of data, simplifying the computation. The workload metric can be the mean workload, median workload, etc., without specific limitations; the processing speed metric can be the mean processing speed, median processing speed, etc., without specific limitations. The number of bins is greater than two, without specific limitations.
[0171] 702. Based on the workload and processing speed indicators of each sub-box, calculate the second correlation between workload and processing speed.
[0172] The second correlation is calculated using the workload and processing speed metrics for each bin. For example, a preset duration is divided into 10 bins, and the average workload and average processing speed are calculated for each bin, resulting in 10 average workload values and 10 average processing speed values. The second correlation between workload and processing speed is then calculated using these 10 average workload values and 10 average processing speed values.
[0173] like Figure 8 As shown, in one implementation of this application embodiment, the preset duration is divided into multiple sub-boxes, specifically including:
[0174] 801. Calculate the coefficient of variation of the workload within the preset time period;
[0175] Obtain workload data within a preset time period and calculate the coefficient of variation (COP) to understand the dispersion of the workload. The COP is calculated by dividing the standard deviation of the data by the mean. A higher COP indicates greater data dispersion.
[0176] 802. If the coefficient of variation is greater than or equal to the coefficient of variation threshold, then use equal-frequency binning to divide the preset duration into multiple bins;
[0177] If the coefficient of variation of the workload is greater than or equal to the coefficient of variation threshold, then equal-frequency binning is used to bin the preset duration. Equal-frequency binning: The boundary values of binning are selected so that each bin contains approximately the same number of instances.
[0178] 803. If the coefficient of variation is less than the coefficient of variation threshold, then use equal-width binning to divide the preset duration into multiple bins.
[0179] If the coefficient of variation of the workload is less than the coefficient of variation threshold, then equal-width binning is used to perform analysis on the preset duration. Equal-width binning: The range from the minimum value to the maximum value is divided into N equal parts. If A is the minimum value and B is the maximum value, then the length of each interval is W = (BA) / N, and the interval boundary values are A+W, A+2W, ..., A+(N-1)W.
[0180] Optionally, the coefficient of variation is 0.1. Other values for the coefficient of variation can also be used depending on actual needs; no specific restrictions are imposed.
[0181] like Figure 9 As shown in one implementation of this application embodiment, before obtaining the relationship between the processing speed and workload of the target computing device within a preset time period, the method further includes:
[0182] 901. Determine whether the work record indicators of the computing device meet the second preset condition within a preset time period. The work record indicators are used to represent the amount of data recorded by the computing device during normal operation.
[0183] Work log metrics are used to evaluate the quantity and quality of data recorded by computing devices. For example, the number of records for workload and processing speed is used to evaluate the quantity of data recorded by the computing device; the number of times the workload reaches zero is used to evaluate the quality of the data recorded by the computing device, because multiple instances of workload reaching zero indicate that the recording has repeatedly experienced faults such as disconnection. In addition to the number of records for workload and processing speed and the number of times the workload reaches zero, other work log metrics can also be used, and there are no specific limitations.
[0184] The system determines whether the work record indicators of the computing device meet a second preset condition. The second preset condition requires that the quantity and / or quality of the corresponding work record indicators meet certain requirements. The second preset condition can be set according to the actual situation and is not specifically limited.
[0185] 902. If the work record indicators meet the second preset condition, then the computing device is determined to be the target computing device.
[0186] If the work record indicators meet the second preset condition, it means that the computing device is working normally and the amount and / or quality of the recorded data is good, making it suitable for workload optimization. Therefore, the computing device is identified as the target computing device.
[0187] like Figure 10 As shown, in one implementation of this application embodiment, determining whether the work record indicators of the computing device within a preset time period meet the second preset condition specifically includes:
[0188] 1001. Determine whether the first record quantity of the computing device's workload and processing speed within a preset time period is greater than the first record quantity threshold;
[0189] The larger the initial record size, the more workload and processing speed data the computing device records within the preset time period. A larger initial record size provides more sufficient information for workload optimization decisions and makes it more likely to find a more ideal target workload.
[0190] 1002. If the first record quantity is greater than the first record quantity threshold, then the computing device is determined to meet the second preset condition;
[0191] If the first record quantity is greater than the first record quantity threshold, it indicates that the computing device has sufficient basis for decision-making on workload optimization, and therefore it is determined that the computing device does not meet the second preset condition.
[0192] 1003. If the first record quantity is less than or equal to the first record quantity threshold, then it is determined that the computing device does not meet the second preset condition;
[0193] If the first record quantity is less than or equal to the first record quantity threshold, it indicates that the computing device lacks a decision basis for workload optimization, and therefore it is determined that the computing device does not meet the second preset condition.
[0194] like Figure 11 As shown, in one implementation of this application embodiment, determining whether the work record indicators of the computing device within a preset time period meet the second preset condition specifically includes:
[0195] 1101. Determine whether the number of times the workload of the computing device is zeroed within a preset time period is less than the zeroing threshold;
[0196] A zero workload indicates a malfunction in the computing equipment, a wiring problem, or an error in the records. The more times the workload is zeroed out, the less reliable the computing equipment or records are.
[0197] 1102. If the number of times the workload is zeroed is less than the zeroing threshold, then the computing device is determined to meet the second preset condition.
[0198] If the number of zeroing cycles is less than the zeroing threshold, it indicates that the computing equipment, circuitry, and records are all sufficiently reliable, thus confirming that the computing equipment meets the second preset condition.
[0199] 1103. If the number of times the workload is zeroed is greater than or equal to the zeroing threshold, then the computing device is determined not to meet the second preset condition.
[0200] If the number of times the workload is zeroed out is greater than or equal to the zeroing threshold, it indicates that the computing device, circuit, or records are not reliable enough. Therefore, it is determined that the computing device does not meet the second preset condition.
[0201] like Figure 12 As shown, in one implementation of this application embodiment, determining whether the work record indicators of the computing device within a preset time period meet the second preset condition specifically includes:
[0202] 1201. Determine multiple workload intervals and statistically calculate the second record of the workload and processing speed of the equipment in each workload interval within a preset time period;
[0203] Divide the workload area into multiple workload intervals, and record the second amount of workload and processing speed within each interval. For example, if the workload area to be optimized is 0 to 10 GB, define each 1 GB interval as a workload interval, resulting in ten workload intervals: [0,1), [1,2), [2,3), [4,5), [5,6), [7,8), [8,9), [9,10]. These ten workload intervals will have ten second records. The workload area to be optimized can be determined based on actual needs and is not specifically limited. The workload intervals can be divided evenly or unevenly, depending on actual needs and is not specifically limited. Uneven division, for example, involves wider workload intervals during off-peak computing periods and narrower workload intervals during peak computing periods.
[0204] 1202. Determine whether the second record quantity in each workload interval is greater than the second record quantity threshold;
[0205] To ensure that the computing device has records of workload and processing speed throughout the entire workload optimization range, the second record quantity for each workload interval must be greater than the second record quantity threshold.
[0206] 1203. If the second record quantity in each workload interval is greater than the second record quantity threshold, then the computing device is determined to meet the second preset condition.
[0207] The second record quantity in all workload intervals is greater than the second record quantity threshold, indicating that the computing device has recorded data in each workload segment and there are no workload intervals with blank or nearly blank records. Therefore, it is suitable for workload optimization, and the computing device is determined to meet the second preset condition.
[0208] 1204. If the second record quantity in any workload range is less than or equal to the second record quantity threshold, then it is determined that the computing device does not meet the second preset condition.
[0209] If the second record quantity within the workload range is less than or equal to the second record quantity threshold, it indicates that the computing device has at least one workload range with blank or nearly blank records, which is not suitable for workload optimization. Therefore, it is determined that the computing device does not meet the second preset condition.
[0210] Steps 1001, 1101, and 1202 can be executed individually, any two, or all three. Steps 1001, 1101, and 1202 are not sequential and can be executed in any order or simultaneously. If two or three of steps 1001, 1101, and 1202 are executed, the computing device is only deemed to meet the second preset condition if all executed judgments determine that the computing device meets the second preset condition. Alternatively, the computing device may be deemed to meet the second preset condition if at least one of the executed judgments determines that the computing device meets the second preset condition, or the satisfaction of the second preset condition may be determined using other methods; the specific method is not limited.
[0211] To better illustrate the effects of the embodiments of this application, an experiment is provided, such as... Figure 13 As shown, the horizontal axis represents time in minutes, the workload (running volume) is denoted as "run_cur", the processing speed is denoted as "speed", and the vertical axis has been normalized. Figure 13 In the diagram, the two dashed lines perpendicular to the horizontal axis serve as the dividing points.
[0212] This application also provides a computing device workload optimization apparatus, including:
[0213] The acquisition unit is used to acquire the relationship between the processing speed and workload of the target computing device within a preset time period. The target computing device is selected from at least one candidate computing device.
[0214] The determination unit is used to determine the target workload of the target device based on at least one target mutation position in the change relationship. The target mutation position is the position where the difference in the magnitude of the change in the processing speed of the target computing device with the workload is most significant, and the processing speed of the target device is optimal when it completes the target workload.
[0215] In one implementation of this application embodiment, the determining unit is specifically used for:
[0216] Based on the target mutation location of the change relationship, the segmentation point is determined, and the preset duration is divided into multiple segmentation intervals;
[0217] If among multiple segmented intervals there exists a target segmented interval whose workload and processing speed meet the first preset conditions, then the target workload is determined in the target segmented interval.
[0218] In one implementation of this application embodiment, the determining unit is specifically used for:
[0219] The preset duration is divided into multiple windows, and the processing speed and workload are fitted within each window to obtain multiple window loss functions.
[0220] Calculate the window residuals of processing speed and workload relative to the window loss function within each window, and determine the target mutation location and the segmentation point based on the difference between the window residuals.
[0221] In one implementation of this application embodiment, the determining unit is specifically used for:
[0222] Determine the window width, and divide the preset duration into multiple first windows based on the window width;
[0223] Merge two adjacent first windows into one second window;
[0224] The processing speed and workload are fitted within each first window to obtain multiple single-window loss functions;
[0225] The processing speed and workload are fitted within each second window to obtain multiple double-window loss functions;
[0226] Calculate the single-window residuals of processing speed and workload relative to the single-window loss function within each first window;
[0227] Calculate the average single-window residual of two adjacent first windows to obtain the average single-window residual;
[0228] Calculate the double-window residuals of processing speed and workload relative to the double-window loss function within each second window;
[0229] Calculate the difference between the double-window residuals corresponding to two adjacent first windows and the average single-window residual to obtain the residual difference;
[0230] The intersection points of several groups of adjacent first windows with the largest absolute value of residual difference are determined as the target mutation locations and the segmentation points.
[0231] In one implementation of this application embodiment, the determining unit is specifically used for:
[0232] The window width is set to 2*N^(1 / 2), where N is the preset duration.
[0233] In one implementation of this application, the windowing loss function is a linear loss function.
[0234] In one implementation of this application embodiment, the determining unit is specifically used for:
[0235] If among multiple segmentation intervals, there exists a target segmentation interval where the first correlation between workload and processing speed is the greatest and greater than the first correlation threshold, then the target workload is determined within the target segmentation interval.
[0236] In one implementation of this application embodiment, the determining unit is specifically used for:
[0237] Linear fitting is performed on the workload and processing speed within the segmentation interval with the highest first correlation to obtain the fitting coefficients;
[0238] If among multiple segmentation intervals, there exists a target segmentation interval where the first correlation between workload and processing speed is the greatest and greater than the first correlation threshold, and the fitting coefficient is greater than or equal to the fitting coefficient threshold, then the target workload is determined within the target segmentation interval.
[0239] In one implementation of this application, the first correlation is a Pearson correlation.
[0240] In one implementation of this application embodiment, the determining unit is specifically used for:
[0241] Determine whether the minimum workload of the target segmentation interval is less than or equal to the minimum workload threshold;
[0242] If the minimum workload of the target segmentation interval is less than or equal to the minimum workload threshold, the maximum workload of the target segmentation interval is determined as the target workload.
[0243] If the minimum workload of the target segmentation interval is greater than the minimum workload threshold, the minimum workload of the target segmentation interval is determined as the target workload.
[0244] In one implementation of this application, the apparatus further includes: a transmitting unit, configured to:
[0245] Send the target workload to the target computing device so that the target computing device can complete the target workload.
[0246] In one implementation of this application, the apparatus further includes: a screening unit, used for:
[0247] The second correlation between the workload and processing speed of the computing device within a preset time period;
[0248] Determine whether the second correlation between the workload and processing speed of the computing device within a preset time period is greater than the second correlation threshold;
[0249] If the value is greater than the second relevance threshold, then the computing device is determined to be the target computing device.
[0250] In one implementation of this application embodiment, the filtering unit is specifically used for:
[0251] The preset duration is divided into multiple bins, and the workload index of each bin and the processing speed index of each bin are calculated.
[0252] Based on the workload and processing speed indicators of each sub-bin, the second correlation between workload and processing speed is calculated.
[0253] In one implementation of this application embodiment, the filtering unit is specifically used for:
[0254] Calculate the coefficient of variation of workload within the preset time period;
[0255] If the coefficient of variation is greater than or equal to the coefficient of variation threshold, then equal-frequency binning is used to divide the preset duration into multiple bins;
[0256] If the coefficient of variation is less than the coefficient of variation threshold, then equal-width binning is used to divide the preset duration into multiple bins.
[0257] In one implementation of this application, the second correlation is a Spearman rank ratio correlation.
[0258] In one implementation of this application embodiment, the filtering unit is further configured to:
[0259] Determine whether the work record indicators of the computing device meet the second preset condition within a preset time period. The work record indicators are used to represent the amount of data that the computing device has recorded while working normally.
[0260] If the work record indicators meet the second preset condition, then the computing device is determined to be the target computing device.
[0261] In one implementation of this application embodiment, the filtering unit is specifically used for:
[0262] Determine whether the first record quantity of the computing device's workload and processing speed within a preset time period is greater than the first record quantity threshold;
[0263] If the first record count is greater than the first record count threshold, then the computing device is determined to meet the second preset condition; or / and
[0264] Determine whether the number of times the workload of the computing device is zeroed within a preset time period is less than the zeroing threshold;
[0265] If the number of zeroing cycles is less than the zeroing threshold, then the computing device is determined to meet the second preset condition; or / and
[0266] Determine multiple workload intervals and statistically calculate the second record of the workload and processing speed of the equipment in each workload interval within a preset time period;
[0267] Determine whether the second record quantity in each workload interval is greater than the second record quantity threshold;
[0268] If the second record quantity in each workload interval is greater than the second record quantity threshold, then the computing device is determined to meet the second preset condition.
[0269] This application also provides a computer-readable storage medium, which includes instructions that, when executed on a computer, cause the computer to perform the following actions: Figures 1 to 13 The method in the illustrated embodiment.
[0270] like Figure 14 As shown in the illustration, this application also provides a computer device 1400, comprising:
[0271] Central processing unit 1401, memory 1405, input / output interface 1404, wired or wireless network interface 1403, and power supply 1402.
[0272] Memory 1405 is either a short-term storage memory or a persistent storage memory;
[0273] The central processing unit 1401 is configured to communicate with the memory 1405 and execute instructions stored in the memory 1405 to perform actions such as... Figures 1 to 13 The method in the illustrated embodiment.
[0274] This application also provides a computer-readable storage medium, which includes instructions that, when executed on a computer, cause the computer to perform actions such as... Figures 1 to 13 The method in the illustrated embodiment.
[0275] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform actions such as... Figures 1 to 13 The method in the illustrated embodiment.
[0276] This application also provides a chip system, which includes at least one processor and a communication interface. The communication interface and the at least one processor are interconnected via a circuit. The at least one processor is used to run computer programs or instructions to perform tasks such as... Figures 1 to 13 The method in the illustrated embodiment.
[0277] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0278] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0279] The terms "first," "second," "third," "fourth," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein.
[0280] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0281] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0282] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0283] If the integrated unit is implemented as 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 this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for optimizing the workload of a computing device, characterized in that, include: Obtain the relationship between the processing speed and workload of the target computing device within a preset time period. The target computing device is selected from at least one candidate computing device. Based on at least one target mutation location in the change relationship, determine the target workload of the target computing device. The target mutation location is the location where the difference in the magnitude of the change in the processing speed of the target computing device with the workload is most significant. Based on at least one target abrupt change location in the change relationship, the target workload of the target computing device is determined, specifically including: Based on the target mutation location of the change relationship, the segmentation point is determined, and the preset duration is divided into multiple segmentation intervals; If there is a target segmentation interval among multiple segmentation intervals that satisfies the first preset condition in terms of workload and processing speed, then the target workload is determined in the target segmentation interval. The first preset condition indicates that the first correlation between workload and processing speed is the greatest and is greater than the first correlation threshold. The cutoff point is determined based on the target mutation location of the change relationship, specifically including: The preset duration is divided into multiple windows, and the processing speed and workload are fitted within each window to obtain multiple window loss functions. Calculate the window residuals of processing speed and workload relative to the window loss function within each window, and determine the target mutation location and the segmentation point based on the difference between the window residuals; The preset duration is divided into multiple windows. Within each window, the processing speed and workload are fitted to obtain multiple windowed loss functions, including: Determine the window width, and divide the preset duration into multiple first windows based on the window width; Merge two adjacent first windows into one second window; The processing speed and workload are fitted within each first window to obtain multiple single-window loss functions; The processing speed and workload are fitted within each second window to obtain multiple double-window loss functions; Calculate the windowing residuals of processing speed and workload relative to the windowing loss function within each window. Based on the differences between the windowing residuals, determine the target abrupt change location and the cutoff point. Specifically, this includes: Calculate the single-window residuals of processing speed and workload relative to the single-window loss function within each first window; Calculate the average single-window residual of two adjacent first windows to obtain the average single-window residual; Calculate the double-window residuals of processing speed and workload relative to the double-window loss function within each second window; Calculate the difference between the double-window residuals corresponding to two adjacent first windows and the average single-window residual to obtain the residual difference; The intersection points of several groups of adjacent first windows with the largest absolute value of residual difference are determined as the target mutation locations and the segmentation points.
2. The method for optimizing computing device workload according to claim 1, characterized in that, Determining the window width specifically includes: The window width is set to 2*N^(1 / 2), where N is the preset duration.
3. The method for optimizing computing device workload according to claim 1, characterized in that, All windowing loss functions are linear loss functions.
4. The method for optimizing computing device workload according to claim 1, characterized in that, Before determining the target workload within the target segmentation interval, the method further includes: Linear fitting is performed on the workload and processing speed within the segmentation interval with the highest first correlation to obtain the fitting coefficients; If among multiple segmented intervals, there exists a target segmented interval whose workload and processing speed meet the first preset condition, then the target workload is determined within the target segmented interval, specifically including: If among multiple segmentation intervals, there exists a target segmentation interval where the first correlation between workload and processing speed is the highest and greater than the first correlation threshold, and the fitting coefficient is greater than or equal to the fitting coefficient threshold, then the target workload is determined within the target segmentation interval.
5. The method for optimizing computing device workload according to claim 1 or 4, characterized in that, The first correlation is the Pearson correlation.
6. The method for optimizing computing device workload according to claim 1, characterized in that, Determine the target workload within the target segmentation interval, specifically including: Determine whether the minimum workload of the target segmentation interval is less than or equal to the minimum workload threshold; If the minimum workload of the target segmentation interval is less than or equal to the minimum workload threshold, the maximum workload of the target segmentation interval is determined as the target workload. If the minimum workload of the target segmentation interval is greater than the minimum workload threshold, the minimum workload of the target segmentation interval is determined as the target workload.
7. The method for optimizing computing device workload according to claim 1, characterized in that, After determining the target workload of the target computing device based on at least one target mutation location in the change relationship, the method further includes: Send the target workload to the target computing device so that the target computing device can complete the target workload.
8. The method for optimizing computing device workload according to claim 1, characterized in that, Before obtaining the relationship between the processing speed and workload of the target computing device within a preset time period, the method further includes: The second correlation between the workload and processing speed of the computing device within a preset time period; Determine whether the second correlation between the workload and processing speed of the computing device within a preset time period is greater than the second correlation threshold; If the value is greater than the second relevance threshold, then the computing device is determined to be the target computing device.
9. The method for optimizing computing device workload according to claim 8, characterized in that, The second correlation between the workload and processing speed of a computing device within a preset time period includes: The preset duration is divided into multiple bins, and the workload index of each bin and the processing speed index of each bin are calculated. Based on the workload and processing speed indicators of each sub-bin, the second correlation between workload and processing speed is calculated.
10. The method for optimizing computing device workload according to claim 9, characterized in that, The preset duration is divided into multiple bins, specifically including: Calculate the coefficient of variation of workload within the preset time period; If the coefficient of variation is greater than or equal to the coefficient of variation threshold, then equal-frequency binning is used to divide the preset duration into multiple bins; If the coefficient of variation is less than the coefficient of variation threshold, then equal-width binning is used to divide the preset duration into multiple bins.
11. The method for optimizing computing device workload according to claim 8, characterized in that, The second correlation is the Spearman rank ratio correlation.
12. The method for optimizing computing device workload according to claim 1, characterized in that, Before obtaining the relationship between the processing speed and workload of the target computing device within a preset time period, the method further includes: Determine whether the work record indicators of the computing device meet the second preset condition within a preset time period. The work record indicators are used to represent the amount of data that the computing device has recorded while working normally. If the work record indicators meet the second preset condition, then the computing device is determined to be the target computing device.
13. The method for optimizing computing device workload according to claim 12, characterized in that, Determine whether the computing device's work record indicators within a preset time period meet the second preset condition, specifically including: Determine whether the first record quantity of the computing device's workload and processing speed within a preset time period is greater than the first record quantity threshold; If the first record count is greater than the first record count threshold, then the computing device is determined to meet the second preset condition; or / and Determine whether the number of times the workload of the computing device is zeroed within a preset time period is less than the zeroing threshold; If the number of zeroing cycles is less than the zeroing threshold, then the computing device is determined to meet the second preset condition; or / and Determine multiple workload intervals and statistically calculate the second record of the workload and processing speed of the equipment in each workload interval within a preset time period; Determine whether the second record quantity in each workload interval is greater than the second record quantity threshold; If the second record quantity in each workload interval is greater than the second record quantity threshold, then the computing device is determined to meet the second preset condition.
14. A computing device workload optimization device, characterized in that, include: The acquisition unit is used to acquire the relationship between the processing speed and workload of the target computing device within a preset time period. The target computing device is selected from at least one candidate computing device. The determination unit is used to determine the target workload of the target computing device based on at least one target mutation position in the change relationship. The target mutation position is the position where the difference in the magnitude of the change in the processing speed of the target computing device with the workload is the most significant, and the processing speed of the target computing device is optimal when it completes the target workload. The determining unit is specifically used to determine the segmentation point according to the target mutation position of the change relationship, divide the preset time into multiple segmentation intervals, and if there is a target segmentation interval in the multiple segmentation intervals where the workload and processing speed meet the first preset condition, then the target workload is determined in the target segmentation interval. The first preset condition represents that the first correlation between workload and processing speed is the largest and greater than the first correlation threshold. The determining unit is specifically used to divide the preset time into multiple windows, fit the processing speed and workload in each window to obtain multiple window loss functions, calculate the window residuals of the processing speed and workload in each window relative to the window loss functions, and determine the target mutation position and the segmentation point based on the difference between the window residuals. The determining unit is specifically used to determine the window width, divide the preset time into multiple first windows according to the window width, merge two adjacent first windows into a second window, fit the processing speed and workload within each first window to obtain multiple single-window loss functions, and fit the processing speed and workload within each second window to obtain multiple double-window loss functions. The determining unit is specifically used to calculate the single-window residuals of processing speed and workload relative to the single-window loss function within each first window, calculate the average value of the single-window residuals of two adjacent first windows to obtain the average single-window residual, calculate the double-window residuals of processing speed and workload relative to the double-window loss function within each second window, calculate the difference between the double-window residuals corresponding to two adjacent first windows and the average single-window residual to obtain the residual difference value, and determine the intersection points of several groups of adjacent two first windows with the largest absolute value of the residual difference value as the target mutation position and determine the segmentation point.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 13.
Citation Information
Patent Citations
Method and system for allocating weighing tasks of plants
CN110186541A
Breakpoint repulling method and device for batch processing system
CN113986487A