Resource Scheduling Method, Device and Computer Equipment for Power Range Simulation System
By training the resource demand prediction model in the power range simulation system and combining the dynamic scheduling mechanism, the accuracy problem of traditional resource scheduling methods in the face of dynamic load changes is solved, and efficient resource allocation and stable system operation are achieved.
Patent Information
- Application Number
- CN202510226989.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-02-27
AI Technical Summary
The resource scheduling method of traditional power range simulation systems is difficult to cope with dynamic load changes and multi-task concurrency, resulting in poor resource scheduling accuracy, affecting the operating efficiency and stability of the simulation system.
By obtaining historical running data, training the target resource demand prediction model, combining the current running data to generate a resource pre-scheduling scheme, and switching to the resource dynamic scheduling scheme under the monitoring of the preset threshold, realizing on-demand, priority allocation and flexible adjustment of resources.
The resource scheduling accuracy and real-time response capabilities of the power range simulation system are improved, ensuring that tasks are completed on time, reducing resource waste and delays, and improving system stability and efficiency.
Smart Images

Figure CN119759544B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of resource scheduling, and particularly to a resource scheduling method, device, computer device, computer-readable storage medium, and computer program product for a power test range simulation system. Background Art
[0002] As an important tool for power system testing and optimization, the power test range simulation system is widely used in power grid scheduling optimization, equipment performance verification, and fault response simulation.
[0003] With the increasing complexity of simulation tasks, the competition of multi-task resources in the system becomes increasingly significant. However, traditional resource scheduling methods rely on preset rules or fixed resource allocation patterns and are difficult to cope with the challenges brought by dynamic load changes and multi-task concurrency. Especially during the simulation process, the resource requirements of different tasks have multi-dimensional differences, resulting in poor accuracy of resource scheduling, thereby reducing the operation efficiency and stability of the simulation system. Summary of the Invention
[0004] Based on this, it is necessary to provide a resource scheduling method, device, computer device, computer-readable storage medium, and computer program product for a power test range simulation system that can improve the accuracy of resource scheduling for the power test range simulation system in view of the above technical problems.
[0005] In a first aspect, the present application provides a resource scheduling method for a power test range simulation system, including:
[0006] Obtain historical operation data of the power test range simulation system, and use the historical operation data to train a target resource demand prediction model; the target resource demand prediction model is used to represent the mapping relationship between operation data and resource demand prediction information;
[0007] When a preset prediction condition is triggered, input the current operation data of the power test range simulation system into the target resource demand prediction model to obtain resource demand prediction information of the power test range simulation system;
[0008] Generate a resource pre-scheduling plan for the system operation tasks of the power test range simulation system according to the resource demand prediction information and the current operation data, and execute the resource pre-scheduling plan;
[0009] During the execution of the resource pre-scheduling plan, when it is monitored that the current operation data of the power test range simulation system meets the preset threshold condition, generate a resource dynamic scheduling plan, stop executing the resource pre-scheduling plan, and execute the resource dynamic scheduling plan.
[0010] In one embodiment, inputting the current operation data of the power range simulation system into the target resource demand prediction model to obtain the resource demand prediction information of the power range simulation system includes:
[0011] Input the current operation data of the power range simulation system into the target resource demand prediction model, and output the model prediction information;
[0012] Obtain the residual information corresponding to the previous resource demand prediction, and determine the resource demand prediction information of the power range simulation system according to the model prediction information and the residual information.
[0013] In one embodiment, generating a resource pre-scheduling plan for the electrical system operation tasks of the power range simulation system according to the resource demand prediction information and the current operation data includes:
[0014] Obtain the task priorities of the system operation tasks of the power range simulation system;
[0015] Generate a resource pre-scheduling plan for the system operation tasks of the power range simulation system according to the resource demand prediction information, the current operation data, and the task priorities.
[0016] In one embodiment, generating a resource pre-scheduling plan for the system operation tasks of the power range simulation system according to the resource demand prediction information, the current operation data, and the task priorities includes:
[0017] For high-priority system operation tasks, determine the resources allocated to the high-priority system operation tasks according to the current resource demand information of the high-priority system operation tasks and a first preset ratio;
[0018] For medium-priority system operation tasks, determine the resources allocated to the medium-priority system operation tasks according to the current resource demand information of the medium-priority system operation tasks and a second preset ratio;
[0019] For low-priority system operation tasks, determine the resources allocated to the low-priority system operation tasks according to the current resource demand information of the low-priority system operation tasks, or suspend the operation of the low-priority system operation tasks;
[0020] Wherein, the first preset ratio is greater than the second preset ratio.
[0021] In one embodiment, generating a resource dynamic scheduling plan includes:
[0022] When the current operation data of the power range simulation system is greater than a first preset threshold, reduce the resources allocated to the system operation tasks with low priority and medium priority, or suspend the operation of the system operation tasks with low priority;
[0023] When the current operation data of the power range simulation system is less than a second preset threshold, resume the operation of the suspended system operation tasks with low priority, or increase the resources allocated to the system operation tasks with high priority and the system operation tasks with medium priority;
[0024] Wherein, the first preset threshold is greater than the second preset threshold.
[0025] In one embodiment, the training of the target resource demand prediction model using the historical operation data includes:
[0026] Obtain an initial resource demand prediction model and obtain the value range of the hyperparameters in the initial resource demand prediction model;
[0027] According to the historical operation data and the initial resource demand prediction model, determine the target hyperparameters within the value range of the hyperparameters;
[0028] Train a target resource demand prediction model according to the historical operation data, the initial resource demand prediction model and the target hyperparameters.
[0029] In one embodiment, the training of the target resource demand prediction model using the historical operation data includes:
[0030] Preprocess the historical operation data to obtain preprocessed historical operation data;
[0031] Determine statistical feature data and time series feature data according to the preprocessed historical operation data;
[0032] Train a target resource demand prediction model according to the statistical feature data and the time series feature data.
[0033] In a second aspect, the present application also provides a resource scheduling device for a power range simulation system, including:
[0034] A model training module, configured to obtain the historical operation data of the power range simulation system and train a target resource demand prediction model using the historical operation data; the target resource demand prediction model is used to represent the mapping relationship between the operation data and the resource demand prediction information;
[0035] A demand prediction module, configured to input the current operation data of the power range simulation system into the target resource demand prediction model when a preset prediction condition is triggered, so as to obtain the resource demand prediction information of the power range simulation system;
[0036] A pre-scheduling module, configured to generate a pre-scheduling plan for the resources of the system operation tasks of the power range simulation system according to the resource demand prediction information and the current operation data, and execute the pre-scheduling plan for the resources;
[0037] A dynamic scheduling module, configured to generate a dynamic resource scheduling plan and stop executing the pre-scheduling plan for the resources and execute the dynamic resource scheduling plan when, during the execution of the pre-scheduling plan for the resources, it is monitored that the current operation data of the power range simulation system meets the preset threshold condition.
[0038] In a third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0039] Obtain the historical operation data of the power range simulation system, and use the historical operation data to train a target resource demand prediction model; the target resource demand prediction model is used to represent the mapping relationship between the operation data and the resource demand prediction information;
[0040] When a preset prediction condition is triggered, input the current operation data of the power range simulation system into the target resource demand prediction model to obtain the resource demand prediction information of the power range simulation system;
[0041] Generate a pre-scheduling plan for the resources of the system operation tasks of the power range simulation system according to the resource demand prediction information and the current operation data, and execute the pre-scheduling plan for the resources;
[0042] When, during the execution of the pre-scheduling plan for the resources, it is monitored that the current operation data of the power range simulation system meets the preset threshold condition, generate a dynamic resource scheduling plan, stop executing the pre-scheduling plan for the resources, and execute the dynamic resource scheduling plan.
[0043] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0044] Obtain the historical operation data of the power range simulation system, and use the historical operation data to train a target resource demand prediction model; the target resource demand prediction model is used to represent the mapping relationship between the operation data and the resource demand prediction information;
[0045] When a preset prediction condition is triggered, input the current operation data of the power range simulation system into the target resource demand prediction model to obtain the resource demand prediction information of the power range simulation system;
[0046] Generate a resource pre-scheduling plan for the system operation tasks of the power range simulation system according to the resource demand prediction information and the current operation data, and execute the resource pre-scheduling plan;
[0047] During the execution of the resource pre-scheduling plan, when it is monitored that the current operation data of the power range simulation system meets the preset threshold condition, generate a resource dynamic scheduling plan, stop executing the resource pre-scheduling plan, and execute the resource dynamic scheduling plan.
[0048] In a fifth aspect, the present application also provides a computer program product, including a computer program, which when executed by a processor implements the following steps:
[0049] Obtain the historical operation data of the power range simulation system, and use the historical operation data to train a target resource demand prediction model; the target resource demand prediction model is used to represent the mapping relationship between the operation data and the resource demand prediction information;
[0050] When a preset prediction condition is triggered, input the current operation data of the power range simulation system into the target resource demand prediction model to obtain the resource demand prediction information of the power range simulation system;
[0051] Generate a resource pre-scheduling plan for the system operation tasks of the power range simulation system according to the resource demand prediction information and the current operation data, and execute the resource pre-scheduling plan;
[0052] During the execution of the resource pre-scheduling plan, when it is monitored that the current operation data of the power range simulation system meets the preset threshold condition, generate a resource dynamic scheduling plan, stop executing the resource pre-scheduling plan, and execute the resource dynamic scheduling plan.
[0053] The above-mentioned resource scheduling method, device, computer equipment, computer-readable storage medium and computer program product of the power range simulation system. First, obtain the historical operation data of the power range simulation system, and use the historical operation data to train a target resource demand prediction model. The target resource demand prediction model is used to represent the mapping relationship between the operation data and the resource demand prediction information. Through the accumulation and analysis of historical data, the prediction model can capture the resource demand law and change trend of the system, provide accurate input data, reduce the scheduling problems caused by inaccurate resource demand prediction, provide data support for subsequent resource demand prediction, and enhance the accuracy of system prediction. Then, when a preset prediction condition is triggered, input the current operation data of the power range simulation system into the target resource demand prediction model to obtain the resource demand prediction information of the power range simulation system. By combining the current operation data with the target resource demand prediction model, the resource demand can be predicted in real time and dynamically, the situation of resource shortage or surplus can be found in time, the resource scheduling preparation can be made in advance, the phenomenon of resource overload or idleness can be reduced, and the accuracy of resource allocation can be improved. Then, according to the resource demand prediction information and the current operation data, generate a resource pre-scheduling plan for the system operation tasks of the power range simulation system, and execute the resource pre-scheduling plan. The resource pre-scheduling plan generated according to the resource demand prediction information and the current resource usage situation can ensure that the resource allocation is planned in advance during the system operation, so that each task can obtain sufficient resources on time and as needed, the optimal allocation of resources can be achieved, resource waste or task delay can be avoided, and thus the operation efficiency of the system can be improved. Finally, during the execution of the resource pre-scheduling plan, when it is monitored that the current operation data of the power range simulation system meets the preset threshold condition, generate a resource dynamic scheduling plan, stop executing the resource pre-scheduling plan, and execute the resource dynamic scheduling plan. The generation and execution of the dynamic scheduling plan can respond to the changes in resource demand in real time. Especially when the load changes, the resource allocation can be flexibly adjusted, the demand changes can be responded to in time, resource overload or shortage can be avoided, and the operation efficiency and stability of the whole system can be improved. In the above method, by comprehensively applying historical data prediction, real-time resource monitoring and dynamic scheduling mechanism, the resource scheduling accuracy and real-time response ability of the power range simulation system are effectively improved. By generating a resource pre-scheduling plan in advance, it is ensured that resources can be reasonably allocated according to demand and priority, thus avoiding resource waste and improving resource utilization rate. The real-time dynamic scheduling mechanism ensures that when the system faces load fluctuations or sudden tasks, it can flexibly adjust the resource configuration, ensure that tasks are completed on time, reduce delays and failures, and improve the stability and efficiency of the power range simulation system. Brief Description of the Drawings
[0054] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the accompanying drawings required for the description of the embodiments of the present application or related technologies. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0055] Figure 1 It is a schematic flowchart of the resource scheduling method for the power range simulation system in an embodiment;
[0056] Figure 2 It is a schematic flowchart of the steps for generating a resource pre-scheduling plan in an embodiment;
[0057] Figure 3 It is a schematic flowchart of the resource scheduling method for the power range simulation system in another embodiment;
[0058] Figure 4 It is a structural block diagram of the resource scheduling device for the power range simulation system in an embodiment;
[0059] Figure 5 It is an internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0060] In order to make the purpose, technical solutions and advantages of the present application clearer, the following further details the present application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] In the crucial field of the security and efficiency management of power networks, virtualization technology has become one of the indispensable key technologies. This technology provides strong support for various network security tests, attack and defense simulations, and evaluations by simulating physical computing, network, and storage resources. However, although virtualization technology has shown great potential in power network management, the existing technologies still face many challenges in practical applications. The most prominent problem among them is the flexibility of resource scheduling and the limitations of system scalability.
[0062] Existing virtualization technologies often appear rigid in resource scheduling, lacking sufficient flexibility and being difficult to make rapid and effective adjustments according to real-time requirements. This rigid resource scheduling mode not only limits the effectiveness of virtualization technology in dealing with complex and ever-changing network security requirements but also makes the system appear inadequate in simulating and defending against emerging threats. With the increasing complexity of the power network environment and the continuous evolution of network security threats, the resource scheduling problems exposed by existing virtualization technologies have become increasingly prominent, becoming one of the key factors restricting their further development and application.
[0063] The limitation of system scalability is also a major problem that existing virtualization technologies urgently need to solve. With the continuous expansion of the scale of the power grid and the increasing growth of network security requirements, virtualization technologies need to be able to support larger-scale and higher-density virtualization environments. However, existing virtualization technologies have obvious shortcomings in terms of system scalability and are difficult to meet this requirement. This not only limits the application scope of virtualization technologies in power grid management, but also may cause the system to process slowly when facing a large number of resource demands and unable to provide real-time feedback results, thus bringing great potential risks to the security and efficiency management of the power target system.
[0064] Although existing virtualization technologies have achieved certain results in the field of power target simulation, they still face prominent problems such as inflexible resource scheduling and limited system scalability. These problems not only restrict the further development and application of virtualization technologies, but also bring many challenges to the power target simulation system. Therefore, it is necessary to adopt a more efficient and flexible virtualization technology solution to cope with the increasingly complex and changeable power grid environment and network security threats.
[0065] In one embodiment, as Figure 1 shown, a resource scheduling method for a power range simulation system is provided. In this embodiment, taking the application of this method to a terminal as an example, it can be understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, etc. The server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. In this embodiment, the method includes the following steps:
[0066] Step S101, obtain the historical operation data of the power range simulation system, and use the historical operation data to train a target resource demand prediction model.
[0067] Among them, the historical operation data refers to the recorded information related to resource usage, task load, system performance, etc. generated during the operation of the power range simulation system, including but not limited to task execution time, resource consumption (such as CPU, memory, bandwidth, etc.), task type and workload, timestamp, etc. These data can reflect the laws and changing trends of system resource demands.
[0068] Among them, the target resource demand prediction model is used to represent the mapping relationship between the operation data and the resource demand prediction information.
[0069] Exemplarily, the terminal first obtains the task-level resource usage records and global resource load data from the system, and organizes these data in the order of task time. To ensure data quality, the terminal performs the following operations on the obtained historical operation data: Missing value handling: The missing items in the data are supplemented using mean filling, interpolation method, or nearest neighbor algorithm. Outlier detection and removal: Statistical methods (such as the 3σ principle) or machine learning algorithms are used to detect and remove abnormal data to avoid the adverse effects of outliers on the training of the prediction model. Data standardization: The value ranges of different resource metrics (such as CPU usage rate, memory occupancy rate, etc.) are normalized so that the model can process data of different scales more efficiently.
[0070] After completing the data preprocessing, the terminal extracts the feature information related to resource requirements based on the preprocessed historical operation data. Feature extraction includes the following steps: Extract statistical features, such as mean, maximum, minimum, standard deviation, etc., to reflect the basic laws of resource usage; Extract time series features, such as periodicity and trend, and capture the temporal characteristics of resource requirements through methods such as sliding window and time difference; Extract task features, including task type, priority, and life cycle features (such as task start time, duration, etc.).
[0071] Finally, the terminal inputs the extracted feature data into machine learning algorithms. For example, models such as linear regression, neural network, or gradient boosting decision tree can be used to train the historical operation data, thereby obtaining the target resource requirement prediction model. The training process evaluates and optimizes the performance of the model through cross-validation methods to determine the optimal model and its parameter configuration.
[0072] Step S102, when a preset prediction condition is triggered, the current operation data of the power range simulation system is input into the target resource requirement prediction model to obtain the resource requirement prediction information of the power range simulation system.
[0073] Among them, the preset prediction condition refers to the rules or states used to trigger the resource requirement prediction operation. For example, it can include but is not limited to the following conditions: The current resource usage rate is close to the system threshold (such as above 80%), a high-priority task in the system starts, the periodic scheduling moment (such as every day or every hour) arrives, etc. The preset prediction condition ensures that the system performs the prediction operation at an appropriate time to avoid untimely or frequent triggering of resource allocation.
[0074] Exemplarily, when the preset prediction condition is satisfied, the terminal starts to execute the resource demand prediction process. The terminal collects the current operation data of the power range simulation system in real time, including information such as CPU usage rate, memory occupancy rate, timestamp, task type, and task workload, and preprocesses the data to ensure the accuracy of the input data. For example: standardize the data format: convert the real-time collected resource data into a format consistent with the input of the prediction model; clean invalid data: remove null or duplicate data to ensure the reliability of the prediction results. The terminal uses the current operation data as input variables and loads the target resource demand prediction model. The prediction model calculates the resource demand of the system in a specific future time period based on the rules obtained in the training phase (such as the statistical characteristics and time series characteristics of historical data), combined with the current input data. For example: predict the CPU and memory requirements of high-priority tasks in the next 10 minutes; predict the resource release time of the system after the high-load task ends. The target resource demand prediction model outputs the prediction results, and the terminal organizes them into resource demand prediction information, which may include: the total resource demand of each priority task (such as high-priority tasks requiring 80% of the CPU and 50% of the memory); the overall resource usage trend of the system (such as the average CPU utilization rate will reach 90% within the next hour); possible resource shortage alarms (such as predicting that a certain task will experience performance degradation due to insufficient resources in the next 30 minutes).
[0075] Step S103, generate a resource pre-scheduling plan for the system operation tasks of the power range simulation system according to the resource demand prediction information and the current operation data, and execute the resource pre-scheduling plan.
[0076] Among them, the current operation data refers to the system usage conditions monitored by the system in real time, such as CPU occupancy rate, memory usage rate, timestamp, task type, and task workload.
[0077] Exemplarily, after the terminal obtains the resource demand prediction information and the current operation data, based on the scheduling rules of the system, the terminal formulates the basic principles of resource allocation by combining the task priorities corresponding to the task types, the resource demand prediction information, and the current operation data. Specifically, it includes: high-priority tasks are allocated resources first to ensure that 100% of their resource requirements are met; medium-priority tasks are allocated resources proportionally to meet the requirements on the premise that the tasks can be executed; low-priority tasks use the remaining resources of the system. If the resources are insufficient, the execution of low-priority tasks may be delayed or suspended. The content of the scheduling plan includes the resource allocation of each task within a specific future time period. For example: high-priority task A: allocate 60% of the CPU and 40% of the memory; medium-priority task B: allocate 30% of the CPU and 20% of the memory; low-priority task C: allocate 10% of the CPU, and the task can be started late. The terminal adjusts the resource allocation of the power range simulation system according to the generated pre-scheduling plan. For example: adjust the execution order of tasks, start high-priority tasks first; dynamically adjust the resource allocation ratio of running tasks to ensure that high-priority tasks can obtain more resources; in necessary cases, suspend low-priority tasks to release resources for more important tasks. In addition, during the execution of the pre-scheduling plan for resources, the terminal monitors the execution effect of the scheduling plan in real time and records the actual resource usage of tasks. If it is found that the resource allocation is unbalanced or the resource requirements of a certain task suddenly increase, the terminal will adjust the plan according to the feedback information.
[0078] Step S104, during the execution of the pre-scheduling plan for resources, and when it is monitored that the current operation data of the power range simulation system meets the preset threshold conditions, generate a dynamic resource scheduling plan, stop executing the pre-scheduling plan for resources, and execute the dynamic resource scheduling plan.
[0079] Among them, the preset threshold condition refers to the condition standard used to judge whether it is necessary to trigger dynamic resource scheduling, usually including the upper threshold of resource utilization rate (such as the CPU utilization rate exceeds 90%), the lower threshold of resource utilization rate (such as the overall resource utilization rate of the system is lower than 50%), the mutation of task priority (such as the addition of high-priority tasks), etc.
[0080] Exemplarily, when the terminal executes the resource pre-scheduling scheme, it monitors the current resource usage of the power range simulation system in real time, including the overall system resource utilization rate (such as CPU, memory, network bandwidth, etc.), the real-time resource consumption and execution status of each task, and whether there are new tasks in the task queue or changes in task priorities. When the terminal detects that the current running data meets the preset threshold conditions, for example, the CPU utilization rate exceeds 90% or a new high-priority task is added, the terminal triggers the dynamic scheduling mechanism and generates a resource dynamic scheduling scheme according to the current resource status. During the process of generating the dynamic scheduling scheme, the terminal first reallocates resources according to the resource usage status and task priorities. For high-priority tasks, the terminal gives priority to meeting the needs of high-priority tasks by reducing the resource allocation of low-priority tasks or even suspending their operation; for the situation where the resource utilization rate is too low, the terminal may resume the operation of low-priority tasks and merge tasks to allocate resources to optimize the overall usage efficiency; when there are sudden tasks in the system, the terminal meets the emergency needs by preempting the resources of low-priority tasks or dynamically expanding the resource pool. Subsequently, the terminal stops executing the resource pre-scheduling scheme, executes the resource dynamic scheduling scheme, and adjusts the task resource allocation, such as increasing the number of CPU cores or memory allocation for high-priority tasks, suspending some low-priority tasks, or restarting the suspended tasks to make full use of idle resources. While the scheme is being executed, the terminal continuously monitors the scheduling effect, records the task execution situation and the resource change trend for further optimizing the scheduling strategy.
[0081] In the above resource scheduling method for the power range simulation system, first, historical operation data of the power range simulation system is obtained, and a target resource demand prediction model is trained using the historical operation data. The target resource demand prediction model is used to represent the mapping relationship between operation data and resource demand prediction information. Through the accumulation and analysis of historical data, the prediction model can capture the resource demand patterns and changing trends of the system, provide accurate input data, reduce scheduling problems caused by inaccurate resource demand prediction, provide data support for subsequent resource demand prediction, and enhance the accuracy of system prediction. Next, when a preset prediction condition is triggered, the current operation data of the power range simulation system is input into the target resource demand prediction model to obtain the resource demand prediction information of the power range simulation system. By combining the current operation data with the target resource demand prediction model, resource demand prediction can be performed in real time and dynamically, resource shortages or surpluses can be detected in a timely manner, resource scheduling preparations can be made in advance, resource overload or idle phenomena can be reduced, and the accuracy of resource allocation can be improved. Then, according to the resource demand prediction information and the current operation data, a resource pre-scheduling plan for the system operation tasks of the power range simulation system is generated, and the resource pre-scheduling plan is executed. The resource pre-scheduling plan generated based on the resource demand prediction information and the current resource usage situation can ensure that resource allocation is planned in advance during system operation, enabling each task to obtain sufficient resources on time and as needed, achieving the optimal allocation of resources, avoiding resource waste or task delays, and thus improving the operation efficiency of the system. Finally, during the execution of the resource pre-scheduling plan, when it is monitored that the current operation data of the power range simulation system meets the preset threshold conditions, a resource dynamic scheduling plan is generated, the execution of the resource pre-scheduling plan is stopped, and the resource dynamic scheduling plan is executed. The generation and execution of the dynamic scheduling plan can respond to changes in resource demand in real time. Especially when the load changes, it can flexibly adjust resource allocation, respond to demand changes in a timely manner, avoid resource overload or shortage, and improve the operation efficiency and stability of the entire system. In the above method, by comprehensively applying historical data prediction, real-time resource monitoring, and dynamic scheduling mechanisms, the resource scheduling accuracy and real-time response ability of the power range simulation system are effectively improved. By generating a resource pre-scheduling plan in advance, it is ensured that resources can be reasonably allocated according to demand and priority, thereby avoiding resource waste and improving resource utilization. The real-time dynamic scheduling mechanism ensures that when the system faces load fluctuations or sudden tasks, it can flexibly adjust resource allocation, ensure tasks are completed on time, reduce delays and failures, and enhance the stability and efficiency of the power range simulation system.
[0082] In an exemplary embodiment, step S102 above inputs the current operation data of the power range simulation system into the target resource demand prediction model to obtain the resource demand prediction information of the power range simulation system, and further includes: inputting the current operation data of the power range simulation system into the target resource demand prediction model, and outputting model prediction information; obtaining the residual information corresponding to the previous resource demand prediction, and determining the resource demand prediction information of the power range simulation system according to the model prediction information and the residual information.
[0083] Exemplarily, the terminal first collects the current operation data of the power range simulation system through the real-time monitoring module. This data includes the CPU usage rate, memory occupancy, network bandwidth usage rate of the current task, as well as the types and real-time load conditions of each task. The terminal preprocesses this data, such as removing outliers, filling in missing data, and normalizing it before inputting it into the target resource demand prediction model. The target resource demand prediction model outputs model prediction information based on the input current operation data and historical training results. This prediction information includes the resource demand trend in a specific future time period, for example, the CPU usage rate will gradually increase to 90% within the next 10 minutes, or the memory requirements of some tasks will increase significantly. The terminal uses this prediction information as the basic data and further adjusts it in combination with the residual information corresponding to the previous resource demand prediction. When obtaining the residual information, the terminal reads the error data (i.e., the residual) between the previous resource demand prediction and the actual resource usage from the system storage module. This residual information reflects the deviation trend of the target resource demand prediction model in past predictions. For example, if the model systematically underestimated the CPU demand in the previous prediction, the current prediction result needs to be adjusted upward accordingly. Subsequently, the terminal combines the model prediction information and the residual information and uses a weighted correction method to determine the final resource demand prediction information. Exemplarily, this process can be carried out according to the following formula: Final resource demand prediction value = α * Model prediction value + β * Residual. Where α and β are weight parameters used to balance the influence of the model prediction value and the residual information. The weight parameters can be dynamically adjusted according to the system historical data. For example, when the residual is small, the weight of the model prediction value is increased; when the residual is large, the correction effect of the residual information is strengthened.
[0084] In this embodiment, by combining the current operation data, model prediction information, and residual information, the accuracy of resource demand prediction can be effectively improved. In particular, using the residual information to correct the model prediction makes up for the possible deviation problems of the model in specific scenarios and makes the prediction result more in line with the actual situation. This prediction method of multi-source information fusion lays a solid foundation for the optimization of the resource scheduling scheme and significantly improves the efficiency and reliability of system resource management.
[0085] In an exemplary embodiment, as Figure 2As shown in the figure, the above-mentioned step S103 generates a resource pre-scheduling plan for the electrical system operation tasks of the power range simulation system according to the resource demand prediction information and the current operation data, and can also be implemented through the following steps:
[0086] Step S201, obtain the task priority of the system operation tasks of the power range simulation system;
[0087] Step S202, generate a resource pre-scheduling plan for the system operation tasks of the power range simulation system according to the resource demand prediction information, the current operation data and the task priority.
[0088] Exemplarily, the terminal first extracts the task list of the system operation tasks from the power range simulation system and obtains the task priority of each task. The task priority is determined according to the rules preset in the system and is usually divided into high priority, medium priority and low priority. The setting of the priority is based on the importance, urgency or resource demand of the task. For example, high-priority tasks may represent key business scenarios, while low-priority tasks are usually auxiliary tasks. After obtaining the task priority, the terminal combines the resource demand prediction information and the current operation data to generate a resource allocation plan for the tasks. When allocating resources, the terminal gives priority to high-priority tasks to ensure that their resource requirements are fully met. If the prediction shows that the resource requirements of high-priority tasks will increase in the future, the terminal will dynamically adjust the system resource allocation strategy, such as allocating resources from medium-priority or low-priority tasks, or releasing resources in advance to high-priority tasks. For medium-priority tasks, the terminal allocates sufficient resources according to the resource load of the system to ensure normal operation while avoiding resource waste. The resource allocation of low-priority tasks is based on the remaining system resources and may be postponed or suspended when resources are scarce.
[0089] In this embodiment, by obtaining the task priority of the power range simulation system and combining the resource demand prediction information and the current operation data, a resource pre-scheduling plan is generated, ensuring that the resource allocation of the system operation tasks is more reasonable. The introduction of the priority mechanism enables high-priority tasks to be fully guaranteed when resources are scarce, thus avoiding the delay of key tasks due to insufficient resources. At the same time, the resource allocation of medium-priority and low-priority tasks is dynamically adjusted according to the system load, which not only improves the resource utilization efficiency but also effectively reduces resource waste. Overall, the stability of task execution and the efficiency of system operation are improved, providing a solid guarantee for the high-load operation of the power range simulation system.
[0090] In an exemplary embodiment, step S202 generates a resource pre-scheduling plan for the system operation tasks of the power range simulation system according to the resource demand prediction information, the current operation data, and the task priorities, and further includes: for the system operation tasks with high priorities, determining the resources allocated to the system operation tasks with high priorities according to the current resource demand information of the system operation tasks with high priorities and a first preset ratio; for the system operation tasks with medium priorities, determining the resources allocated to the system operation tasks with medium priorities according to the current resource demand information of the system operation tasks with medium priorities and a second preset ratio; for the system operation tasks with low priorities, determining the resources allocated to the system operation tasks with low priorities according to the current resource demand information of the system operation tasks with low priorities, or suspending the operation of the system operation tasks with low priorities.
[0091] Wherein, the first preset ratio is greater than the second preset ratio.
[0092] Exemplarily, the terminal first generates resource demand prediction information based on the historical operation data and the current resource usage of the power range simulation system. Subsequently, the terminal obtains the system task list and divides the tasks into three categories: high priorities, medium priorities, and low priorities according to the importance and urgency of the tasks and the preset rules of the system. High-priority tasks are usually key business tasks that require priority resource allocation, medium-priority tasks are sub-key tasks, and low-priority tasks are auxiliary tasks or tasks with low resource requirements. In the resource allocation of high-priority tasks, the terminal allocates resources to high-priority tasks according to the resource demand prediction information and the first preset ratio to ensure that they can run in a timely manner and their resource requirements are fully met. For example, the first preset ratio is set to 60%-70% of the total system resources to prioritize the execution of high-priority tasks. If resources are insufficient, the terminal further allocates resources for high-priority tasks through dynamic adjustment, such as reducing the allocation from medium- and low-priority tasks. For medium-priority tasks, the terminal allocates resources according to the resource demand prediction information and the second preset ratio, usually ensuring that the resources meet the normal operation of the tasks. For example, the second preset ratio is set to 30%-40%. In the case of resource constraints, the resource allocation of medium-priority tasks may be restricted, but the basic resource requirements will still be maintained to avoid task delays. For low-priority tasks, the terminal first considers the remaining situation of the current system resources. When resources are sufficient, low-priority tasks can obtain resource allocation according to their requirements; if resources are tight, the terminal will first reduce the resource allocation of low-priority tasks or even suspend their operation. The execution of the suspension strategy needs to consider the actual impact of the tasks on the system performance to ensure that the suspension does not affect the normal operation of high-priority tasks.
[0093] In this embodiment, by setting resource allocation ratios for different priority tasks and dynamically adjusting them, the resource requirements of high-priority tasks can be preferentially guaranteed to ensure that critical tasks are completed on time. At the same time, resources for medium- and low-priority tasks are reasonably allocated to improve resource utilization efficiency. When resources are scarce, more resources are released by suspending or reducing the resource allocation for low-priority tasks, optimizing the overall system performance, and significantly enhancing the operation stability and scheduling efficiency of the power range simulation system.
[0094] In an exemplary embodiment, the above step S104 of generating a resource dynamic scheduling scheme further includes: when the current operation data of the power range simulation system is greater than a first preset threshold, reducing the resources allocated to low-priority system operation tasks and medium-priority system operation tasks, or suspending the operation of low-priority system operation tasks; when the current operation data of the power range simulation system is less than a second preset threshold, resuming the operation of the suspended low-priority system operation tasks, or increasing the resources allocated to high-priority system operation tasks and medium-priority system operation tasks.
[0095] Wherein, the first preset threshold is greater than the second preset threshold.
[0096] Exemplarily, the terminal first monitors the current operating data of the power range simulation system in real time, including indicators such as the CPU usage rate, memory occupancy rate, and network bandwidth load of the overall system. The terminal compares these monitored data with preset thresholds to determine whether the current load status of the system resources exceeds the first preset threshold or is lower than the second preset threshold. The first preset threshold represents the upper limit of resource usage. For example, when the CPU usage rate reaches 90%, the system load is considered too high; the second preset threshold represents the lower limit of resource usage. For example, when the resource utilization rate is lower than 40%, the system resources are considered to be in excess. When the current operating data is greater than the first preset threshold, the terminal determines that the system resources are in a high-load state and needs to relieve the pressure by dynamically adjusting the task resource allocation. Specifically, the terminal will first reduce the resource allocation of low-priority tasks and release resources for high-priority tasks to use. If the resources are still insufficient, the terminal will further reduce the resource allocation of medium-priority tasks and even suspend the operation of some low-priority tasks to ensure that critical tasks can be executed normally. This adjustment can quickly respond to the situation of system resource tension and avoid delays or failures of high-priority tasks due to insufficient resources. When the current operating data is less than the second preset threshold, the terminal determines that the system resources are in a low-load state and can appropriately resume the operation of low-priority tasks to make full use of idle resources. When resuming low-priority tasks, the terminal will first start the tasks that were previously suspended and allocate resources according to their actual needs. In addition, the terminal will also increase the resource quotas of medium-priority and high-priority tasks to improve their execution efficiency, accelerate task completion, and further optimize resource utilization. During the execution of the dynamic scheduling scheme, the terminal will continuously monitor the execution status of tasks and resource usage conditions and adjust the resource allocation strategy in real time. For example, if the system load rises rapidly after resuming low-priority tasks, the terminal will suspend some low-priority tasks again to maintain the stability of the system.
[0097] In this embodiment, by setting the first preset threshold and the second preset threshold, it is possible to give priority to ensuring the resource requirements of high-priority tasks when the resource load is too high, ensure the normal operation of critical tasks, and avoid performance degradation caused by insufficient resources. When the resource utilization rate is low, it is possible to make full use of the system idle resources, resume the operation of low-priority tasks, and appropriately increase the resource allocation of medium- and high-priority tasks to improve the overall resource utilization. It effectively balances the resource supply and demand relationship of the system, improves the operation efficiency and stability of the power range simulation system, and at the same time reduces the possibility of resource waste and task delay.
[0098] In an exemplary embodiment, the above step S101 uses historical operation data to train a target resource demand prediction model, and further includes: obtaining an initial resource demand prediction model, and obtaining the value range of hyperparameters in the initial resource demand prediction model; determining target hyperparameters within the value range of hyperparameters according to the historical operation data and the initial resource demand prediction model; training a target resource demand prediction model according to the historical operation data, the initial resource demand prediction model, and the target hyperparameters.
[0099] Exemplarily, the terminal first loads an initial resource demand prediction model, which is constructed based on an existing algorithm framework (such as a linear regression model, a decision tree model, or a deep learning model) and is used for preliminary prediction of resource demand. The initial model contains a set of tunable hyperparameters, such as learning rate, regularization coefficient, depth of the tree, number of hidden layer units, etc., and these hyperparameters have a significant impact on the performance of the model. The terminal simultaneously obtains the value range of these hyperparameters. For example, the learning rate can be set between 0.001 and 0.1, and the regularization coefficient can be set between 0.01 and 1.0. Next, the terminal optimizes the hyperparameters of the initial model in combination with historical operation data. The terminal uses algorithms such as cross-validation, grid search, or Bayesian optimization to determine the target hyperparameters that can optimize the model performance from the value range of hyperparameters. For example, through the grid search algorithm, the terminal evaluates all possible combinations of hyperparameters within the value range and calculates the performance metrics (such as mean squared error or prediction accuracy) of the model on the validation set; through the cross-validation method, the terminal can further verify the generalization performance of each set of hyperparameters to ensure that the selected target hyperparameters can perform excellently in actual prediction tasks. After the target hyperparameters are determined, the terminal trains the initial resource demand prediction model using historical operation data, and finally generates a target resource demand prediction model. During the training process, the historical operation data is divided into a training set and a validation set. The training set is used for parameter update of the model, and the validation set is used for evaluating the performance of the model and adjusting strategies. For example, the terminal adjusts the learning rate based on the target hyperparameters to accelerate the convergence of the model, or avoids overfitting through the regularization term. Finally, the generated target resource demand prediction model can accurately capture the variation law of resource demand in historical operation data and has strong generalization ability. This model can not only effectively predict future resource demands, but also adapt to dynamically changing load characteristics, providing a reliable basis for subsequent resource scheduling.
[0100] In this embodiment, by introducing hyperparameter optimization, the accuracy and robustness of the resource demand prediction model can be further improved on the basis of the initial model. The optimized target hyperparameters can effectively balance the fitting ability and generalization ability of the model, enabling the prediction model to have higher accuracy on historical data and stronger adaptability to future data. Combining the optimized model with historical operation data, the finally generated target resource demand prediction model can more accurately predict the resource demand of the power range simulation system, improve the efficiency of resource scheduling, reduce the situation of insufficient or wasted resource allocation, and significantly enhance the stability and reliability of system operation.
[0101] In an exemplary embodiment, the above step S101 uses historical operation data to train a target resource demand prediction model, and further includes: preprocessing the historical operation data to obtain preprocessed historical operation data; determining statistical feature data and time series feature data according to the preprocessed historical operation data; and training a target resource demand prediction model according to the statistical feature data and the time series feature data.
[0102] Exemplarily, the terminal first preprocesses the collected historical operation data to ensure the integrity and quality of the data. The historical operation data includes, but is not limited to, task execution time, resource usage (such as the consumption of CPU, memory, and network bandwidth), task priority, and load change trend, etc. The preprocessing process includes the following: Missing value processing: The terminal supplements the missing data using mean filling, interpolation method, or nearest neighbor algorithm to ensure the integrity of the input data during model training; Outlier detection and removal: Abnormal data points are removed through statistical methods (such as the 3σ principle) or model-based detection algorithms to avoid bias caused by outliers in the model; Data normalization: The data ranges of different features are standardized or normalized. For example, the value ranges of CPU usage rate and memory occupancy rate are unified to 0-1 so that the model can efficiently process the input features.
[0103] After the preprocessing is completed, the terminal extracts features from the obtained historical operation data. The core of feature extraction is to transform the original data into statistical feature data and time series feature data that can reflect the resource demand law. The statistical feature data is obtained by statistical calculation of the historical records of resource usage. For example: Mean value: Reflects the resource usage trend of tasks over a period of time; Standard deviation: Measures the fluctuation degree of resource usage; Maximum and minimum values: Used to describe the extreme situations of resource usage; Task priority ratio: Used to analyze the dominance of high-priority tasks in resource consumption.
[0104] The time-series feature data is extracted by analyzing the time-dependence and periodic changes in resource usage, including: Moving average: Capturing the changing trend of short-term resource demand through a moving window; Time difference: Extracting the growth rate or decline rate of resource usage; Periodic features: Such as daily or weekly resource demand patterns, used to capture the periodic fluctuations in the load.
[0105] After the feature data extraction is completed, the terminal inputs the statistical feature data and the time-series feature data into the target resource demand prediction model for training. During the training process, the terminal uses supervised learning algorithms, such as linear regression, gradient boosting decision tree, or long short-term memory network (LSTM), to establish a resource demand prediction model based on the input and output of historical operation data (such as the actual value of resource usage). Through iterative training, the model continuously optimizes the parameters to improve the prediction accuracy. Finally, the generated target resource demand prediction model can accurately predict future resource demands based on statistical features and time-series features. For example, the model can predict the CPU usage rate or network bandwidth demand within a certain future time period, helping the system to make resource allocation and task scheduling plans in advance.
[0106] In this embodiment, through the preprocessing and feature extraction of historical operation data, the quality and expression ability of the input data are effectively improved, ensuring that the model can capture the internal laws and changing trends of resource demands. The statistical feature data provides global information, such as the average level and fluctuation range of resource usage, while the time-series feature data reveals the time-dependence and periodic changes in resource demands. Combining these two types of features, the trained target resource demand prediction model has higher prediction accuracy and adaptability, providing reliable data support for the resource scheduling of the power range simulation system. At the same time, by accurately predicting resource demands, the system can optimize the resource allocation strategy, avoid resource overload or waste, and significantly improve the operation efficiency and stability of the simulation system.
[0107] In another exemplary embodiment, as Figure 3 shown, the present application provides a resource scheduling method for a power range simulation system, and the method includes:
[0108] Step S301, data collection and statistical analysis: Collect historical resource usage data, time data, and application workload data, and perform statistical analysis on the collected data to ensure the quality and integrity of the data.
[0109] Step S302, linear regression model establishment: Use the system resource usage data obtained in the previous step to construct a linear regression model.
[0110] Step S303, Resource Usage Prediction: Utilize the obtained linear regression model based on time series, combined with the current system resource usage status, to predict the future system resource usage.
[0111] Step S304, Resource Allocation: According to the prediction results and the current resource usage status, adopt priority-based resource allocation to ensure that critical tasks can obtain the required resources and improve the overall utilization efficiency of resources.
[0112] Step S305, Resource Adjustment: Automatically perform dynamic adjustment of resources when the resource requirements change.
[0113] Step S306, Prediction Error Evaluation and Optimization: Compare the predicted system resource usage with the actual value and calculate the prediction error probability.
[0114] Exemplarily, in step S301, data collection is first carried out. These data mainly include information such as historical resource usage data, time data, application workload data, etc. Then, statistical analysis is performed on the collected data, including data cleaning, outlier removal, feature extraction, etc. to ensure the quality and integrity of the data. The key to this step is to accurately obtain the status data of the current system resources and perform effective processing and analysis on it.
[0115] Specifically, (1) Data collection: These data mainly include but are not limited to: Historical resource usage data: CPU usage rate, memory usage, network bandwidth utilization, storage I / O operations, etc. Time data: Record the timestamp of each data point to identify periodic changes in usage patterns. Application workload data: Information such as the type of application and workload characteristics. (2) Data acquisition and integration: Acquire and integrate the real-time and historical resource usage data of the system. Automated tools or scripts can be used to extract and process these data to ensure the accuracy and integrity of the data. (3) Feature engineering: After data collection, feature engineering is required to convert the original data into a format that can be processed by machine learning models. This includes: Data cleaning: Remove or fill missing values and delete outliers. Feature extraction: Extract useful information from the original data, such as calculating statistical metrics like moving averages and peaks. Time series features: Generate time-related features, such as time trends. (4) Data storage and management: Establish a suitable data storage and management system for storing and managing network security status data. This can include databases, data warehouses, or big data platforms, etc. to ensure the security, accessibility, and scalability of the data.
[0116] Further, in the above (3): Process the collected data and use it as the independent variable (x) of the parameters of the linear regression prediction model. The assignment of the independent variable x of the linear regression model is based on the actually collected data: ① Historical resource usage data: CPU usage rate: Obtain the occupancy of the CPU in the past period through a monitoring system or a virtualization management platform, usually expressed as a percentage. When assigning values, these data can be input into the model as time series data. Memory usage: Similarly, obtain the memory usage in the past period through a monitoring system or a virtualization management platform, including the used memory and free memory, etc. When assigning values, these data can be input into the model as numerical features. Network bandwidth utilization rate: Obtain the network bandwidth usage in the past period through a network monitoring tool, including upload and download rates, etc. When assigning values, these data can be input into the model as numerical features or time series data. Storage I / O operations: Obtain the read and write operation times and rates of the storage device in the past period through a storage device monitoring tool. When assigning values, these data can also be input into the model as numerical features or time series data. ② Time data: Timestamp: Record the time information of each data point, such as date, hour, minute, etc. When assigning values, these time information can be converted into numerical features (such as the integer representation of the timestamp) or time series data (such as data points arranged in chronological order). ③ Application workload data: Type of application: Encode or classify according to the type of the application program. When assigning values, categorical features (such as using one-hot encoding or label encoding) can be used to represent different types of application programs. Workload characteristics: Quantify according to the workload characteristics of the application program. When assigning values, these features can be input into the model as numerical features, such as the number of concurrent users, request rate, data processing volume, etc.
[0117] In step S302, construct a linear regression model: (1) Data division: Divide the data into a training set and a test set to train the model and evaluate its generalization ability. Training set: This part of the data is used to train the model, that is, let the model learn the rules and patterns in the data. Through continuous iteration and optimization, the performance of the model on the training set will gradually improve until it reaches a relatively stable level. Test set: This part of the data is used after the model training is completed to evaluate the generalization ability of the model. Since the test set is independent of the training set, it can provide a relatively objective performance evaluation index. By comparing the performance of the model on the test set, we can determine whether the model is overfitting or underfitting, and make further adjustments and optimizations accordingly. The ratio of data division is usually determined according to the specific problem and the size of the data set. Common division ratios include 70% training set + 30% test set, 80% training set + 20% test set, etc. In practical applications, more complex division methods, such as the hold-out method, cross-validation method, etc., can also be adopted.
[0118] (2) Model Tuning: Select the best parameters to improve the model performance. Specifically, parameter selection: First, it is necessary to determine which parameters in the model can be adjusted. These parameters may include learning rate, number of iterations, regularization coefficient, etc. Cross-validation: Evaluate the model performance by dividing the dataset into multiple subsets. During cross-validation, usually one subset is selected as the validation set, and the remaining subsets are used as the training sets. Then, by training the model iteratively multiple times and evaluating its performance on the validation set, we can find a relatively optimal set of parameters. Performance evaluation: After cross-validation is completed, we can evaluate the model performance based on its performance on the validation set. Common evaluation metrics include accuracy, recall, F1-score, etc. By comparing the performance evaluation results under different parameter combinations, we can select a set of best parameters. It should be noted that model tuning is an iterative process. In practical applications, different parameter combinations and tuning strategies need to be tried multiple times to find the optimal model configuration.
[0119] (3) Training the Model: Use the training data to train the model. When training the model, data preprocessing, model initialization, and iterative training are required until the stopping condition is met. Specifically, after determining the best parameters, use the training data to train the model, which generally includes the following steps: Data preprocessing: Before training the model, it is necessary to preprocess the training data. This includes steps such as data cleaning, feature selection, and feature scaling. By preprocessing, we can improve the data quality and the model performance. Model initialization: Initialize the model according to the selected model and parameters. This includes setting the initial weights, biases, and other parameters of the model. Iterative training: During the training process, the model continuously learns the patterns and regularities in the training data. This is usually achieved through iteration, that is, continuously adjusting the model parameters to minimize the loss function. In each iteration, the model calculates a predicted value based on the current parameters and the training data, and compares it with the actual value. Then, adjust the model parameters according to the comparison result to better predict the data in the next iteration. Stopping condition: The training process continues until a certain stopping condition is met. Common stopping conditions include reaching the maximum number of iterations, convergence of the loss function, etc. When the stopping condition is met, it can be considered that the model has been trained and can be used for subsequent prediction and evaluation.
[0120] Furthermore, in the above (2), the model parameters β0, β1,..., β n are estimated by minimizing the sum of the squares of the prediction errors, that is, solving the following optimization problem:
[0121]
[0122] where T is the total number of time points in the training data.
[0123] β0 (intercept term) and β1, ..., β n (regression coefficients) are estimated by the least squares method. The values of these parameters minimize the error between the predicted value and the actual value.
[0124] Specifically, the training process of the linear regression model can be regarded as an optimization problem, and the goal is to find a set of parameters (β0, β1, ..., β n ) that make the model have the best fitting effect on the training data. This is usually achieved by iteratively updating the parameter values until a certain stopping condition is reached (such as error convergence or reaching the maximum number of iterations). During the training process, the gradient of each parameter (including β0) (i.e., the partial derivative of the error with respect to this parameter) is calculated, and the parameter values are updated according to the gradient value. This process will be repeated until a set of optimal parameter values are found, making the prediction error of the model the smallest. Among them, the calculation of β0 depends on the quality of the training data and feature selection. If there is noise or outliers in the data, or the feature selection is inappropriate, it may affect the accuracy of β0 and the performance of the model. In practical applications, it is usually necessary to preprocess the data (such as data cleaning, feature extraction, etc.) to improve the quality and prediction accuracy of the model.
[0125] In step S303, using the obtained linear regression model algorithm based on time series, combined with the current system resource usage status, including the requirements of CPU, memory, storage, and network bandwidth, the future system resource usage is predicted. This prediction is based on historical data and real-time data analysis and can quickly respond to upcoming load changes. Specifically, (1) Resource usage prediction: In resource prediction, a linear regression model based on the timeline is used to predict the used resources. This method can provide a mathematical basis to make the prediction results more reliable. This embodiment uses the formula of the linear regression prediction model based on time series data: . Among them, y is the dependent variable, representing the predicted value of resource usage in the future period. β0 is the intercept term, representing the predicted value of the dependent variable when all independent variables are 0. β1, ..., β n are regression coefficients, representing the influence degree of independent variables on the dependent variable. x1, x2, ..., x n are independent variables, representing various factors that affect resource usage. ε is the error term, representing the difference between the model predicted value and the actual value, representing the part of the variation of the dependent variable (y) in the model that cannot be explained by the independent variable (x). The error term is random and unobservable. Therefore, in practical applications, the specific value of ε usually cannot be directly "calculated", but its influence is estimated through the residuals in the model fitting process: Among them, n is the current prediction node, y is the actual resource usage of the system, and y' is the predicted resource usage of the system. That is, the value of the error term ε is obtained based on the resource usage of the previous prediction node.
[0126] In step S304, specifically, (1) Resource allocation strategy: Based on the prediction results and the current resource usage status, the engine adopts priority-based resource allocation to ensure that critical tasks can obtain the required resources while improving the overall resource utilization efficiency.
[0127] (2) Priority determination: Determine the priority of each task according to the type of task (such as fault analysis, system stability testing, etc.), urgency, expected impact, and historical data.
[0128] (3) Priority classification: High priority: Simulation tasks involving critical system operations or emergency fault handling. Medium priority: Routine system performance testing and optimization tasks. Low priority: Non-urgent data analysis and long-term research projects.
[0129] (4) Resource allocation rules: 1. Resource requirement assessment: Before each simulation task starts, it must submit its resource requirements, including CPU, memory, storage, and network bandwidth. 2. Dynamic adjustment mechanism: Dynamically adjust resource allocation according to the current system resource usage and the priorities of each task. 3. Resource reservation: Reserve a certain proportion of resources for high-priority tasks to ensure rapid response at any time. 4. Resource recycling and reallocation: Recycle resources from low-priority tasks and reallocate them to currently more urgent or higher-priority tasks.
[0130] (5) Implementation steps: 1. Real-time monitoring: The system continuously monitors the resource usage of each task and the overall resource status of the system. 2. Prediction model application: Use the prediction model to predict the resource requirements of each task in the short term in the future to provide data support for resource adjustment. 3. Decision execution: When the system detects that the resource usage is approaching the upper limit, it automatically triggers the resource management protocol. Automatically adjust resource allocation according to task priorities and resource requirements to ensure that high-priority tasks will not be delayed due to insufficient resources.
[0131] (6) Safety and fault tolerance mechanisms: 1. Overload protection: Set an upper limit threshold for resource usage to prevent system crashes caused by excessive resource allocation. 2. Task fault tolerance: For low-priority tasks affected by resource adjustment, the system automatically records the status and resumes the tasks when resources are sufficient.
[0132] In step S305, the resource usage status is monitored in real time, and the resource allocation is dynamically adjusted according to the policy and prediction results. When the resource demand increases, resources are automatically allocated from other non-critical tasks to support critical tasks. Specifically, (1) Resource adjustment mechanism: When the resource demand changes, the scheduling engine can automatically adjust the resources. For example, when a virtual machine needs more resources due to an emergency, the scheduling engine can temporarily allocate resources from other low-priority tasks to ensure the continuity and stability of the service.
[0133] (2) Resource adjustment policy: 1. Rule setting: Define when to trigger resource adjustment, such as automatically starting the adjustment mechanism when the resource utilization rate reaches a certain threshold. 2. Dynamic allocation: Increase allocation: Add resources to high-priority or resource-deficient tasks. Decrease allocation: Reduce resource allocation from low-priority or tasks with low current load. 3. Automatic operation: Automatic execution: The scheduling engine automatically executes resource adjustment according to the policy without manual intervention. Operation feedback: After each resource adjustment, the system records the operation details and feeds them back to the operation log for system administrators or users to review.
[0134] (3) Implementation details: 1. Set adjustment rules and thresholds: Define resource adjustment conditions: Set upper and lower thresholds for resource usage, and once these thresholds are reached, automatically trigger resource adjustment. Develop allocation strategies: Develop clear rules for resource increase and decrease allocation to ensure the transparency and fairness of resource adjustment. 2. Implement dynamic allocation: Increase allocation operation: For high-priority tasks in a resource-deficient state, quickly allocate additional resources. Decrease allocation operation: Reduce resource allocation from tasks with low current load to optimize resource usage. 3. Automatic and feedback mechanisms: Automatically execute resource adjustment: Use automated tools and scripts to adjust resource allocation in real time without manual intervention. Operation feedback record: After each resource adjustment, the system automatically records the operation details and generates an operation log for administrators to review and users to provide feedback.
[0135] In step S306, by evaluating the accuracy and reliability of the prediction model, problems existing in the model can be discovered and optimized. Specifically, it lies in timely discovering and solving prediction errors, and adjusting model parameters to improve prediction performance and effects. Specifically, (1) Evaluation metrics: Use the mean squared error (MSE) metric to evaluate the performance of the model. (2) Continuous iteration: Over time and with the accumulation of new data, regularly retrain and adjust the model to adapt to changes in the system and load. (3) Model validity test: The validity of the model can be evaluated by calculating the coefficient of determination R 2 to evaluate, which measures the proportion of the variance explained by the model to the total variance:
[0136]
[0137] Among them, is the actual resource usage of the system at time point t, is the predicted resource usage value of the model for time point t, is the actual average resource usage of the system.
[0138] In this embodiment, the resource prediction model can effectively provide accurate predictions for the dynamic resource scheduling engine, ensuring the efficient utilization of resources and the optimization of system performance. Maximize resource utilization through accurate prediction and flexible scheduling. The modular design makes the system easy to expand and maintain. Quickly respond to changes in resource requirements, reducing latency and performance bottlenecks.
[0139] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0140] Based on the same inventive concept, the embodiments of the present application also provide a resource scheduling device for a power range simulation system for implementing the resource scheduling method of the power range simulation system involved above. The implementation solutions provided by this device to solve problems are similar to the implementation solutions recorded in the above method. Therefore, the specific limitations in one or more embodiments of the resource scheduling device for the power range simulation system provided below can refer to the limitations on the resource scheduling method of the power range simulation system in the above text, and will not be repeated here.
[0141] In an exemplary embodiment, as Figure 4 shown, a resource scheduling device for a power range simulation system is provided, including: a model training module 401, a demand prediction module 402, a pre-scheduling module 403, and a dynamic scheduling module 404, where:
[0142] The model training module 401 is configured to obtain the historical operation data of the power range simulation system and train a target resource demand prediction model using the historical operation data; the target resource demand prediction model is used to represent the mapping relationship between the operation data and the resource demand prediction information;
[0143] A demand prediction module 402, configured to input the current operation data of the power range simulation system into a target resource demand prediction model when a preset prediction condition is triggered, so as to obtain resource demand prediction information of the power range simulation system;
[0144] A pre-scheduling module 403, configured to generate a resource pre-scheduling plan for the system operation tasks of the power range simulation system according to the resource demand prediction information and the current operation data, and execute the resource pre-scheduling plan;
[0145] A dynamic scheduling module 404, configured to generate a resource dynamic scheduling plan and stop executing the resource pre-scheduling plan and execute the resource dynamic scheduling plan when the current operation data of the power range simulation system is monitored to meet the preset threshold condition during the execution of the resource pre-scheduling plan.
[0146] In one embodiment, the above-mentioned demand prediction module 402 is further configured to input the current operation data of the power range simulation system into a target resource demand prediction model, and output model prediction information; obtain residual information corresponding to the previous resource demand prediction, and determine the resource demand prediction information of the power range simulation system according to the model prediction information and the residual information.
[0147] In one embodiment, the above-mentioned pre-scheduling module 403 is further configured to obtain the task priorities of the system operation tasks of the power range simulation system; generate a resource pre-scheduling plan for the system operation tasks of the power range simulation system according to the resource demand prediction information, the current operation data and the task priorities.
[0148] In one embodiment, the above-mentioned pre-scheduling module 403 is further configured to, for high-priority system operation tasks, determine the resources allocated to the high-priority system operation tasks according to the current resource demand information of the high-priority system operation tasks and a first preset ratio; for medium-priority system operation tasks, determine the resources allocated to the medium-priority system operation tasks according to the current resource demand information of the medium-priority system operation tasks and a second preset ratio; for low-priority system operation tasks, determine the resources allocated to the low-priority system operation tasks according to the current resource demand information of the low-priority system operation tasks, or suspend the operation of the low-priority system operation tasks; wherein, the first preset ratio is greater than the second preset ratio.
[0149] In one embodiment, the above-mentioned dynamic scheduling module 404 is further configured to reduce the resources allocated to the system operation tasks with low priority and the system operation tasks with medium priority, or suspend the operation of the system operation tasks with low priority when the current operation data of the power range simulation system is greater than a first preset threshold; when the current operation data of the power range simulation system is less than a second preset threshold, resume the operation of the suspended system operation tasks with low priority, or increase the resources allocated to the system operation tasks with high priority and the system operation tasks with medium priority; wherein, the first preset threshold is greater than the second preset threshold.
[0150] In one embodiment, the above-mentioned model training module 401 is further configured to obtain an initial resource demand prediction model and obtain the value range of hyperparameters in the initial resource demand prediction model; determine the target hyperparameters within the value range of the hyperparameters according to the historical operation data and the initial resource demand prediction model; and train the target resource demand prediction model according to the historical operation data, the initial resource demand prediction model and the target hyperparameters.
[0151] In one embodiment, the above-mentioned model training module 401 is further configured to preprocess the historical operation data to obtain the preprocessed historical operation data; determine the statistical feature data and the time series feature data according to the preprocessed historical operation data; and train the target resource demand prediction model according to the statistical feature data and the time series feature data.
[0152] Each module in the above-mentioned resource scheduling device of the power range simulation system can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in the processor of the computer device in the form of hardware or be independent of it, or be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
[0153] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as Figure 5As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a resource scheduling method for a power range simulation system. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0154] Those skilled in the art can understand that Figure 5 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0155] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0156] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0157] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0158] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0159] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the embodiments provided in this application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., and are not limited thereto.
[0160] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this application.
[0161] The above-described embodiments merely represent several implementation manners of this application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of this application. It should be noted that for those of ordinary skill in the art, without departing from the concept of this application, several variations and improvements can still be made, and these all belong to the protection scope of this application. Therefore, the protection scope of this application shall be subject to the appended claims.
Claims
1. A resource scheduling method for an electric power range simulation system, characterized in that The method includes: Obtaining historical operation data of the power range simulation system, and training a target resource demand prediction model using the historical operation data; the target resource demand prediction model is used to represent the mapping relationship between operation data and resource demand prediction information; When a preset prediction condition is triggered, inputting the current operation data of the power range simulation system into the target resource demand prediction model to obtain the resource demand prediction information of the power range simulation system; Generating a resource pre-scheduling plan for the system operation tasks of the power range simulation system according to the resource demand prediction information and the current operation data, and executing the resource pre-scheduling plan; During the execution of the resource pre-scheduling plan, and when it is monitored that the current operation data of the power range simulation system meets the preset threshold condition, generating a resource dynamic scheduling plan, stopping the execution of the resource pre-scheduling plan, and executing the resource dynamic scheduling plan; The generating a resource pre-scheduling plan for the electrical system operation tasks of the power range simulation system according to the resource demand prediction information and the current operation data includes: Obtaining the task priorities of the system operation tasks of the power range simulation system; For high-priority system operation tasks, determining the resources allocated to the high-priority system operation tasks according to the current resource demand information of the high-priority system operation tasks and a first preset ratio; For medium-priority system operation tasks, determining the resources allocated to the medium-priority system operation tasks according to the current resource demand information of the medium-priority system operation tasks and a second preset ratio; For low-priority system operation tasks, determining the resources allocated to the low-priority system operation tasks according to the current resource demand information of the low-priority system operation tasks, or suspending the operation of the low-priority system operation tasks; Wherein, the first preset ratio is greater than the second preset ratio.
2. The method according to claim 1, wherein The inputting the current operation data of the power range simulation system into the target resource demand prediction model to obtain the resource demand prediction information of the power range simulation system includes: Inputting the current operation data of the power range simulation system into the target resource demand prediction model, and outputting model prediction information; Obtaining the residual information corresponding to the previous resource demand prediction, and determining the resource demand prediction information of the power range simulation system according to the model prediction information and the residual information.
3. The method according to claim 1, wherein The generating a resource dynamic scheduling plan includes: When the current operation data of the power range simulation system is greater than a first preset threshold, reducing the resources allocated to low-priority and medium-priority system operation tasks, or suspending the operation of the low-priority system operation tasks; When the current operation data of the power range simulation system is less than a second preset threshold, resuming the operation of the suspended low-priority system operation tasks, or increasing the resources allocated to high-priority and medium-priority system operation tasks; Among them, the first preset threshold is greater than the second preset threshold.
4. The method according to claim 1, wherein The training of the target resource demand prediction model using the historical operation data includes: Obtaining an initial resource demand prediction model and obtaining the value range of hyperparameters in the initial resource demand prediction model; Determining target hyperparameters within the value range of the hyperparameters according to the historical operation data and the initial resource demand prediction model; Training a target resource demand prediction model according to the historical operation data, the initial resource demand prediction model, and the target hyperparameters.
5. The method according to claim 1, wherein The training of the target resource demand prediction model using the historical operation data includes: Preprocessing the historical operation data to obtain preprocessed historical operation data; Determining statistical feature data and time series feature data according to the preprocessed historical operation data; Training a target resource demand prediction model according to the statistical feature data and the time series feature data.
6. A resource scheduling device for a power range simulation system, characterized in that The device includes: A model training module, configured to obtain historical operation data of a power range simulation system and train a target resource demand prediction model using the historical operation data; the target resource demand prediction model is used to represent the mapping relationship between operation data and resource demand prediction information; A demand prediction module, configured to input the current operation data of the power range simulation system into the target resource demand prediction model when a preset prediction condition is triggered to obtain resource demand prediction information of the power range simulation system; A pre-scheduling module, configured to generate a resource pre-scheduling plan for the system operation tasks of the power range simulation system according to the resource demand prediction information and the current operation data, and execute the resource pre-scheduling plan; A dynamic scheduling module, configured to generate a resource dynamic scheduling plan and stop executing the resource pre-scheduling plan and execute the resource dynamic scheduling plan when it is monitored that the current operation data of the power range simulation system meets the preset threshold condition during the execution of the resource pre-scheduling plan; The pre-scheduling module is further configured to obtain the task priorities of the system operation tasks of the power range simulation system; for high-priority system operation tasks, determine the resources allocated to the high-priority system operation tasks according to the current resource demand information of the high-priority system operation tasks and a first preset ratio; for medium-priority system operation tasks, determine the resources allocated to the medium-priority system operation tasks according to the current resource demand information of the medium-priority system operation tasks and a second preset ratio; for low-priority system operation tasks, determine the resources allocated to the low-priority system operation tasks according to the current resource demand information of the low-priority system operation tasks, or suspend the operation of the low-priority system operation tasks; among them, the first preset ratio is greater than the second preset ratio.
7. The device according to claim 6, characterized in that, The demand prediction module is further configured to input the current operation data of the power range simulation system into the target resource demand prediction model, and output model prediction information; obtain the residual information corresponding to the previous resource demand prediction, and determine the resource demand prediction information of the power range simulation system according to the model prediction information and the residual information.
8. The device according to claim 6, characterized in that, The dynamic scheduling module is further configured to, when the current operation data of the power range simulation system is greater than a first preset threshold, reduce the resources allocated to the system operation tasks with low priority and the system operation tasks with medium priority, or suspend the operation of the system operation tasks with low priority; when the current operation data of the power range simulation system is less than a second preset threshold, resume the operation of the system operation tasks with low priority that have been suspended, or increase the resources allocated to the system operation tasks with high priority and the system operation tasks with medium priority; wherein, the first preset threshold is greater than the second preset threshold.
9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Fog computing resource pre-allocation method, device and equipment of power system and medium
CN116996577A
Resource scheduling method and system for electric power target range
CN118839915A