A dynamic computing resource scheduling method, system, device and storage medium
By analyzing user access behavioral data and historical data, and optimizing resource scheduling strategies in combination with activity information, the problem of difficult to accurately predict the change trend of user request traffic in the existing technology is solved, and the accurate allocation and efficient utilization of server resources are achieved.
Patent Information
- Application Number
- CN202411721957.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-11-28
AI Technical Summary
The prior art is difficult to accurately predict the changing trend of user requested traffic, resulting in inaccurate server resource provisioning, especially during large-scale promotions.
By obtaining user access behavior data of the target platform, predicting the first change trend of user requested traffic, and combining historical data and activity information for strategy optimization, the target resource scheduling strategy is generated to adjust server resource allocation.
It realizes accurate prediction of the change trend of user request traffic, avoids violent fluctuations in resource allocation, improves prediction accuracy in special scenarios, and ensures accurate allocation of server resources.
Smart Images

Figure CN119201411B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of resource allocation, and specifically to a dynamic computing resource scheduling method, system, device and storage medium. Background Art
[0002] At present, the number of user visits to Internet platforms shows obvious fluctuations, especially during large-scale promotional activities, when the number of user requests will increase sharply and suddenly. This sudden increase in traffic will bring tremendous pressure to the platform's servers. If the resources are insufficiently configured, it will lead to longer system response time and excessive server load, and even cause service interruption or system crash in serious cases; if the server resources are over-configured, it will cause idle resources and increase operating costs. Therefore, how to accurately predict the changes in user request traffic and adjust the server resource configuration in time has become a key technical issue to ensure the stable operation of the platform.
[0003] Existing technologies usually use historical data analysis to predict the changing trend of user request traffic and formulate resource scheduling strategies accordingly. For example, by analyzing historical access logs, the periodicity and peak-valley distribution characteristics of user access are obtained, and then the change of request traffic in the future is predicted, so as to adjust the configuration of server resources in advance. However, in special scenarios such as platform promotion activities, the traffic change patterns caused by different types of activities vary greatly. It is difficult to accurately predict the changing trend of user request traffic based on historical rules alone, resulting in inaccurate allocation of server resources. Summary of the invention
[0004] The present application provides a dynamic computing resource scheduling method, system, device and storage medium for accurately predicting the changing trend of user request traffic and realizing accurate allocation of server resources.
[0005] In a first aspect, the present application provides a dynamic computing resource scheduling method, the method comprising: obtaining user access behavior data of a target platform within a first preset time period; predicting a first change trend of user request traffic within a second preset time period based on the user access behavior data, and generating a first resource scheduling strategy based on the first change trend, wherein the first preset time period is before the second preset time period; obtaining historical user access behavior data of the target platform, adjusting the first resource scheduling strategy based on the historical user access behavior data, and generating a second resource scheduling strategy; obtaining activity information of the target platform, and predicting a second change trend of the user request traffic within the second preset time period based on the activity information; adjusting the second resource scheduling strategy based on the second change trend, generating a target resource scheduling strategy, and adjusting the resource allocation of the target server cluster based on the target resource scheduling strategy.
[0006] By adopting the above technical solution, first, by analyzing the current user access behavior data to predict the first change trend, the real-time change characteristics of user behavior can be captured in time; second, by optimizing the strategy in combination with historical user access behavior data, drastic fluctuations in resource allocation can be effectively avoided; finally, by introducing activity information to predict the second change trend, the prediction accuracy in special scenarios is further improved. This progressive strategy optimization mechanism can accurately predict the change trend of user request traffic and realize accurate allocation of server resources.
[0007] Optionally, predicting a first change trend of user request traffic within a second preset time period based on the user access behavior data includes: obtaining request volume data and request time data in the user access behavior data; calculating the request volume per unit time within the first preset time period based on the request volume data and the request time data; calculating a trend coefficient of the request volume changing with time based on the request volume per unit time; and determining the first change trend based on the trend coefficient.
[0008] By adopting the above technical solution, through fine-grained analysis of user access behavior data, the request volume data and request time data are converted into the request volume per unit time, and the trend coefficient is calculated based on this, so as to achieve the quantitative characterization of the change trend of user request traffic. This prediction method based on time series analysis can not only accurately reflect the dynamic change law of the request volume, but also reduce the impact of random fluctuations through the calculation of trend coefficients, so as to make the prediction result of the first change trend more objective and accurate, and provide reliable data support for the formulation of subsequent resource scheduling strategies.
[0009] Optionally, the first resource scheduling strategy is adjusted according to the historical user access behavior data to generate a second resource scheduling strategy, including: predicting a third change trend of the user request traffic within the second preset time period according to the historical user access behavior data; calculating an adjustment value of a resource allocation parameter in the first resource scheduling strategy according to the third change trend; adjusting the resource allocation parameter according to the adjustment value to obtain a target resource allocation parameter; and generating the second resource scheduling strategy according to the target resource allocation parameter.
[0010] By adopting the above technical solution, the third change trend is predicted by introducing historical user access behavior data and converting it into specific resource allocation parameter adjustment values, thereby achieving quantitative optimization of the first resource scheduling strategy. This strategy adjustment method based on historical data can make full use of the empirical data accumulated by the platform, and correct the resource allocation parameters by calculating specific adjustment values, thus avoiding the decision fluctuations that may be caused by purely relying on real-time data, so that the second resource scheduling strategy can maintain a sensitive response to the current access trend while also having a strong strategy stability.
[0011] Optionally, the activity information includes an activity type and an activity time period, and predicting the second change trend of the user request traffic within the second preset time period based on the activity information includes: determining a basic traffic change coefficient corresponding to the activity type based on the activity type; calculating traffic change parameters within the second preset time period based on the activity time period and the basic traffic change coefficient; and determining the second change trend based on the traffic change parameters.
[0012] By adopting the above technical solution, by decomposing the activity information into two dimensions, activity type and activity time period, and introducing the basic traffic change coefficient for quantitative analysis, an accurate prediction of the change in user request traffic in a specific activity scenario is achieved. By establishing a mapping relationship between the activity type and the basic traffic change coefficient, and calculating the specific traffic change parameters in combination with the activity time period, the system can accurately identify the differentiated impact of different types of activities on request traffic. This refined prediction method based on activity characteristics significantly improves the prediction accuracy of the second change trend in special scenarios, and provides a more targeted decision-making basis for the final optimization of resource scheduling strategies.
[0013] Optionally, the second resource scheduling policy is adjusted according to the second changing trend to generate a target resource scheduling policy, including: determining the resource demand within the second preset time period based on the second changing trend; calculating a correction value of a resource allocation parameter in the second resource scheduling policy according to the resource demand; adjusting the resource allocation parameter in the second resource scheduling policy according to the correction value to obtain a final resource allocation parameter; and generating the target resource scheduling policy according to the final resource allocation parameter.
[0014] By adopting the above technical solution, the second change trend is converted into a specific resource demand, and the correction value of the resource allocation parameter is calculated based on this, so that the second resource scheduling strategy can be accurately adjusted. This strategy optimization method based on resource demand can not only directly map the traffic changes brought about by the activity to the resource allocation, but also realize the refined control of resource allocation through the introduction of the correction value, so that the target resource scheduling strategy finally generated can accurately match the actual business needs, which not only ensures the adequacy of resource supply, but also avoids the over-allocation of resources, thereby realizing the optimization of resource utilization efficiency.
[0015] Optionally, adjusting the resource allocation of the target server cluster according to the target resource scheduling policy includes: obtaining the resource allocation parameters in the target resource scheduling policy; determining the target resource configuration amount of each server node in the target server cluster according to the resource allocation parameters in the target resource scheduling policy; calculating the difference between the current resource configuration amount of each server node and the target resource configuration amount; and adjusting the allocation of computing resources and storage resources of each server node according to the difference.
[0016] By adopting the above technical solution, the target resource scheduling strategy is converted into a specific server node resource configuration, and the difference between the current configuration and the target configuration is calculated to achieve precise resource adjustment. This difference-based resource allocation method enables the system to independently optimize resources for each server node in the target server cluster, ensuring the implementation of the overall resource scheduling strategy and achieving balanced allocation of computing resources and storage resources within the cluster, thereby improving the overall operating efficiency and resource utilization of the server cluster.
[0017] Optionally, obtain the actual resource usage of the target server cluster and the preset resource usage of the target server after adjusting the resource allocation of the target server cluster; calculate the deviation value between the actual resource usage and the preset resource usage; when the deviation value exceeds a preset threshold, adjust the target resource scheduling policy according to the deviation value; and reallocate the resources of the target server cluster according to the adjusted target resource scheduling policy.
[0018] By adopting the above technical solution, the actual resource usage of the target server cluster is monitored in real time, and compared with the preset resource usage, dynamic feedback optimization of the resource scheduling strategy is achieved. By introducing the deviation value and preset threshold mechanism, the system can promptly detect the mismatch between resource configuration and actual demand, and trigger policy adjustment when the deviation exceeds the threshold, thus forming a closed-loop resource scheduling optimization mechanism. This adaptive adjustment method based on real-time feedback not only improves the accuracy and real-time performance of resource scheduling, but also enhances the system's ability to cope with sudden traffic changes, ensuring that the server cluster resource configuration is always in the optimal state.
[0019] In a second aspect, the present application provides a dynamic computing resource scheduling system, the system comprising: an acquisition module, a generation module, a first adjustment module, a prediction module and a second adjustment module; wherein the acquisition module is used to acquire user access behavior data of a target platform within a first preset time period; the generation module is used to predict a first change trend of user request traffic within a second preset time period based on the user access behavior data, and generate a first resource scheduling strategy based on the first change trend, wherein the first preset time period is before the second preset time period; the first adjustment module is used to acquire historical user access behavior data of the target platform, and adjust the first resource scheduling strategy based on the historical user access behavior data to generate a second resource scheduling strategy; the prediction module is used to acquire activity information of the target platform, and predict a second change trend of the user request traffic within the second preset time period based on the activity information; the second adjustment module adjusts the second resource scheduling strategy based on the second change trend, generates a target resource scheduling strategy, and adjusts the resource allocation of the target server cluster based on the target resource scheduling strategy.
[0020] In the third aspect, the present application provides an electronic device, adopting the following technical solution: including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes a computer program such as any one of the above-mentioned dynamic computing resource scheduling methods.
[0021] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: storing a computer program that can be loaded by a processor and execute any of the above-mentioned dynamic computing resource scheduling methods.
[0022] In summary, the present application includes at least one of the following beneficial technical effects:
[0023] 1. By adopting the above technical solution, first, by analyzing the current user access behavior data to predict the first change trend, the real-time change characteristics of user behavior can be captured in time; secondly, by optimizing the strategy in combination with the historical user access behavior data, drastic fluctuations in resource allocation can be effectively avoided; finally, by introducing activity information to predict the second change trend, the prediction accuracy in special scenarios is further improved. This progressive strategy optimization mechanism can accurately predict the change trend of user request traffic and realize accurate allocation of server resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flowchart of a dynamic computing resource scheduling method provided in an embodiment of the present application;
[0025] Figure 2 It is a structural diagram of a dynamic computing resource scheduling system provided in an embodiment of the present application;
[0026] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0027] Description of the reference numerals: 1000, electronic device; 1001, processor; 1002, communication bus; 1003, user interface; 1004, network interface; 1005, memory. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0029] In the description of the embodiments of the present application, words such as "illustrative", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "illustrative", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "illustrative", "for example" or "for example" is intended to present related concepts in a concrete way.
[0030] During the Double Eleven e-commerce promotion, the dynamic computing resource scheduling method predicts the user request traffic change trend within the second preset time period in the future based on the user access behavior data obtained within the first preset time period (current time period).
[0031] For example, when the system detects a rapid increase in user access behavior data such as adding items to favorites and shopping carts before an event begins, it first predicts the first change trend based on these real-time behavior data and generates a preliminary resource scheduling strategy. Subsequently, the system optimizes and adjusts the strategy based on the platform's daily user access behavior data to generate a second resource scheduling strategy. Next, the system analyzes the upcoming Double Eleven event type and event time characteristics to predict the second change trend. Based on this trend, the system further adjusts the resource scheduling strategy and ultimately generates a target resource scheduling strategy.
[0032] When the forecast shows that the order creation rate may reach a peak of 50,000 orders per second during the midnight period, the system starts to expand resources 10 minutes in advance. During the activity, the system continuously compares the deviation between the actual resource usage and the predicted value. When the deviation exceeds the preset threshold, it adjusts the resource allocation in time to ensure that the server response time is maintained within 50ms and the order creation success rate reaches 99.99%. Through this dynamic resource scheduling solution based on multi-dimensional predictions, the platform can accurately predict resource needs and prepare in advance, increasing resource utilization by 30% and reducing operation and maintenance costs by 20%.
[0033] Figure 1 This application discloses a method for scheduling dynamic computing resources. Figure 1 As shown, the method includes S101-S105.
[0034] S101, obtaining user access behavior data of a target platform within a first preset time period.
[0035] In this embodiment, in order to achieve accurate scheduling of target platform resources, it is first necessary to obtain user access behavior data of the target platform within a first preset time period.
[0036] Specifically, the system acquires the user's access behavior data on the target platform in real time through the data collection module deployed on each service node of the target platform. These data include user request volume data, request time data, page access depth, dwell time, click events, and interactive operations, etc. Among them, the first preset time can be set to 5 minutes, that is, user access behavior data is collected every 5 minutes. The data collection module pre-processes the collected raw data, including data cleaning, format conversion, and feature extraction, and converts it into structured data that is easy to analyze.
[0037] For example, the user's click events are sorted in chronological order, the number of requests per unit time is counted, and the average page stay time is calculated. These pre-processed user access behavior data provide an accurate data basis for the subsequent prediction of the changing trend of user request traffic within the second preset time. Through this real-time and precise data collection method, the system can capture subtle changes in user access behavior in a timely manner, provide a reliable decision-making basis for subsequent traffic forecasting and resource scheduling, and effectively improve the accuracy and real-time performance of resource scheduling. For example, when the system detects that the number of user requests suddenly increases by 10% within a certain period of time, it can detect this change at the millisecond level and provide timely data support for subsequent prediction analysis.
[0038] S102, predicting a first change trend of user request traffic within a second preset time period based on user access behavior data, and generating a first resource scheduling strategy based on the first change trend, wherein the first preset time period is before the second preset time period.
[0039] In this embodiment, in order to accurately predict changes in resource demand and adjust resource configuration in advance, the system needs to predict changes in user request traffic within the second preset time period based on the acquired user access behavior data.
[0040] Specifically, the system first extracts the request volume data and request time data from the user access behavior data, and calculates the request volume per unit time by taking every 1 minute within the first preset time as the statistical unit. Subsequently, the trend coefficient of the request volume changing over time is calculated based on these request volume data per unit time through the time series analysis algorithm. Among them, the trend coefficient is calculated using the weighted moving average method, which gives a higher weight to the data in the most recent time period, so as to obtain a trend prediction result that is more in line with the real-time change characteristics.
[0041] For example, when it is detected that the number of user requests in the last 5 minutes shows a continuous upward trend, the system will predict that the user request traffic may continue to rise in the next second preset time (such as 15 minutes), thereby determining the first change trend. Based on the first change trend, the system generates a corresponding first resource scheduling strategy, including determining the number of server nodes that need to be expanded, computing resource quotas, and storage resource allocation parameters. Through this prediction and strategy generation mechanism based on real-time data, the system can identify possible resource demand fluctuations in advance and respond quickly.
[0042] Based on the above embodiment, as an optional implementation, in S102, predicting the first change trend of user request traffic within the second preset time period according to user access behavior data specifically includes S201-S204:
[0043] S201, obtaining request quantity data and request time data from user access behavior data.
[0044] S202: Calculate the request quantity per unit time within a first preset time period according to the request quantity data and the request time data.
[0045] S203, calculating the trend coefficient of the request volume changing with time according to the request volume per unit time.
[0046] S204: Determine a first change trend according to the trend coefficient.
[0047] In this embodiment, the request volume data refers to the number statistics of various operation requests initiated by users on the target platform, including page access requests, interface call requests, data query requests, etc. For example, when a user browses a product detail page, a page load request is generated; when clicking Add to Cart, an interface call request is generated; when searching for a product, a query request is generated, etc.
[0048] In order to more accurately predict the changing trend of user request traffic, the system needs to conduct an in-depth analysis of user access behavior data. First, the system extracts request volume data and request time data from user access behavior data, which record the specific circumstances of users initiating requests at different time points. Next, the system divides the first preset time length (such as 5 minutes) into multiple statistical units (such as 1 minute), and counts the total number of requests in each statistical unit based on the request volume data and request time data to obtain the number of requests per unit time. Subsequently, the system obtains the trend coefficient by calculating the rate of change of the number of requests between adjacent statistical units. For example, if the number of requests in the current statistical unit increases by 15% compared with the previous statistical unit, the trend coefficient is 1.15.
[0049] The system calculates the trend coefficients for all adjacent statistical units within the first preset time period, and synthesizes the final trend coefficients by weighting, where the trend coefficients of the most recent time period are given higher weights. Finally, the system determines the first change trend based on the synthesized trend coefficients. For example, a trend coefficient greater than 1 indicates an upward trend, and a trend coefficient less than 1 indicates a downward trend. This systematic data analysis method can accurately capture the changing patterns of user request volumes, providing a reliable basis for the subsequent formulation of resource scheduling strategies.
[0050] S103, obtaining historical user access behavior data of the target platform, adjusting the first resource scheduling strategy according to the historical user access behavior data, and generating a second resource scheduling strategy.
[0051] In this embodiment, in order to further optimize the accuracy of the resource scheduling strategy, the system needs to modify the first resource scheduling strategy in combination with the historical experience of the target platform.
[0052] Specifically, the system obtains historical user access behavior data from the data center of the target platform over the past three months, including the distribution of request volume, resource usage, and service quality indicators in different time periods. By analyzing these historical data, the system extracts the periodicity of user access behavior, resource demand characteristics in typical scenarios, and the actual effects of historical scheduling strategies.
[0053] For example, the system found that 8:00-10:00 and 20:00-22:00 are the peak hours of daily access, and the resource demand during these hours is usually 30% higher than the average level. Based on these historical rules, the system optimizes and adjusts the first resource scheduling strategy, such as adjusting the originally expected 20% expansion of resources to 25% expansion based on historical experience, or optimizing the resource allocation ratio based on the historical server load distribution, thereby generating a more reasonable second resource scheduling strategy. This policy optimization mechanism based on historical data can effectively avoid resource scheduling deviations caused by lack of experience and improve the accuracy of resource scheduling.
[0054] Based on the above embodiment, as an optional implementation mode, in S103, adjusting the first resource scheduling strategy according to the historical user access behavior data, and generating the second resource scheduling strategy specifically includes S301-S304:
[0055] S301, predicting a third change trend of user request traffic within a second preset time period according to historical user access behavior data.
[0056] In this embodiment, in order to obtain the regular characteristics of user access behavior from historical experience, the system needs to analyze historical user access behavior data to predict the third change trend.
[0057] Specifically, the system obtains historical user access behavior data corresponding to the current time point in the past three months from the data center of the target platform, including various types of request volume data and request time data. The system first aligns these historical data according to the time dimension, for example, extracting the request volume data for the same time period every day (such as 10:00-10:15 am). Then, the system calculates the average request volume and the fluctuation range of the request volume in these time periods to obtain the request volume baseline value and fluctuation threshold for the time period. When it is found that the historical average request volume in the time period of 10:00-10:15 am on weekdays is 30% higher than other time periods, the system will use this rule as an important basis for predicting the third change trend. Through this analysis method based on historical data, the system can discover the periodic change pattern of user request volume and predict possible traffic fluctuations in advance.
[0058] S302: Calculate an adjustment value of a resource allocation parameter in the first resource scheduling strategy according to the third change trend.
[0059] In this embodiment, in order to convert historical experience into a specific resource adjustment plan, the system needs to calculate the adjustment value of the resource allocation parameter according to the third change trend.
[0060] Specifically, the system first obtains the resource allocation parameters in the first resource scheduling strategy, including configuration parameters such as the number of server nodes, the number of CPU cores, and memory capacity. Then, the system maps and analyzes the third change trend with these parameters. When the third change trend shows that the request volume is usually 30% higher than the benchmark value during a specific period (such as 10:00-10:15 am), the system will calculate the corresponding resource adjustment ratio based on historical experience.
[0061] For example, for the server node quantity parameter, the system will calculate the adjustment value that needs to be increased by 25%, and for the memory capacity parameter, the system will calculate the adjustment value that needs to be increased by 35%. The calculation of these adjustment values takes into account the corresponding relationship between the historical request volume and resource utilization efficiency. By analyzing the proportional relationship between the request volume growth and resource consumption in the historical data, the optimal adjustment ratio is obtained. This parameter adjustment method based on historical experience can avoid under-allocation or over-allocation of resources and improve resource utilization efficiency.
[0062] S303: Adjust the resource allocation parameter according to the adjustment value to obtain the target resource allocation parameter.
[0063] In this embodiment, in order to convert the calculated adjustment value into an actually executable resource configuration solution, the system needs to make specific adjustments to the resource allocation parameters in the first resource scheduling strategy.
[0064] Specifically, the system first obtains the current resource allocation parameter configuration, including the actual values of parameters such as the number of server nodes, the number of CPU cores, the memory capacity, and the number of database connections. Then, the system calculates these parameter values with the previously calculated adjustment values. For example, if the number of server nodes currently configured is 100 and the adjustment value is 25%, the target number of server nodes is adjusted to 125; if the current memory capacity is 1000GB and the adjustment value is 35%, the target memory capacity is adjusted to 1350GB; if the current number of database connections is 1000 and the adjustment value is 20%, the target number of database connections is adjusted to 1200. Through this precise parameter adjustment calculation, the system generates a complete configuration plan that includes all target resource allocation parameters.
[0065] S304: Generate the second resource scheduling strategy according to the target resource allocation parameter.
[0066] Specifically, the system first integrates the target resource allocation parameters into a scheduling instruction set, including resource expansion and contraction instructions, load balancing instructions, and resource restriction instructions. For example, when the number of target server nodes is 125, the system generates corresponding node expansion instructions; when the target memory capacity is 1350GB, the system generates memory allocation instructions; when the number of target database connections is 1200, the system generates connection pool configuration instructions. Then, the system organizes these instructions according to execution priority and dependency relationships to form a complete execution sequence, and sets the trigger conditions and constraints for instruction execution, such as setting the execution time window for resource expansion and setting the trigger threshold for load balancing.
[0067] S104, obtaining activity information of the target platform, and predicting a second change trend of user request traffic within a second preset time period according to the activity information.
[0068] In this embodiment, in order to accurately grasp the traffic change characteristics caused by the activity, the system needs to obtain and analyze the activity information of the target platform to predict the change of user request traffic.
[0069] Specifically, the system first obtains activity information, including key elements such as activity type, activity time period, activity scope, participation conditions, and discount strength. Subsequently, the system analyzes the activity information and identifies key factors that may affect user request traffic.
[0070] For example, when it is detected that the target platform is about to launch a limited-time flash sale within the second preset time, the system will analyze the number of items in the event, the price discount, the range of participating users, and other characteristics, and combine the current number of online users and user activity to predict the possible surge in request traffic within the second preset time (such as 15 minutes) after the event starts, thereby deriving the second change trend. This traffic prediction method based on activity characteristics can capture sudden traffic changes caused by the event in a timely manner, allowing the system to make resource reserves in advance.
[0071] Based on the above embodiment, as an optional implementation, in S104, the activity information includes the activity type and the activity time period, and predicting the second change trend of the user request traffic within the second preset time period according to the activity information specifically includes S401-S403:
[0072] S401, according to the activity type, determining a basic flow change coefficient corresponding to the activity type.
[0073] In this embodiment, in order to accurately evaluate the impact of different types of activities on user request traffic, the system needs to determine the corresponding basic traffic change coefficient according to the activity type.
[0074] Specifically, the system first obtains activity type information from the target platform, such as flash sales, coupon distribution activities, and full-reduction promotion activities. Then, the system assigns corresponding basic traffic change coefficients according to the characteristics of each type of activity. For example, due to the characteristics of flash sales with concentrated time and high user participation, its basic traffic change coefficient is set to 2.5, indicating that the expected request volume will increase to 2.5 times the usual amount; the basic traffic change coefficient of coupon distribution activities is set to 1.8, and the basic traffic change coefficient of full-reduction promotion activities is set to 1.5. The setting of these basic traffic change coefficients is based on the statistical analysis of historical activity data, reflecting the typical traffic change levels caused by different types of activities. Through this method of determining coefficients based on activity types, the system can quickly make a preliminary estimate of the traffic changes that may be caused by the activities.
[0075] S402, calculating the flow change parameter within a second preset time period by combining the activity time period and the basic flow change coefficient.
[0076] In this embodiment, in order to accurately calculate the specific flow rate changes during the activity, the system needs to combine the activity time period with the basic flow rate change coefficient for analysis.
[0077] Specifically, the system first obtains the specific time period information of the activity, such as the start time and duration of the activity, and divides the activity time period into multiple time segments of the second preset duration (such as 15 minutes). Then, the system calculates the traffic change parameter for each time segment, taking into account the characteristics of the time period. For example, for a flash sale activity, the basic traffic change coefficient is 2.5, but in the first second preset duration after the activity starts, due to the concentrated rush of users to buy, the actual traffic change parameter will be adjusted to 3.5, and in subsequent time segments, the traffic change parameter will gradually decrease to 2.0.
[0078] The system dynamically adjusts the basic flow change coefficient through the time decay function to obtain the specific flow change parameters for each time segment. This parameter calculation method based on the time dimension can reflect the dynamic characteristics of flow changes during the activity.
[0079] S403: Determine a second change trend according to the flow change parameter.
[0080] In this embodiment, in order to accurately predict the flow rate trend during the activity, the system needs to determine the second change trend based on flow rate change parameter analysis.
[0081] Specifically, the system first obtains the flow change parameters within each second preset time length, such as the flow change parameter of the first time segment at the start of the activity is 3.5, the second time segment is 2.8, the third time segment is 2.0, etc. Then, the system arranges these parameters in chronological order and determines the direction and magnitude of the flow change by calculating the parameter change rate between adjacent time segments. For example, the change rate from the first to the second time segment is -20%, and the change rate from the second to the third time segment is -28%. The system combines the values and directions of these change rates to generate a complete second change trend, including the specific characteristics of the flow rising stage, peak duration stage, and decline stage. This trend analysis method based on flow change parameters can accurately describe the changing pattern of flow during the event.
[0082] S105: According to the second change trend, the second resource scheduling policy is adjusted to generate a target resource scheduling policy, and resource allocation of the target server cluster is adjusted according to the target resource scheduling policy.
[0083] In this embodiment, in order to achieve the best resource allocation effect, the system needs to incorporate the traffic change factor brought about by the activity into the resource scheduling decision-making process.
[0084] Specifically, the system first adjusts the second resource scheduling strategy according to the second change trend. When the second change trend shows that the number of requests will surge by 200% within the second preset time after the start of the activity, the system adjusts the resource configuration parameters in the second resource scheduling strategy accordingly, such as increasing the number of server nodes originally planned to be expanded to 3 times the original configuration, and adjusting the request distribution ratio to generate a more targeted target resource scheduling strategy. Subsequently, the system sends resource allocation instructions to the target server cluster through the resource scheduling execution module according to the target resource scheduling strategy, including specific operations such as starting new computing nodes, expanding cache capacity, and adjusting the size of the database connection pool. This resource scheduling solution based on multi-dimensional analysis can accurately respond to the load pressure brought by the activity and realize on-demand allocation and dynamic adjustment of resources.
[0085] Based on the above embodiment, as an optional implementation, in S105, adjusting the second resource scheduling strategy according to the second change trend, and generating the target resource scheduling strategy specifically includes S501-S504:
[0086] S501: Determine the resource demand within the second preset time period based on the second change trend.
[0087] S502: Calculate a revised value of a resource allocation parameter in a second resource scheduling strategy according to the resource demand.
[0088] S503: Adjust the resource allocation parameters in the second resource scheduling strategy according to the correction value to obtain final resource allocation parameters.
[0089] S504: Generate a target resource scheduling strategy according to the final resource allocation parameters.
[0090] In this embodiment, in order to incorporate the traffic change factors caused by the activity into the resource scheduling decision, the system needs to further optimize the second resource scheduling strategy. First, the system analyzes the specific resource demand situation within the second preset time period according to the second change trend. For example, when the second change trend shows that the request volume will increase to 3.5 times the usual when the activity starts, the system will calculate the specific resource demand in combination with the current benchmark resource configuration, such as the need to increase the server nodes to 175 and the memory capacity to 1890GB. Then, the system compares these resource demands with the resource allocation parameters planned in the second resource scheduling strategy (such as 125 server nodes and 1350GB memory capacity) to calculate the required correction values, that is, the number of server nodes needs to be increased by 50 and the memory capacity needs to be increased by 540GB. Then, the system applies these correction values to the resource allocation parameters of the second resource scheduling strategy to obtain the final resource configuration plan, including the final resource allocation parameters such as the number of server nodes adjusted to 175 and the memory capacity adjusted to 1890GB. Finally, based on these final resource allocation parameters, the system generates a target resource scheduling strategy that includes complete execution instructions and scheduling timing, ensuring that resources can be expanded before the event starts and reasonably recovered after the event ends. This multi-level strategy optimization method can comprehensively consider both regular fluctuations and event impacts to improve the accuracy of resource scheduling.
[0091] Based on the above embodiment, as an optional implementation, in S105, adjusting the resource allocation of the target server cluster according to the target resource scheduling policy specifically includes S601-S604:
[0092] S601: Obtain resource allocation parameters in a target resource scheduling strategy.
[0093] S602: Determine the target resource configuration amount of each server node in the target server cluster according to the resource allocation parameters in the target resource scheduling policy.
[0094] S603: Calculate the difference between the current resource configuration amount and the target resource configuration amount of each server node.
[0095] S604: Adjust the allocation of computing resources and storage resources of each server node according to the difference.
[0096] Specifically, the system first extracts resource allocation parameters from the target resource scheduling strategy, such as 175 server nodes, 1890GB total memory capacity, and 1500 database connections. Then, based on these overall parameters, combined with the roles (such as application servers, database servers) and performance characteristics of each server node, the system calculates the specific resource configuration amount that should be allocated to each node. For example, each application server node is allocated with 8-core CPU, 16GB memory, 100 database connections, and other target configurations. Next, the system obtains the current resource configuration of each node, compares it with the target configuration, and calculates the specific adjustment difference, such as a node needs to add 2 CPU cores, 4GB memory, 20 database connections, etc. Finally, based on the calculated difference, the system sends resource adjustment instructions to each node through the resource management component (such as the container orchestration platform, virtualization management system) to complete the reallocation of resources such as the number of CPU cores, memory capacity, and storage space.
[0097] Obtain the actual resource usage of the target server cluster and the preset resource usage of the target server after adjusting the resource allocation of the target server cluster; calculate the deviation value between the actual resource usage and the preset resource usage; when the deviation value exceeds the preset threshold, adjust the target resource scheduling policy according to the deviation value; reallocate the resources of the target server cluster according to the adjusted target resource scheduling policy.
[0098] In this embodiment, in order to verify the actual effect of the resource scheduling strategy and optimize and adjust it in time, the system needs to monitor and analyze the resource usage of the target server cluster in real time. Specifically, the system continuously collects resource usage data of each node in the target server cluster through the monitoring component, including actual resource usage indicators such as CPU usage, memory usage, and storage space usage, and obtains the resource usage expected according to the target resource scheduling strategy, that is, the preset resource usage. The system compares and analyzes these two sets of data and calculates the deviation value between the actual usage and the preset usage. For example, when the actual CPU usage is 15% lower than expected, or the actual memory usage is 20% higher than expected, the system will record these deviations. When it is found that the deviation value of a resource exceeds the preset threshold (such as the deviation rate exceeds ±10%), the system will adjust the target resource scheduling strategy accordingly according to the direction and size of the deviation. For example, when the actual CPU usage continues to be lower than expected, the system will appropriately reduce the allocation of the number of CPU cores; when the actual memory usage continues to be higher than expected, the system will increase the allocation of memory capacity accordingly. After the strategy adjustment is completed, the system will immediately execute the new resource allocation operation to ensure that the resource configuration is more in line with the actual demand. This dynamic optimization method based on actual results can continuously improve the resource scheduling strategy.
[0099] Based on the above method, the present application also discloses a dynamic computing resource scheduling system, such as Figure 2 As shown, Figure 2 It is a structural schematic diagram of a dynamic computing resource scheduling system provided by an embodiment of the present application, and the system includes: an acquisition module, a generation module, a first adjustment module, a prediction module and a second adjustment module; wherein the acquisition module is used to acquire user access behavior data of a target platform within a first preset time period; the generation module is used to predict a first change trend of user request traffic within a second preset time period based on the user access behavior data, and generate a first resource scheduling strategy based on the first change trend, and the first preset time period is before the second preset time period; the first adjustment module is used to acquire historical user access behavior data of the target platform, and adjust the first resource scheduling strategy based on the historical user access behavior data to generate a second resource scheduling strategy; the prediction module is used to acquire activity information of the target platform, and predict a second change trend of user request traffic within the second preset time period based on the activity information; the second adjustment module adjusts the second resource scheduling strategy based on the second change trend, generates a target resource scheduling strategy, and adjusts the resource allocation of the target server cluster according to the target resource scheduling strategy.
[0100] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0101] See also Figure 3 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 3 As shown, the electronic device 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .
[0102] The communication bus 1002 is used to realize the connection and communication between these components.
[0103] The user interface 1003 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.
[0104] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0105] Among them, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1001 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1001, and it can be implemented separately through a chip.
[0106] Among them, the memory 1005 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Figure 3 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program of a dynamic computing resource scheduling method.
[0107] exist Figure 3In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 1001 can be used to call an application program storing a dynamic computing resource scheduling method in the memory 1005. When executed by one or more processors, the electronic device executes one or more methods described in the above embodiments.
[0108] An electronic device readable storage medium stores instructions, which, when executed by one or more processors, enable the electronic device to execute one or more of the methods described in the above embodiments.
[0109] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0110] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0111] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0112] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0113] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0114] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, 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, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0115] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A dynamic computing resource scheduling method, characterized in that: The method includes: obtaining user access behavior data of a target platform within a first preset time period; Predicting, based on the user access behavior data, a first change trend of user request traffic within a second preset duration, and generating a first resource scheduling strategy based on the first change trend, wherein the first preset duration is before the second preset duration; Acquire historical user access behavior data of the target platform, and adjust the first resource scheduling strategy according to the historical user access behavior data to generate a second resource scheduling strategy; Acquire activity information of the target platform, and predict a second change trend of the user request traffic within the second preset duration according to the activity information; the activity information includes an activity type and an activity time period, and predicting the second change trend of the user request traffic within the second preset duration according to the activity information includes: determining a basic traffic change coefficient corresponding to the activity type according to the activity type; calculating a traffic change parameter within the second preset duration in combination with the activity time period and the basic traffic change coefficient; and determining the second change trend according to the traffic change parameter; According to the second change trend, the second resource scheduling policy is adjusted to generate a target resource scheduling policy, and resource allocation of the target server cluster is adjusted according to the target resource scheduling policy.
2. The dynamic computing resource scheduling method according to claim 1, characterized in that: The method of predicting a first change trend of user request traffic within a second preset time period based on the user access behavior data includes: obtaining request volume data and request time data in the user access behavior data; calculating the request volume per unit time within the first preset time period based on the request volume data and the request time data; calculating a trend coefficient of the request volume changing with time based on the request volume per unit time; and determining the first change trend based on the trend coefficient.
3. The dynamic computing resource scheduling method according to claim 1, characterized in that: The method of adjusting the first resource scheduling strategy based on the historical user access behavior data to generate the second resource scheduling strategy includes: predicting a third change trend of the user request traffic within the second preset time period based on the historical user access behavior data; calculating an adjustment value of a resource allocation parameter in the first resource scheduling strategy based on the third change trend; adjusting the resource allocation parameter based on the adjustment value to obtain a target resource allocation parameter; and generating the second resource scheduling strategy based on the target resource allocation parameter.
4. The dynamic computing resource scheduling method according to claim 1, characterized in that: The method of adjusting the second resource scheduling strategy according to the second change trend to generate a target resource scheduling strategy includes: determining the resource demand within the second preset time period based on the second change trend; calculating a correction value of a resource allocation parameter in the second resource scheduling strategy according to the resource demand; adjusting the resource allocation parameter in the second resource scheduling strategy according to the correction value to obtain a final resource allocation parameter; and generating the target resource scheduling strategy according to the final resource allocation parameter.
5. The dynamic computing resource scheduling method according to claim 1, characterized in that: The method of adjusting the resource allocation of the target server cluster according to the target resource scheduling policy includes: obtaining the resource allocation parameters in the target resource scheduling policy; determining the target resource configuration amount of each server node in the target server cluster according to the resource allocation parameters in the target resource scheduling policy; calculating the difference between the current resource configuration amount of each server node and the target resource configuration amount; and adjusting the allocation of computing resources and storage resources of each server node according to the difference.
6. The dynamic computing resource scheduling method according to claim 1, characterized in that: After adjusting the resource allocation of the target server cluster according to the target resource scheduling policy, it also includes: obtaining the actual resource usage of the target server cluster and the preset resource usage of the target server after adjusting the resource allocation of the target server cluster; calculating the deviation value between the actual resource usage and the preset resource usage; when the deviation value exceeds a preset threshold, adjusting the target resource scheduling policy according to the deviation value; and reallocating the resources of the target server cluster according to the adjusted target resource scheduling policy.
7. A dynamic computing resource scheduling system, characterized in that: The system includes: an acquisition module, a generation module, a first adjustment module, a prediction module and a second adjustment module; wherein the acquisition module is used to acquire user access behavior data of a target platform within a first preset time period; the generation module is used to predict a first change trend of user request traffic within a second preset time period based on the user access behavior data, and generate a first resource scheduling strategy based on the first change trend, wherein the first preset time period is before the second preset time period; the first adjustment module is used to acquire historical user access behavior data of the target platform, adjust the first resource scheduling strategy based on the historical user access behavior data, and generate a second resource scheduling strategy; the prediction module is used to acquire activity information of the target platform, and adjust the first resource scheduling strategy based on the Activity information, predicting the second change trend of the user request traffic within the second preset time period; the activity information includes an activity type and an activity time period, and the predicting the second change trend of the user request traffic within the second preset time period based on the activity information includes: determining a basic traffic change coefficient corresponding to the activity type based on the activity type; calculating a traffic change parameter within the second preset time period in combination with the activity time period and the basic traffic change coefficient; determining the second change trend based on the traffic change parameter; the second adjustment module adjusts the second resource scheduling strategy based on the second change trend, generates a target resource scheduling strategy, and adjusts the resource allocation of the target server cluster based on the target resource scheduling strategy.
8. An electronic device, characterized in that: It includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Cloud service resource dynamic prediction management method
CN117076882A
Cloud platform system flow dynamic balance processing method and device
CN118694803A