Neural network training and computing resource scheduling method, device, medium and product

By using a neural network training method based on reinforcement learning algorithms to dynamically adjust resource allocation strategies, the problem of flexibility and adaptability in resource allocation in cloud computing platforms is solved, thereby improving resource utilization and scheduling performance.

CN123178091APending Publication Date: 2026-11-27CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611610402.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-16
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies in cloud computing platforms struggle to adapt to complex resource supply and demand imbalances, concurrent execution of multiple tasks, and dynamic changes in requirements, resulting in low resource utilization and system bottlenecks.

Method used

A neural network training method based on reinforcement learning algorithm is adopted. By adjusting the sampling priority of experience samples, the deep Q network (DQN) is dynamically optimized to realize the scheduling of computing resources. The DQN network is used to process the continuous state space and action space. Combined with the priority experience replay mechanism, the resource allocation strategy is dynamically adjusted.

Benefits of technology

It improves the accuracy and flexibility of resource allocation, enhances the scheduling performance of computing resources, adapts to constantly changing resource demands and diverse task scenarios, reduces correlation bias during training, and improves resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178091A_ABST
    Figure CN123178091A_ABST
Patent Text Reader

Abstract

The application provides a neural network training and computing resource scheduling method, device, medium and product. The neural network training method comprises: obtaining target batch experience samples in an experience pool, and sequentially training a DQN by using a first part of experience samples to an Mth part of experience samples in the target batch experience samples; determining an average value of a time difference error of the Mth part of experience samples and a median of time difference errors of each experience sample in the experience pool; each part of experience samples in the target batch experience samples comprises a plurality of experience samples, and the DQN is used to implement computing resource scheduling; adjusting a sampling priority of each part of experience samples in the target batch experience samples according to a comparison result of the average value and the median; sequentially selecting experience samples for training the DQN from the experience pool according to the sampling priority of each experience sample in the experience pool; and continuing to train the DQN according to the selected experience samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of resource scheduling, and in particular to a method, device, medium and product for neural network training and computing resource scheduling. Background Technology

[0002] With the rapid development of cloud computing technology, how to efficiently allocate storage, computing, and training resources within cloud computing platforms has become a crucial issue. However, the resource allocation schemes of related technologies have revealed many significant shortcomings when dealing with resource supply and demand imbalances, concurrent execution of multiple tasks, and dynamic changes in requirements. Many of these schemes rely on pre-defined static allocation strategies or simple load balancing algorithms, which are insufficient to meet the diverse needs of tasks in complex cloud computing environments.

[0003] To improve resource allocation efficiency, some technical solutions employ rule-based dynamic load balancing strategies. However, these dynamic load balancing strategies typically rely on fixed rule sets, making it difficult to accurately allocate computing resources when faced with constantly changing resource demands and diverse task scenarios. Summary of the Invention

[0004] This application provides a method, device, medium, and product for neural network training and computing resource scheduling.

[0005] The technical solution of this application embodiment is implemented as follows: This application provides a neural network training method, the method comprising: Given a target batch of experience samples from the experience pool, and a Deep Q Network (DQN) trained sequentially using experience samples from the first part to the Mth part of the target batch, the average temporal difference error of the Mth part of the experience samples and the median temporal difference error of each experience sample in the experience pool are determined. The target batch of experience samples is any batch of experience samples in the experience pool, M is an integer greater than 1, each part of the target batch of experience samples includes multiple experience samples, and the DQN is used to implement computing resource scheduling. Based on the comparison between the average and the median, the sampling priority of each part of the experience samples in the target batch is adjusted; the sampling priority is used to determine the selection order of the experience samples when training the DQN; based on the sampling priority of each experience sample in the experience pool, experience samples for training the DQN are selected sequentially in the experience pool. The DQN is then trained again based on the selected empirical samples.

[0006] This application also provides a method for scheduling computing resources, the method comprising: Determine the data to be processed, which includes the state space, action space, and reward function corresponding to the computing resource scheduling task; The data to be processed is processed by a DQN network to obtain a reward value, which includes the Q value obtained when performing each action in the action space in the current state; the DQN network is trained based on any of the above neural network training methods. Based on the reward value, the action to be executed in the current state is determined in the action space, and the computing resources are scheduled by executing the action to be executed.

[0007] This application also provides an electronic device, which includes a processor and a memory for storing a computer program that can run on the processor; wherein the processor is used to run the computer program to execute any of the above-described neural network training methods or any of the above-described computing resource scheduling methods.

[0008] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the above-described neural network training methods or any of the above-described computing resource scheduling methods.

[0009] This application also provides a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, implements any of the above-described neural network training methods or any of the above-described computing resource scheduling methods.

[0010] As can be seen, when DQN is trained sequentially using the first part to the Mth part of the experience samples in the target batch, this embodiment can dynamically adjust the selection order of experience samples during DQN training based on the comparison between the average value of the temporal difference error of the Mth part of experience samples and the median of the temporal difference error of each experience sample in the experience pool. When facing constantly changing resource requirements and diverse task scenarios, experience samples can be determined according to resource requirements and task scenarios, and then the selection order of experience samples during DQN training can be accurately adjusted according to the temporal difference error of the experience samples. This can improve the computing resource scheduling performance of the trained DQN. Since DQN is used to implement computing resource scheduling, this embodiment can achieve more accurate allocation of computing resources through the trained DQN. Attached Figure Description

[0011] Figure 1 This is a flowchart of a neural network training method according to an embodiment of this application; Figure 2 This is a schematic diagram illustrating the adjustment of sampling priority for empirical samples in an embodiment of this application; Figure 3 This is a schematic diagram showing the magnitude of the influence of various empirical samples on DQN in the embodiments of this application; Figure 4 This is a schematic diagram of the network structure of the Q-network according to an embodiment of this application; Figure 5 This is a schematic diagram of the network structure of DQN according to an embodiment of this application; Figure 6 This is a flowchart of a computing resource scheduling method according to an embodiment of this application; Figure 7 This is a flowchart of a resource scheduling method based on reinforcement learning algorithm in an embodiment of this application; Figure 8 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0012] In related technologies, cloud computing resource allocation primarily employs centralized scheduling frameworks or fixed allocation models based on historical data. Fixed allocation models formulate resource allocation schemes by analyzing historical workloads, but this approach cannot respond promptly to sudden changes in system load. For example, during peak computing periods or sudden increases in training demand, it is difficult to quickly adjust resource configurations. Furthermore, multi-resource collaborative allocation is inefficient; computing, storage, and training resources are typically managed separately in different system modules, making it impossible to flexibly allocate resources based on task execution.

[0013] To improve resource allocation efficiency, some technical solutions employ rule-based dynamic load balancing strategies. However, these strategies typically rely on fixed rule sets, making them ill-suited to changing resource demands and diverse task scenarios. This is particularly true in computationally intensive and training / optimization tasks, where resource scheduling becomes inflexible based on task phases. The lack of in-depth analysis of task execution phases leads to insufficient adaptability of resource allocation across different stages, resulting in decreased resource utilization or system bottlenecks.

[0014] It is evident that the relevant technologies have significant shortcomings in dynamic resource scheduling, multi-resource collaboration, task phase identification, and real-time feedback. As the complexity of cloud computing scenarios continues to increase, how to efficiently manage storage, computing, and training resources, and dynamically adjust resource allocation strategies according to task phases, has become an urgent problem to be solved.

[0015] The first approach of the related technology proposes a computing power scheduling method. In this approach, a computing power scheduling request initiated by a computing power scheduling requester is received through a preset computing power scheduling request interface; the computing power scheduling request is verified and a verification result is obtained; if the verification result is successful, computing power scheduling is invoked for the computing power scheduling request according to the computing power scheduling strategy template to obtain the computing power scheduling result; and the computing power scheduling result is returned to the computing power scheduling requester.

[0016] The second approach to related technologies proposes an intelligent optimization method for distributed computing power scheduling. This method constructs a multi-level system dependency graph and a causal relationship model; utilizes multi-dimensional anomaly detection and fault prediction technologies to monitor system status in real time and predict potential faults; when an anomaly is detected or a potential fault is predicted, critical path analysis is performed using the multi-level system dependency graph and causal relationship model to identify fault propagation paths and key affected nodes, and fault isolation strategies are implemented to block fault propagation and implement preventative resource scheduling; intelligent repair and resource reorganization are implemented; this approach achieves early prediction, accurate location, and efficient handling of faults in distributed systems, while optimizing the allocation and scheduling of computing resources, thus improving system reliability, availability, and performance.

[0017] The third approach in the related technology proposes a computing power scheduling method based on task demand prediction. In this approach, task characteristic parameters of the task to be scheduled can be obtained to determine the preset computing power resource requirements of the task, and resource scheduling can be performed on the cloud computing cluster. Resource usage information of the task to be scheduled at multiple test runtime points can be obtained. Combining the task characteristic parameters, preset computing power resource requirements, and resource usage information of multiple scheduled tasks at multiple test runtime points, the computing power scheduling cycle and computing power resource requirements of multiple scheduling time periods of the task to be scheduled can be determined. Combining the computing power scheduling cycle of multiple scheduled tasks and the computing power resource requirements of multiple scheduling time periods within the scheduling cycle, a dynamic deployment strategy for the cloud computing cluster can be determined, and resource scheduling can be performed on the cloud computing cluster. This approach has the advantages of improving the flexibility of computing power scheduling and the matching degree between computing power resource allocation and task requirements.

[0018] The computing resource scheduling solutions of related technologies are still mired in problems such as static models, real-time bottlenecks, slow resource startup, and cost inflation. For example, the solutions of related technologies rely on preset rules or deep causal inference, which cannot evolve in real time with load, failures, and business emergencies, and miss the golden window for online scheduling due to minute-level latency; when new services are launched, the prediction model loses focus due to the sparse historical data, and can only be forcibly covered by high redundancy resources, which further reduces the cluster utilization rate; complex constraints such as multi-tenant fairness and cascading fault isolation require repeated manual parameter tuning, resulting in linear expansion of the expert rule base, and the graphics processing unit (GPU) inference tasks and massive storage tasks will increase costs.

[0019] The first approach to related technologies achieves dynamic computing power scheduling through a unified application programming interface (API), policy templates, and data definition verification, but it does not clearly define how to dynamically adapt to heterogeneous computing resources, which may lead to template rigidity.

[0020] The second approach to related technologies constructs a complete closed loop of proactive prevention, precise location, and intelligent repair through multi-level dependency graphs, causal models, and multi-dimensional anomaly detection methods. However, this approach relies on Bayesian networks, PC (Peter-Clark) / Greedy Equivalence Search (GES) algorithms, Granger causality tests, and counterfactual reasoning, requiring a large amount of labeled data and expert rules, and thus has stringent data quality requirements. This approach integrates statistical, density clustering, autoencoder, and isolated forest models, incorporating weighted dependency experience, making it prone to overfitting or false positives, and incurring high computational costs. It can only automate standardized faults (such as service restarts and cache clearing), while complex root causes (such as kernel bugs and hardware microcode defects) still require manual intervention, leading to a "semi-automatic" trap.

[0021] The third approach to related technologies attempts to address the pain points of resource and demand mismatch and lack of time-dimensional prediction in traditional scheduling algorithms through a chain of "task characteristics → prediction model → similar task comparison → EMD decomposition → correlation correction → dynamic deployment". However, this approach relies on a large amount of complete historical task features and multi-point-of-time resource usage data. When new services are launched or clusters are migrated, data sparsity leads to prediction distortion. Task features are subdivided into type, function, number of users, response time, central processing unit (CPU), memory, etc., and require manual annotation, resulting in high operation and maintenance costs.

[0022] To address the technical problems existing in related technologies, this application proposes a technical solution based on embodiments of the present application. This application proposes a method for neural network training and computing resource scheduling. In this embodiment, computing resource scheduling can be implemented based on reinforcement learning (RL) algorithms. Reinforcement learning algorithms are divided into value function-based algorithms and policy-based algorithms. In value function-based algorithms, there are two types of policy evaluation, which can be denoted as... and . It can be expressed by formula (1).

[0023] (1) in, It is a discount factor. It is the reward at time t. Indicating in strategy Next from state Initial expected cumulative discount reward value, T It is an integer greater than 0.

[0024] It can be expressed by formula (2).

[0025] (2) here, Indicating in strategy Under guidance in the state Take action below And the expected reward for continuing to take action.

[0026] For example, It can also be expressed by formula (3).

[0027] (3) here, Is the agent in the policy Below, in state The expected reward for taking all available actions.

[0028] Understandably, when in state There exists an action Make This indicates the action. With strategy To achieve better results, you can adjust the parameters to select the action. The probability increases.

[0029] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the embodiments provided herein are merely illustrative of the embodiments of this application and are not intended to limit the embodiments of this application. Furthermore, the embodiments provided below are some embodiments for implementing this application, and not all embodiments for implementing this application. Unless otherwise specified, the technical solutions described in the embodiments of this application can be implemented in any combination.

[0030] It should be noted that, in the embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method or apparatus that includes a list of elements includes not only the elements expressly described, but also other elements not expressly listed, or elements inherent to implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other related elements (e.g., steps in the method or units in the apparatus, such as portions of circuitry, processors, programs, or software, etc.) in the method or apparatus that includes that element.

[0031] The neural network training and computing resource scheduling method provided in this application includes a series of steps, but the neural network training and computing resource scheduling method provided in this application is not limited to the steps described.

[0032] This application provides a neural network training method that can be applied to electronic devices. Figure 1 This is a flowchart of a neural network training method according to an embodiment of this application, such as... Figure 1 As shown, the process includes: Step 101: After obtaining the target batch of experience samples from the experience pool, and training DQN sequentially using the first part of the experience samples to the Mth part of the experience samples from the target batch, determine the average value of the temporal difference error of the Mth part of the experience samples and the median of the temporal difference error of each experience sample in the experience pool; the target batch of experience samples is any batch of experience samples in the experience pool, M is an integer greater than 1, each part of the experience samples in the target batch includes multiple experience samples, and DQN is used to implement computing resource scheduling.

[0033] In this embodiment, the training process of DQN can be completed by establishing Q-values ​​related to states and actions in scenarios where the agent interacts with the environment. The main goal of training is to continuously optimize the Q-value table so that the agent can make optimal decisions. Temporal difference is a method for estimating policy value functions, which combines the ideas of Monte Carlo and dynamic programming algorithms. Unlike Monte Carlo scoring, temporal difference does not need to wait until the entire scenario ends to calculate the reward, but can estimate the temporal difference error at the end of each time step. The temporal difference algorithm uses the currently obtained reward and the value estimate of the next state to update the value estimate of the current state, so that the value function can be updated at each time step. For example, Indicates the state at time t. Indicates from state Initial expected cumulative discount reward value, The corresponding time-series difference update formula is formula (4).

[0034] (4) in, Represents the state from time t+1 The initial estimate of the expected cumulative discount reward value. It is the learning rate. Is with The corresponding timing difference error. It can be seen from formula (4) that... Multiplying by the timing difference error, we can obtain The update amount. When the agent interacts with the environment, each sampling step can be updated using a temporal difference algorithm. The estimated value.

[0035] For example, the time-series difference update formula for the Q value is formula (5).

[0036] (5) in, This represents the action taken at time t. Indicates the state Take action below The obtained Q value, Indicates the state Execute The instant rewards received This represents the maximum Q value obtained by taking all actions at time t+1, which can be achieved using formula (5). Update parameters Used to control the magnitude of each update.

[0037] In this embodiment, DQN is used to implement computing resource scheduling, and empirical samples represent the sample data used to train DQN. Through the fitting capability of neural networks, DQN can effectively handle continuous state and action spaces, achieving estimation and optimization of Q-values.

[0038] The experience pool can include multiple batches of experience samples. The target batch of experience samples is any batch of experience samples in the experience pool. The batch size of each batch of experience samples can be set according to actual needs; for example, the batch size of each batch of experience samples is 16. Each batch of experience samples can include multiple experience samples. After calculating the time-series difference error of each experience sample, the average time-series difference error of the Mth part of experience samples and the median time-series difference error of the target batch of experience samples can be determined. For example, with the state... The corresponding empirical sample can be denoted as , and state The temporal difference error of the corresponding empirical sample can be denoted as: The average time-series difference error of the Mth empirical sample can be denoted as: The median of the temporal difference error of each empirical sample in the experience pool can be denoted as: .

[0039] Step 102: Based on the comparison results of the mean and the median, adjust the sampling priority of each part of the empirical samples in the target batch; the sampling priority is used to determine the selection order of empirical samples when training DQN; according to the sampling priority of each empirical sample in the empirical pool, select empirical samples for training DQN in the empirical pool in sequence.

[0040] In this embodiment, a Prioritized Experience Replay (PER) mechanism can be used to dynamically adjust the sampling priority of each part of the experience samples. The Prioritized Experience Replay mechanism is described below with reference to the accompanying drawings. Figure 2 A batch of experience samples is selected from the experience pool according to sampling priority. This selected batch of experience samples is then divided into multiple parts of experience samples. Figure 2 In this process, the selected batch of experience samples can be divided into four parts of experience samples. When training DQN sequentially using multiple parts of experience samples, the sampling priority of each part of experience samples can be adjusted through steps 101 to 102. That is, a priority experience replay mechanism can be used to dynamically adjust the sampling priority of each part of experience samples.

[0041] In this embodiment, by introducing a priority experience replay mechanism, it helps ensure that the input data meets the requirement of independent and identically distributed distribution during network updates, while breaking the temporal correlation between data. Experience replay not only improves data utilization efficiency but also reduces correlation bias during training, thereby enabling more effective data utilization for training.

[0042] For example, in the calculation and Then, it can be calculated according to formula (6). and The difference Through the difference It can be confirmed and The comparison results.

[0043] (6) Step 103: Continue training DQN based on the selected empirical samples.

[0044] In practical applications, steps 101 to 103 can be implemented based on a processor and a communication interface. The processor can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), CPU, controller, microcontroller, and microprocessor.

[0045] As can be seen, when DQN is trained sequentially using the first part to the Mth part of the experience samples in the target batch, this embodiment can dynamically adjust the selection order of experience samples during DQN training based on the comparison between the average value of the temporal difference error of the Mth part of experience samples and the median of the temporal difference error of each experience sample in the experience pool. When facing constantly changing resource requirements and diverse task scenarios, experience samples can be determined according to resource requirements and task scenarios, and then the selection order of experience samples during DQN training can be accurately adjusted according to the temporal difference error of the experience samples. This can improve the computing resource scheduling performance of the trained DQN. Since DQN is used to implement computing resource scheduling, this embodiment can achieve more accurate allocation of computing resources through the trained DQN.

[0046] Regarding the implementation method of adjusting the sampling priority of each part of the empirical samples in the target batch empirical samples based on the comparison result of the mean and the median, in some embodiments, the sampling priority of each part of the empirical samples in the target batch empirical samples can be reduced when the mean is less than the median; and the sampling priority of each part of the empirical samples in the target batch empirical samples can be increased when the mean is greater than the median.

[0047] In this embodiment, if the average temporal difference error of the Mth part of the experience samples is less than the median temporal difference error of each experience sample in the experience pool, the training effect of the target batch of experience samples can be considered good. In this case, reducing the sampling priority of each part of the experience samples in the target batch is beneficial to increasing the selection probability of experience samples in other batches, thereby improving the training effect of DQN through experience samples in other batches. If the average temporal difference error of the Mth part of the experience samples is greater than the median temporal difference error of each experience sample in the experience pool, the training effect of the target batch of experience samples can be considered poor, and the temporal difference error corresponding to the target batch of experience samples is in a state of overall largeness. In this case, increasing the sampling priority of each part of the experience samples in the target batch is beneficial to increasing the selection probability of the target batch of experience samples, thereby facilitating continued training of DQN through the target batch of experience samples, and thus improving the training effect of DQN.

[0048] For example, when adjusting the sampling priority of each part of the empirical samples in the target batch of empirical samples, the adjustment range of the sampling priority of the i-th part of the empirical samples in the target batch of empirical samples is negatively correlated with the value of i, where the value of i is from 1 to M.

[0049] Understandably, when DQN is trained sequentially using the first to the Mth parts of the target batch of experience samples, the influence of these experience samples on DQN gradually weakens. Therefore, when the adjustment range of the sampling priority of the i-th part of the target batch of experience samples is negatively correlated with the value of i, it is possible to reasonably determine the adjustment range of the sampling priority based on the influence of each part of the experience samples on DQN. That is, when the influence of the i-th part of the experience samples on DQN is significant, a larger adjustment range of the sampling priority is set; when the influence of the i-th part of the experience samples on DQN is significant, a smaller adjustment range of the sampling priority is set.

[0050] For example, when the batch size of each batch of empirical samples is 16, a batch of empirical samples can be selected from the empirical pool according to the sampling priority. The selected batch of empirical samples includes 16 empirical samples. Then, these 16 empirical samples are divided into 4 parts of empirical samples, with each part containing 4 empirical samples. Then, the average time difference error of the 4th part of empirical samples is calculated. And calculate the median of the temporal difference error for each empirical sample in the empirical pool. .if Greater than or equal to This indicates that the training effect of the selected batch of experience samples is poor, and the sampling priority of the selected batch of experience samples can be increased, referring to... Figure 3 In this batch of empirical samples, the influence of the first to fourth empirical samples on DQN gradually weakens. Therefore, it can be determined that the adjustment range of the sampling priority of the first to fourth empirical samples gradually decreases. If Less than If the training effect of the selected batch of experience samples is considered to be good, then the sampling priority of each part of the selected batch of experience samples is reduced.

[0051] For example, the sampling priority of any empirical sample in the i-th part of the empirical samples can be denoted as: In the The sampling priority obtained after adjustment can be denoted as: , It can be calculated using formula (7).

[0052] (7) in, This represents the set constraint coefficient. It is a constant greater than 0 and less than 1. The amplitude coefficient is used to control the maximum magnitude of a single priority increase or decrease, and to avoid sampling imbalance caused by excessive differences in sample priorities. The larger the value, the more drastic the change in the sampling priority of the empirical sample. Indicates rounding down. This is the set attenuation rate when adjusting the sampling priority. This is used to implement block-based differential attenuation of empirical samples, amplifying and adjusting the intensity of at least one portion of the empirical samples from the earlier training stages. It is a constant greater than 0 and less than 1. It is the number of the experience sample in the target batch of experience samples that requires adjustment of sampling priority.

[0053] For example, the initial value of the sampling priority of the j-th experience sample in the experience pool. It can be calculated using formula (8).

[0054] (8) in, This represents the temporal difference error corresponding to the j-th empirical sample in the experience pool. It is a constant greater than zero to prevent the probability of empirical samples from being 0, for example, .

[0055] For example, the sampling priority of the j-th experience sample in the experience pool can be denoted as: According to formula (9), the sampling probability of the j-th experience sample in the experience pool can be calculated. .

[0056] (9) in, This indicates the sampling priority of the k-th experience sample in the experience pool. It is a set coefficient used to control the relationship between sampling priority and sampling probability. This indicates the sampling priority of each experience sample in the experience pool. The sum of powers.

[0057] For example, dynamically adjusting the sampling priority of each part of the experience samples using a priority experience replay mechanism may include the following steps: Step A1: Initialize the experience pool.

[0058] The total number of experience samples in the experience pool (i.e., the capacity of the experience pool) can be denoted as: The number of experience samples in each batch of experience samples selected from the experience pool is B, and the number of experience samples in each part of the experience samples in each batch is... .

[0059] Step A2: As the agent continuously interacts with the environment, the collected experience samples are stored in the experience pool.

[0060] Step A3: Select B experience samples from the experience pool according to the sampling priority, and divide the selected B experience samples into... Partial empirical sample.

[0061] Step A4: When completing the training of DQN in this round using B empirical samples, adjust the sampling priority of the selected B empirical samples.

[0062] The implementation method for this step has been explained in the aforementioned content.

[0063] Step A5: Return to step A2 to begin the next round of DQN training.

[0064] In this embodiment, the DQN network includes a Q network and a target Q network. In some embodiments, each empirical sample can be processed by the Q network to obtain a first Q value; each empirical sample can be processed by the target Q network to obtain a second Q value; the first Q value represents the Q value obtained by taking the current action in the current state, and the second Q value represents the maximum Q value obtained by taking all actions in the next state; the temporal difference error of each empirical sample is calculated based on the first Q value and the second Q value.

[0065] For example, refer to Figure 4 and Figure 5 The Q-network consists of an input layer, three convolutional layers, and two fully connected layers; the target Q-network has the same network structure as the Q-network. (See reference...) Figure 5 The first Q-value can be output through the Q-network, and the second Q-value can be output through the target Q-network. The first Q-value is... The second Q value is According to formula (10), the state can be calculated. Temporal difference error of corresponding empirical samples .

[0066] (10) Understandably, the embodiments of this application can accurately calculate the first Q value and the second Q value using the Q network and the target Q network, and then the temporal difference error of each empirical sample can be calculated relatively accurately using the first Q value and the second Q value.

[0067] In this embodiment, the parameters of the target Q-network can also be updated. In some embodiments, the parameters of the target Q-network can be updated periodically according to the parameters of the Q-network at update intervals.

[0068] Here, the update interval can be set according to actual needs, for example, the update interval can be 1000 time steps.

[0069] As can be seen, the embodiments of this application can introduce a target Q-network and use a delayed-updated target Q-network to calculate the Q-value. This mechanism greatly improves the stability and convergence of network training, helps reduce fluctuations during DQN training, and helps improve the learning efficiency of DQN.

[0070] This application also provides a computing resource scheduling method that can be applied to electronic devices. Figure 6 This is a flowchart of the computing resource scheduling method according to an embodiment of this application, such as... Figure 6As shown, the process includes: Step 601: Determine the data to be processed, which includes the state space, action space, and reward function corresponding to the computing resource scheduling task.

[0071] Step 602: Process the data to be processed through the DQN network to obtain a reward value, which includes the Q value obtained when performing each action in the action space in the current state.

[0072] Here, the DQN network is trained based on any of the neural network training methods mentioned above. For example, at time t, the current state is state t. .

[0073] Step 603: Based on the reward value, determine the action to be executed in the current state in the action space, and realize the scheduling of computing resources by executing the action to be executed.

[0074] In practical applications, steps 601 to 603 can be implemented based on a processor and a communication interface. The processor can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.

[0075] It can be seen that the DQN network is trained based on any of the above neural network training methods. In the neural network training methods, the deep Q-network DQN can be trained sequentially using the first part of the experience samples to the Mth part of the experience samples in the target batch. In this case, the selection order of experience samples during DQN training can be dynamically adjusted based on the comparison between the average value of the temporal difference error of the Mth part of experience samples and the median of the temporal difference error of each experience sample in the experience pool. When facing constantly changing resource requirements and diverse task scenarios, experience samples can be determined according to resource requirements and task scenarios, and then the selection order of experience samples during DQN training can be accurately adjusted according to the temporal difference error of the experience samples. This can improve the computing resource scheduling performance of the trained DQN. Therefore, the DQN trained can achieve relatively accurate allocation of computing resources.

[0076] In this embodiment, the state space and action space can be set according to actual needs. In some embodiments, the state space includes multiple states determined by the characteristics of computing resources and the characteristics of computing resource scheduling tasks; the action space includes various actions for allocating computing resources. In this way, the reward value related to computing resource scheduling operations can be determined more accurately based on the multiple states determined by the characteristics of computing resources and the characteristics of computing resource scheduling tasks, as well as the various actions for allocating computing resources. Therefore, the action to be executed in the current state can be determined more accurately based on the reward value related to computing resource scheduling operations.

[0077] In this embodiment of the application, after the computing resource scheduling is achieved through step 603, DQN training can continue. In some embodiments, refer to Figure 7 Resource scheduling methods based on reinforcement learning algorithms may include the following steps: Step 71: Perform initialization settings.

[0078] For example, the computing power scheduling platform may include three different types of resource nodes: storage resource nodes, computing resource nodes, and training resource nodes. For each resource node, the total resource amount, node type, and network latency matrix can be recorded. Then, probes can be deployed to collect information about the resource nodes; for example, the probes can collect data per second on the resource node's resource utilization rate, task queue length, and energy consumption. This step can be implemented by: determining the state space, determining the action space, and determining the reward function.

[0079] In some embodiments, the state space includes multiple states determined by node-level features, task-level features, and system-level features. For example, node-level features... It can be expressed by formula (11).

[0080] (11) in, Indicates CPU utilization. Indicates GPU utilization. Indicates memory usage. This indicates the input / output (I / O) rate of the storage device. C is a positive integer.

[0081] Task-level features It can be expressed by formula (12).

[0082] (12) in, The encoding that indicates the task type Indicates the size of the input data. This indicates the computational complexity. D is a positive integer.

[0083] System-level features It can be expressed by formula (13).

[0084] (13) in, This indicates the total number of tasks to be scheduled. This represents the average load of each resource node. This indicates the network congestion index.

[0085] The action space includes various actions for allocating computing resources. For example, it can be based on... Define the action space. It can be expressed by formula (14).

[0086] (14) in, Indicates the target node's number or unique identifier. This indicates the number of CPU cores allocated to the task. This indicates the number of GPUs allocated to this task. This indicates the path to the storage volume that the task is mounted on, or the identifier of the storage volume that the task is mounted on.

[0087] reward function It can be expressed by formula (15).

[0088] (15) in, Indicates the task completion time, for example, This indicates the total or average completion time of all tasks in the current scheduling batch from enqueuing to completion. This represents the overall resource utilization of each CPU and GPU in the cluster of resource nodes. The value of is between 0 and 1. This represents the total energy consumption of the cluster, representing the resource nodes. This indicates an energy consumption penalty. It represents the standard deviation of the load across all resource nodes in the cluster, and is used to measure the load differences between resource nodes. The weights representing the task completion delay. express The weight, express The weight, This represents the weights of Loadstd. For example, at the initial moment, , , , .

[0089] Step 72: Select an action in the action space.

[0090] One implementation of this step is as follows: the user submits task data through an Application Programming Interface (API), and the task data can be represented as... In the task data, `id` represents a globally unique task identifier; `type` represents the task type encoding. For example, the task type can be CPU-intensive, GPU-intensive, or I / O-intensive. For instance, CPU-intensive tasks could be data cleaning, backend inference, etc.; GPU-intensive tasks could be large model training, image rendering, etc.; and I / O-intensive tasks could be big data read / write, log storage, etc. This indicates the size of the dataset that the task needs to read and write. Used to indicate storage requirements. In task data, `demand` represents the hardware requirements for completing the task, for example, in... The system requires at least a 4-core CPU, a 1-GPU, and 16GB of RAM to complete the task. After the user submits the task data, the agent reads the current state and uses an ε-greedy strategy to select actions. Actions selected using an ε-greedy strategy. It can be expressed by formula (16).

[0091] (16) In formula (16), Indicates the current state. This represents the Q-value obtained by taking an action in the current state. Indicates that The action of finding the maximum value.

[0092] Step 73: Perform the action and determine the initial value of the sampling priority of the experience sample.

[0093] In this step, an action can be performed to obtain the next state. Perform an action in the current state. Rewards received The termination flag "done" is used to set the quintuple. Stored into the experience pool; for example, the capacity of the experience pool is... After storing the quintuples in the experience pool, the initial value of the sampling priority of the experience samples can be calculated using formula (8).

[0094] Step 74: Determine whether DQN training has been triggered. If yes, proceed to step 75; otherwise, return to step 72.

[0095] In practical applications, DQN training can be triggered every K time steps. If DQN training is not triggered, return to step 72. If DQN training is triggered, execute step 75.

[0096] Step 75: Train DQN, then proceed to step 76.

[0097] For example, in this step, 16 experience samples can be selected from the experience pool according to the sampling priority, and the selected 16 experience samples can be divided into M parts of experience samples, for example, M equals 4. Here, when training DQN with any one experience sample, the loss of DQN can be calculated according to formula (17). .

[0098] (17) in, .

[0099] The loss of DQN for each empirical sample in each empirical sample set. By averaging, the loss of DQN corresponding to each part of the empirical samples can be obtained.

[0100] During the training of DQN, the sampling priority of each subset of empirical samples in the selected empirical samples is adjusted. For example, when... Greater than or equal to When, determine that the flag bit is equal to 1; when Less than When the flag is set to 0, the sampling priority of the j-th empirical sample in the target batch can be adjusted according to formula (18). , (18) Wherein, block_id represents the number of the part of the experience samples in the target batch of experience samples where the j-th experience sample is located, that is, it is used to indicate which part of the experience samples in the target batch of experience samples the j-th experience sample is located in.

[0101] After adjusting the sampling priority of each empirical sample in the selected empirical samples, the convergence of DQN is determined based on its loss. If DQN does not converge, empirical samples are added to the empirical pool according to the sampling priority, and DQN training continues. If DQN converges, the parameters of the target Q-network are updated every 1000 time steps based on the parameters of the Q-network. Then, step 76 is executed.

[0102] Step 76: Execute a phased scheduling strategy based on DQN, and then execute step 77.

[0103] Here, a phased scheduling strategy can be executed based on each stage of computing resource scheduling. For example, if computing resources need to be allocated in the initial stage, then... Increased to 0.5. Cross-node migration is allowed during the computation phase, therefore, [the following can be done / implemented]: and Perform a balancing configuration. Gradually release redundant resources during the optimization phase; at this time, you can... Increased to 0.3.

[0104] Step 77: Determine whether the computing resource scheduling task has ended. If not, return to step 72; if yes, end the process.

[0105] Here, relevant logs can be output when the process ends.

[0106] The following is an example illustrating how the parameters of the target Q-network are updated. Initializing parameters. After adjusting the sampling priority of each part of the selected empirical samples, the results can be updated according to formulas (19) and (20). .

[0107] (19) (20) in, This represents the importance sampling weight of the j-th experience sample in the experience pool. It can be a set value; This represents the maximum value of the importance sampling weights of all experience samples in the experience pool. This indicates the importance sampling index set. This indicates that the Q-network is in state-action pairs Network parameters gradient, Let j be the state and action corresponding to the j-th experience sample in the experience pool. This is the cumulative value of the parameter update. These are the parameters of the Q-network.

[0108] Every 1000 time steps, the parameters of the target Q-network can be updated according to formula (21), and then reset. .

[0109] (twenty one) in, The set learning rate.

[0110] In summary, this application proposes a resource scheduling method based on reinforcement learning algorithms. This method abandons traditional static rules and complex causal reasoning, achieving a unified goal of rapid resource startup, high real-time performance, low cost, and high utilization. Utilizing an ε-greedy strategy and a priority experience replay mechanism, an effective scheduling strategy is generated upon task deployment. CPUs, GPUs, Tensor Processing Units (TPUs), and FPGAs are treated as discrete instructions within the same action space. Combined with node-level, task-level, and system-level three-dimensional state features, cross-architecture collaborative scheduling is achieved. The sampling priority of experience samples is dynamically adjusted to ensure high-frequency reuse of high-value experience samples, avoiding overfitting and false alarms. The weights of the multi-objective reward function are automatically updated by the reinforcement learning agent, eliminating the need for an expert rule base.

[0111] This application employs a priority dynamic adjustment framework based on priority experience replay. This framework enables dynamic adjustment of experience samples during training, ensuring high-value experience samples are reused frequently while automatically suppressing the influence of noise or overfitting samples. This addresses the training oscillations and slow convergence issues caused by fixed priorities or manual thresholds in related technologies. For example, this application can train 16 sampled experiences sequentially into four blocks of experience samples, and uniformly calculate the mean of the temporal difference error after the last block is trained. This reduces the number of GPU synchronizations, increases throughput, and lowers the computational overhead caused by frequent graph updates in causal inference schemes of related technologies. For example, this application can update the target network parameters only every 1000 steps, coupled with the priority dynamic adjustment mechanism, further improving training stability and reducing the divergence risk of DQN due to frequent changes in the target Q-value.

[0112] This application's embodiments can employ a priority dynamic adjustment framework and real-time probes, allowing new services to be launched without waiting for extensive historical annotations. Simultaneously, a single DQN replaces complex models such as Bayesian networks and density clustering, combining experience replay, delayed synchronization, and mini-batch block training to reduce training time by over 30% and virtually eliminate overfitting false alarms. The action space uses triples composed of resource type, node, and quota to cover heterogeneous resources such as CPU, GPU, TPU, and FPGA in one go. Through multi-dimensional coupled state spaces, collaborative decision-making on storage, computing, and training resources is achieved, overcoming the limitations of single-resource templates. The reward function incorporates task completion speed, resource fragmentation, energy consumption, and Service-Level Agreement (SLA) breach into a single, learnable weight system. A phased scheduling strategy achieves rapid resource provisioning in the early stages of a task, cross-node balancing in the middle stages, and gradual recovery of redundant resources in the later stages. Furthermore, all state-action-reward links can be exported with a single click, enabling real-time visualization of the distribution of time-series errors. This preserves causal traceability without requiring expert annotation, significantly improving system interpretability and fault location efficiency.

[0113] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0114] It should be noted that, in the embodiments of this application, if the above-described methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a terminal, server, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.

[0115] Correspondingly, this application embodiment further provides a computer program product, the computer program product including computer executable instructions, which are used to implement any neural network training method or any computing resource scheduling method provided in this application embodiment.

[0116] Accordingly, this application embodiment further provides a computer storage medium storing computer-executable instructions, which are used to implement any neural network training method or any computing resource scheduling method provided in the above embodiments.

[0117] This application also provides an electronic device. Figure 8 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application, as shown below. Figure 8 As shown, the electronic device 80 may include: Memory 801 is used to store executable instructions; The processor 802 is used to execute executable instructions stored in the memory 801 to implement any of the above-mentioned neural network training methods or any of the computing resource scheduling methods.

[0118] The processor 802 mentioned above can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.

[0119] The aforementioned computer-readable storage medium and memory 801 may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc.; or it may be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0120] In some embodiments, the functions or modules of the apparatus provided in this application can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0121] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.

[0122] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined to obtain new method embodiments without conflict.

[0123] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0124] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0125] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0126] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims. All of these forms are within the protection scope of this application.

Claims

1. A neural network training method, characterized in that, The method includes: In the case of acquiring a target batch of experience samples from the experience pool, and sequentially training a deep Q-network (DQN) using experience samples from the first part to the Mth part of the target batch, the average temporal difference error of the Mth part of the experience samples and the median temporal difference error of each experience sample in the experience pool are determined; the target batch of experience samples is any batch of experience samples in the experience pool, M is an integer greater than 1, each part of the target batch of experience samples includes multiple experience samples, and the DQN is used to implement computing resource scheduling. Based on the comparison between the average and the median, the sampling priority of each part of the experience samples in the target batch is adjusted; the sampling priority is used to determine the selection order of the experience samples when training the DQN; based on the sampling priority of each experience sample in the experience pool, experience samples for training the DQN are selected sequentially in the experience pool. The DQN is then trained again based on the selected empirical samples.

2. The method according to claim 1, characterized in that, The step of adjusting the sampling priority of each part of the empirical samples in the target batch based on the comparison result of the average and the median includes: If the average value is less than the median, the sampling priority of each part of the experience samples in the target batch is reduced; if the average value is greater than the median, the sampling priority of each part of the experience samples in the target batch is increased.

3. The method according to claim 2, characterized in that, When adjusting the sampling priority of each part of the empirical samples in the target batch of empirical samples, the adjustment range of the sampling priority of the i-th part of the empirical samples in the target batch of empirical samples is negatively correlated with the value of i, where the value of i ranges from 1 to M.

4. The method according to claim 1, characterized in that, The DQN network includes a Q network and a target Q network; The method further includes: Each experience sample is processed by the Q-network to obtain a first Q-value; each experience sample is processed by the target Q-network to obtain a second Q-value; the first Q-value represents the Q-value obtained by taking the current action in the current state, and the second Q-value represents the maximum Q-value obtained by taking all actions in the next state; The temporal difference error of each empirical sample is calculated based on the first Q value and the second Q value.

5. The method according to claim 4, characterized in that, The method further includes: The parameters of the target Q-network are periodically updated according to the parameters of the Q-network at update intervals.

6. A method for scheduling computing resources, characterized in that, The method includes: Determine the data to be processed, which includes the state space, action space, and reward function corresponding to the computing resource scheduling task; The data to be processed is processed by a DQN network to obtain a reward value, which includes the Q value obtained when performing each action in the action space in the current state; the DQN network is trained based on the method described in any one of claims 1 to 5. Based on the reward value, the action to be executed in the current state is determined in the action space, and the computing resources are scheduled by executing the action to be executed.

7. The method according to claim 6, characterized in that, The state space includes multiple states determined by the characteristics of computing resources and the characteristics of computing scheduling tasks; the action space includes various actions for allocating computing resources.

8. An electronic device, characterized in that, The electronic device includes a processor and a memory for storing a computer program capable of running on the processor; wherein the processor is configured to run the computer program to perform the method according to any one of claims 1 to 5 or the method according to any one of claims 6 to 7.

9. A computer storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the method of any one of claims 1 to 5 or the method of any one of claims 6 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 5 or the method of any one of claims 6 to 7.