Resource scheduling method and device, equipment and medium
By monitoring the state of resource nodes in the cloud computing environment and determining the node type, the dynamic scheduling method switches or reassigns tasks when resource failures, solving the problem of slow scheduling response in the prior art, realizing the stability of the system and efficient utilization of resources.
Patent Information
- Application Number
- CN202411945586.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, when facing resource failures in the cloud computing environment, it is difficult to make timely and effective adjustments, resulting in system performance degradation or service interruption.
By monitoring the operating status of the resource node, determine the node type of the target resource node. If it is a key resource node, switch to its corresponding backup resource node to perform tasks; if it is not a key resource node, redefine the new resource node to perform tasks in the normal state resource node.
It realizes rapid switching or reallocating tasks in the event of resource failure, ensuring system continuity and stability, reducing the risk of service interruption and data loss, and reducing resource waste.
Smart Images

Figure CN119883618A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of cloud computing, and in particular to a resource scheduling method, a resource scheduling device, an electronic device, and a machine-readable storage medium. Background Art
[0002] With the rapid development of cloud computing technology, more and more enterprises and organizations choose to migrate their computing tasks to cloud platforms to take full advantage of the flexibility, scalability and cost-effectiveness of cloud computing. Cloud platforms usually have large-scale distributed computing resources. The main task of resource scheduling is to reasonably allocate and manage these resources to meet user needs, optimize performance, improve resource utilization, and ensure system reliability and high availability.
[0003] In related technologies, resource scheduling is mainly divided into two methods: static scheduling and dynamic scheduling. Among them, static scheduling is to allocate resources before the task is executed, and no adjustment is made during the task execution. Although this scheduling method is simple to implement, it cannot cope with changes in resource requirements and failures that may occur during task execution, which can easily lead to resource waste or task failure. Dynamic scheduling is to monitor the status of tasks and resources in real time, and dynamically allocate and adjust resources according to actual needs. This scheduling method can improve resource utilization and system flexibility.
[0004] However, existing dynamic scheduling methods often respond slowly to resource failures in cloud computing environments (such as server crashes, network interruptions, etc.), making it difficult to make timely and effective adjustments, which may lead to system performance degradation or service interruptions. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a resource scheduling method, a resource scheduling device, an equipment and a medium to solve the problem that the dynamic scheduling method in the prior art is difficult to make timely and effective adjustments when facing resource failures in a cloud computing environment, resulting in system performance degradation or service interruption.
[0006] In order to achieve the above-mentioned object, the first aspect of the present application provides a resource scheduling method, which is applied to a cloud computing system, wherein the cloud computing system includes a plurality of resource nodes, and the method includes:
[0007] Monitor the operating status of each resource node while the target resource node is executing the current computing task;
[0008] When it is detected that the running state of the target resource node is a fault state, determining the node type of the target resource node;
[0009] If the node type of the target resource node is a key resource node, the task of the target resource node is executed through the backup resource node corresponding to the target resource node;
[0010] If the node type of the target resource node is not a critical resource node, a new resource node and its task for executing the current computing task are determined from resource nodes whose running status is a normal status.
[0011] In an embodiment of the present application, the method further includes:
[0012] Get the status information of each resource node;
[0013] Determine the criticality evaluation value and reliability evaluation value of each resource node according to the status information of each resource node;
[0014] According to the criticality evaluation value and the reliability evaluation value of each resource node, a critical resource node and its corresponding backup resource node are determined from the plurality of resource nodes.
[0015] In the embodiment of the present application, the status information includes the mean time between failures, the mean time to repair, and the resource node information that has a dependency relationship with the resource node;
[0016] According to the status information of each resource node, determine the criticality evaluation value and reliability evaluation value of each resource node, including:
[0017] Constructing a node dependency graph according to the status information of each resource node; wherein the node dependency graph includes a plurality of nodes and an edge connecting two nodes having a dependency relationship, and each node in the node dependency graph represents a resource node;
[0018] Determining a criticality evaluation value of each resource node according to the node dependency graph;
[0019] For each resource node, a reliability evaluation value of the resource node is determined according to the mean time between failures and the mean time to repair of the resource node.
[0020] In the embodiment of the present application, according to the criticality evaluation value and reliability evaluation value of each resource node, a critical resource node and its corresponding backup resource node are determined from a plurality of resource nodes, including:
[0021] For each resource node, determine the backup urgency value of the resource node according to the criticality evaluation value and reliability evaluation value of the resource node;
[0022] Determine resource nodes whose backup urgency values meet preset node screening conditions as key resource nodes;
[0023] For each key resource node, a backup resource node corresponding to the key resource node is determined from resource nodes that have a dependency relationship with the key resource node and do not meet the preset node screening condition.
[0024] In an embodiment of the present application, the method further includes:
[0025] Obtaining the current computing task;
[0026] Determine the target resource node and its task for executing the current computing task by means of an improved optimization algorithm; wherein the improved optimization algorithm generates its fitness function based on a preset objective function, wherein the preset objective function aims to minimize the total cost of resource scheduling and maximize resource utilization, and the preset objective function has constraints;
[0027] Among them, the constraint conditions include a first resource quantity constraint and a second resource quantity constraint, the first resource quantity constraint is used to constrain the total amount of resources allocated to users to be less than or equal to the total amount of system resources, and the second resource quantity constraint is used to constrain the amount of resources allocated to a single user to be greater than or equal to the resource demand of the user.
[0028] In an embodiment of the present application, the target resource node and its task for executing the current computing task are determined by improving the optimization algorithm, including:
[0029] Initializing a particle swarm; wherein each particle in the particle swarm has an initial position and an initial velocity;
[0030] Based on the particle swarm, a preliminary task allocation plan is generated through a preset iterative update algorithm;
[0031] Initializing the population according to the preliminary task allocation plan;
[0032] Determining the inverse of the preset objective function as the fitness function of the improved genetic algorithm;
[0033] Based on the population and the fitness function, the improved genetic algorithm is solved to obtain an optimal task allocation scheme; wherein the optimal task allocation scheme includes target resource nodes and their tasks.
[0034] In an embodiment of the present application, the method further includes:
[0035] When the operating status of the target resource node executing the current computing task is normal and the node type of the target resource node is a key resource node, the operation data and data change information generated when the target resource node executes the task are synchronized to its corresponding backup resource node, and the backup resource node is updated with data.
[0036] A second aspect of the present application provides a resource scheduling device, which is configured in a cloud computing system, wherein the cloud computing system includes a plurality of resource nodes, and the device includes:
[0037] The status monitoring module is used to monitor the operating status of each resource node while the target resource node is executing the current computing task;
[0038] A fault node type determination module is used to determine the node type of the target resource node when the operating state of the target resource node is detected to be a fault state;
[0039] A first resource scheduling module, configured to execute the task of the target resource node through a backup resource node corresponding to the target resource node if the node type of the target resource node is a key resource node;
[0040] The second resource scheduling module is used to determine a new resource node and its task for executing the current computing task from resource nodes in a normal operating state if the node type of the target resource node is not a critical resource node.
[0041] The third aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the resource scheduling method described in the first aspect when executing the computer program.
[0042] A fourth aspect of the present application provides a machine-readable storage medium having instructions stored thereon, which, when executed by a processor, configures the processor to execute the resource scheduling method described in the first aspect above.
[0043] The resource scheduling method, device, equipment and medium provided by the present application, when monitoring that the target resource node executing the current computing task fails and the target resource node is a key resource node, immediately switch to the corresponding backup resource node, that is, use the backup resource node to replace the target resource node to execute the task; when monitoring that the target resource node executing the current computing task fails and the target resource node is not a key resource node, by re-determining a new resource node from the resource nodes in a normal operating state, use the new resource node to execute the current computing task. This method ensures the continuity and stability of the system by optimizing resource management, reduces the risk of service interruption and data loss caused by resource failure in the system, and reduces the waste of system resources.
[0044] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:
[0046] Figure 1 The following is a schematic diagram showing a flow chart of a resource scheduling method according to an embodiment of the present application;
[0047] Figure 2 The structure block diagram of the resource scheduling device according to the embodiment of the present application is schematically shown;
[0048] Figure 3 The internal structure diagram of the computer device according to the embodiment of the present application is schematically shown.
[0049] Description of Reference Numerals
[0050] A01-processor; A02-network interface; A03-internal memory; A04-display screen; A05-input device; A06-non-volatile storage medium; B01-operating system; B02-computer program. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0052] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back, etc.), such directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0053] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0054] In view of the fact that the dynamic scheduling method in the related art is difficult to make timely and effective adjustments when facing resource failures in a cloud computing environment, and there are problems such as system performance degradation or service interruption, the present application provides a resource scheduling method, device, equipment and medium. The resource scheduling method, device, equipment and medium provided by the present application are described in detail below in conjunction with the accompanying drawings through specific embodiments and implementation methods.
[0055] Figure 1 The schematic diagram of the resource scheduling method of the embodiment of the present application is shown schematically. Figure 1 As shown, in one embodiment of the present application, a resource scheduling method is provided, which is applied to a cloud computing system, wherein the cloud computing system includes multiple resource nodes, and the method may include the following steps.
[0056] Step 200: Monitor the operating status of each resource node while the target resource node is executing the current computing task.
[0057] The target resource node is a resource node included in the cloud computing system.
[0058] In a specific example, step 200 monitors the operating status of the target resource node in real time when executing its assigned task to ensure that when the operating status of the target resource node switches to a fault state, a task allocation plan can be quickly generated to improve the efficiency of responding to resource failures.
[0059] Step 400: When it is monitored that the running state of the target resource node is a fault state, determine the node type of the target resource node.
[0060] In the embodiment of the present application, the node type of the resource node in the cloud computing system is a key resource node or a common resource node, that is, the node type of the backup resource node corresponding to the target resource node is also a common resource node.
[0061] In a specific example, the node type of each resource node in the cloud computing system has been predetermined before executing step 200. Based on this, when the operating state of the target resource node is monitored to be a fault state, the node type of the target resource node can be immediately determined.
[0062] Step 600, if the node type of the target resource node is a critical resource node, the task of the target resource node is executed through the backup resource node corresponding to the target resource node; if the node type of the target resource node is not a critical resource node, a new resource node and its task for executing the current computing task are determined among the resource nodes in a normal operating state.
[0063] In the embodiment of the present application, for a key resource node, the number of its corresponding backup resource nodes is one or more.
[0064] In a specific example, when the operating state of the target resource node is a faulty state and the node type of the target resource node is a critical resource node, if the target resource node corresponds to only one backup resource node, the task assigned to the target resource node is directly executed by the backup resource node; if the target resource node corresponds to multiple backup resource nodes, the task assigned to the target resource node is evenly distributed to each backup resource node.
[0065] In an embodiment of the present application, when the operating status of the target resource node is a faulty state and the node type of the target resource node is not a critical resource node, a new resource node and its task for executing the current computing task can be determined from the resource nodes whose operating status is a normal state through the existing resource allocation method.
[0066] It is worth mentioning that in an embodiment of the present application, the step 600 determines the new resource node and its task for executing the current computing task from the resource nodes in a normal operating state. There are multiple implementation methods, for example: determining other resource nodes except the target resource node in a faulty operating state as pending resource nodes, or determining other resource nodes in a normal operating state except the target resource node whose node type is a critical resource node as pending resource nodes, or determining other resource nodes in a normal operating state except the target resource node whose node type is a critical resource node and its corresponding backup resource node as pending resource nodes, and determining the new resource node and its task for executing the current computing task from the pending resource nodes.
[0067] It can be seen that the resource scheduling method provided by the embodiment of the present application immediately switches to the corresponding backup resource node when it is detected that the target resource node executing the current computing task fails and the target resource node is a key resource node, that is, the backup resource node is used to replace the target resource node to execute the task; when it is detected that the target resource node executing the current computing task fails and the target resource node is not a key resource node, a new resource node is re-determined from the resource nodes in the normal operating state, and the new resource node is used to execute the current computing task. This method ensures the continuity and stability of the system by optimizing resource management, reduces the risk of service interruption and data loss caused by resource failure, and reduces the waste of system resources.
[0068] Furthermore, in an embodiment of the present application, in order to determine the node type of each resource node, the method also includes the following steps.
[0069] Step 110: Obtain status information of each resource node.
[0070] In an embodiment of the present application, the resource nodes included in the cloud computing system may be virtual machines, containers, storage resources, network resources, etc., and the status information of each resource node may include operating status, mean time between failures (MTBF), mean time to repair (MTTR) and information of resource nodes that have a dependency relationship with the resource node.
[0071] Step 120: Determine the criticality evaluation value and reliability evaluation value of each resource node according to the status information of each resource node.
[0072] In the embodiment of the present application, step 120 includes the following steps.
[0073] Step 121, constructing a node dependency graph according to the status information of each resource node.
[0074] The node dependency graph includes a plurality of nodes and edges connecting two nodes having a dependency relationship, and each node in the node dependency graph represents a resource node.
[0075] In a specific example, by determining which other resource nodes each resource node depends on, the resource nodes are represented as nodes using a graphical representation method, and the dependency relationships are represented as edges, thereby constructing a dependency graph of the resource nodes, i.e., the node dependency graph. Each edge in the graph has a direction, indicating that it points from one resource node to another resource node.
[0076] Step 122: Determine the criticality evaluation value of each resource node according to the node dependency graph.
[0077] In the embodiment of the present application, the step 122 determines the criticality evaluation value of each resource node by a first formula. The first formula is specifically:
[0078]
[0079] Among them, PR(i) represents the critical evaluation value of the i-th resource node in the cloud computing system, d represents the damping factor (which can be selected as 0.85), N represents the total number of resource nodes in the cloud computing system, M(i) represents the set of resource nodes pointing to the i-th resource node in the node dependency graph, PR(j) represents the critical evaluation value of the j-th resource node in the cloud computing system, and L(j) represents the out-degree of the j-th resource node in the cloud computing system, that is, the number of connections (i.e., the number of edges) starting from the j-th resource node.
[0080] Step 123: For each resource node, determine the reliability evaluation value of the resource node according to the mean time between failures and the mean time to repair of the resource node.
[0081] In the embodiment of the present application, the step 123 determines the reliability evaluation value of each resource node by a second formula. The second formula is specifically:
[0082]
[0083] Wherein, R(i) represents the reliability evaluation value of the i-th resource node in the cloud computing system, MTBF(i) represents the mean time between failures of the i-th resource node in the cloud computing system, and MTTR(i) represents the mean repair time of the i-th resource node in the cloud computing system.
[0084] In the embodiment of the present application, the criticality of resource nodes in the system is evaluated by using a topology analysis method, and the reliability of resource nodes in the system is evaluated by using MTBF and MTTR, so that the key resource nodes and their corresponding backup resource nodes can be determined more reasonably later. Specifically, the embodiment of the present application sets that only resource nodes with high criticality and relatively low reliability require more backup resources to achieve more targeted resource allocation, maximize resource utilization, and avoid resource waste.
[0085] Step 130 , determining a key resource node and its corresponding backup resource node from a plurality of resource nodes according to the criticality evaluation value and the reliability evaluation value of each resource node.
[0086] In the embodiment of the present application, step 130 includes the following steps.
[0087] Step 131 : for each resource node, determine the backup urgency value of the resource node according to the criticality evaluation value and the reliability evaluation value of the resource node.
[0088] In the embodiment of the present application, the step 131 determines the backup urgency value of each resource node by using a third formula. The third formula is specifically:
[0089] P(i)=w1PR(i)+w2R(i)
[0090] Wherein, P(i) represents the backup urgency value of the i-th resource node in the cloud computing system, w1 and w2 are both weight factors, and w1 and w2 are both constants, which can be preset according to specific circumstances.
[0091] Step 132: Determine resource nodes whose backup urgency values meet preset node screening conditions as key resource nodes.
[0092] In a specific example, the preset node screening condition is that the backup urgency value is greater than or equal to the preset judgment threshold, that is, resource nodes whose backup urgency value is greater than or equal to the preset judgment threshold are determined as key resource nodes.
[0093] Step 133: for each key resource node, determine a backup resource node corresponding to the key resource node from resource nodes that have a dependency relationship with the key resource node and do not meet the preset node screening condition.
[0094] In an embodiment of the present application, the step 133 of determining the backup resource node corresponding to the key resource node among the resource nodes that have a dependency relationship with the key resource node and do not satisfy the preset node screening condition can be implemented in multiple ways, for example: among the resource nodes that have a dependency relationship with the key resource node and do not satisfy the preset node screening condition, the resource node with the smallest backup urgency value or one or more resource nodes that have not executed the current computing task are determined as the backup resource node corresponding to the key resource node.
[0095] The embodiment of the present application evaluates the criticality and reliability of resource nodes in the system, screens out key resource nodes, and determines their corresponding backup resource nodes, thereby ensuring that when a key resource node fails, other resource nodes (i.e., their corresponding backup resource nodes) can quickly take its place and continue to execute tasks, thereby achieving fast and effective fault-tolerant processing and avoiding task execution failure or delay.
[0096] Furthermore, in an embodiment of the present application, the method for determining the target resource node of the current computing task includes the following steps.
[0097] Step 140, obtaining the current computing task.
[0098] Step 150: Determine the target resource node and its task for executing the current computing task by improving the optimization algorithm.
[0099] Wherein, the improved optimization algorithm generates its fitness function based on a preset objective function.
[0100] In the embodiment of the present application, the preset objective function aims to minimize the total cost of resource scheduling and maximize resource utilization, and the preset objective function has constraints. Specifically, the constraints include a first resource quantity constraint and a second resource quantity constraint, wherein the first resource quantity constraint is used to constrain the total amount of resources allocated to the user to be less than or equal to the total amount of system resources, and the second resource quantity constraint is used to constrain the amount of resources allocated to a single user to be greater than or equal to the resource demand of the user.
[0101] In a specific example, the preset objective function can be expressed as:
[0102]
[0103] Wherein, L represents the preset objective function, c v represents the cost of the vth resource, x uv represents the number of resources of the vth category allocated to the uth user, r v represents the total capacity of the vth resource, and α and β are weight factors. α and β are both constants, which can be preset according to specific circumstances.
[0104] In this specific example, the first resource quantity constraint can be expressed as:
[0105]
[0106] The second resource quantity constraint can be expressed as:
[0107]
[0108] Among them, d uv Represents the demand of the u-th user for the v-th resource.
[0109] The embodiment of the present application sets the preset objective function and its constraints, and subsequently generates a resource allocation plan based on it, which can not only ensure the rationality and effectiveness of resource allocation, improve overall resource utilization and overall performance, avoid resource waste, but also help optimize resource scheduling.
[0110] Furthermore, in the embodiment of the present application, step 150 includes the following steps.
[0111] Step 151, initializing the particle swarm.
[0112] Each particle in the particle group has an initial position and an initial velocity, and each particle corresponds to a task allocation scheme.
[0113] In a specific example, the specific operation of step 151 is: randomly initialize a particle swarm in n-dimensional space. In the particle swarm, the initial position of the i-th particle can be expressed as x i =(x i1 ,x i2 ,…,x in ), the initial velocity can be expressed as v i =(v i1 ,v i2 ,…,v in ).
[0114] Step 152: Based on the particle swarm, a preliminary task allocation plan is generated through a preset iterative update algorithm.
[0115] Based on the specific example in step 151 above, step 152 iteratively updates the velocity and position of the particle in the dth (d=1, 2, ..., n)-dimensional space according to the best individual in the current iteration through the following formula:
[0116]
[0117] in, and denote the position and velocity of the i-th particle in the k+1-th iteration, respectively. and They represent the position and velocity of the ith particle in the kth iteration, respectively. c1 and c2 are both constants. c1 represents the self-cognition number, c2 represents the social cognition coefficient, r1 and r2 are both random numbers between [0,1], and p id represents the individual optimal position found by the i-th particle, p gd Represents the global optimal position found by the entire particle swarm.
[0118] After repeatedly executing the first preset number of iterations, a preliminary task allocation plan can be output.
[0119] It can be understood that the embodiment of the present application is a preliminary task allocation scheme generated by a particle swarm optimization algorithm. During the iteration process, the position of each particle will gradually approach a more optimal task allocation scheme. After the iteration is completed, the solution corresponding to the position of the particle with the highest fitness in the particle swarm can be determined as the preliminary task allocation scheme.
[0120] Step 153: Initialize the population according to the preliminary task allocation plan.
[0121] The population includes a plurality of chromosomes, and each chromosome is a possible task allocation scheme.
[0122] Step 154: determine the inverse of the preset objective function as the fitness function of the improved genetic algorithm.
[0123] Among them, the fitness function is used to measure the quality of the chromosome solution. The higher the fitness of the chromosome, the greater the probability of being selected to generate the next generation.
[0124] Step 155: Solve the improved genetic algorithm based on the population and the fitness function to obtain an optimal task allocation solution.
[0125] The optimal task allocation scheme includes the target resource node and its tasks. After obtaining the optimal task allocation scheme, resource scheduling is performed according to the optimal task allocation scheme.
[0126] In a specific example, the specific operations of step 155 are as follows:
[0127] Perform a crossover operation on the initialized chromosome: select a crossover point and separate the parent's gene sequence from the crossover point; the sequence before the crossover point remains unchanged, and the gene sequence after the crossover point is exchanged.
[0128] After crossover, a mutation operation is performed: a gene is randomly selected and inserted into another random position.
[0129] After mutation, selection operation is performed: directly select the first b (the value can be set according to actual conditions) individuals with the highest fitness value to ensure that excellent genes will not be lost.
[0130] Repeat the above operation until the number of iterations reaches a second preset number of iterations.
[0131] Output the optimal task allocation plan: After reaching the second preset number of iterations, select the individual with the highest fitness as the optimal solution and output the optimal task allocation plan.
[0132] The embodiment of the present application uses the improved genetic algorithm to determine a task allocation scheme (i.e., the optimal task allocation scheme) that simultaneously minimizes the total cost of resource scheduling and maximizes resource utilization. Based on the task allocation scheme, dynamic resource allocation is efficiently performed, which can further solve the problem that some resources are idle for a long time while other resources have performance degradation due to overload and other reasons.
[0133] In a specific example, the step 600 also uses the improved optimization algorithm to determine the new resource node and its task for executing the current computing task.
[0134] Of course, it is understandable that the step 150 may also adopt the existing resource allocation method to determine the target resource node and its task for executing the current computing task.
[0135] Furthermore, in an embodiment of the present application, the method also includes the following steps.
[0136] Step 160, when the operating status of the target resource node executing the current computing task is normal and the node type of the target resource node is a key resource node, the operation data and data change information generated by the target resource node when executing the task are synchronized to its corresponding backup resource node, and the backup resource node is updated with data.
[0137] In a specific example, the operation data and data change information generated when the target resource node executes the task are synchronized to its corresponding backup resource node in real time or according to a preset synchronization cycle to ensure that the data of the backup resource node is consistent with the data of the key resource node.
[0138] When executing tasks at key resource nodes, the embodiments of the present application perform backup in the backup resource nodes corresponding to the key resource nodes, thereby ensuring that when a key resource node fails, its corresponding backup resource node can quickly take over the task. That is, the system can quickly recover when a resource failure occurs, reducing the impact of the failure on the system, and ensuring that the system can still run stably under high load and complex environments, thereby improving the overall performance of the system and user experience.
[0139] Application scenarios of the resource scheduling method provided in the embodiments of the present application may include:
[0140] Financial service systems need to process a large number of real-time transactions and data analysis, requiring extremely high system reliability and security. The backup of key resource nodes and task reallocation can ensure that the system can continue to process transactions in the event of a failure, thereby ensuring the integrity and security of financial data and enhancing user trust.
[0141] Online education platforms need to support a large number of users to conduct video learning, interactive Q&A, and resource downloads at the same time. The system is required to have high concurrent processing capabilities and stability, backup of key resource nodes, and task reallocation to ensure the stable operation of the online education platform during peak periods, thereby improving users' learning experience and platform availability.
[0142] For IoT applications, the ERP system needs to integrate and manage various business processes of the enterprise, requiring the system to have high reliability and data consistency. The backup of key resource nodes and task reallocation can ensure that the ERP system can continue to operate in the event of a failure, avoiding business interruption and data loss.
[0143] Figure 1 FIG. 1 is a flow chart of a resource scheduling method in one embodiment. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0144] Figure 2 The structure block diagram of the resource scheduling device of the embodiment of the present application is schematically shown. Figure 2As shown, in one embodiment of the present application, a resource scheduling device is provided, which is configured in a cloud computing system. The cloud computing system includes multiple resource nodes. The device may include the following functional modules.
[0145] The status monitoring module is used to monitor the operating status of each resource node while the target resource node is executing the current computing task.
[0146] The fault node type determination module is used to determine the node type of the target resource node when it is monitored that the running state of the target resource node is a fault state.
[0147] The first resource scheduling module is used to execute the task of the target resource node through the backup resource node corresponding to the target resource node if the node type of the target resource node is a key resource node.
[0148] The second resource scheduling module is used to determine a new resource node and its task for executing the current computing task from resource nodes in a normal operating state if the node type of the target resource node is not a critical resource node.
[0149] In the embodiment of the present application, the device may further include:
[0150] The status information acquisition module is used to obtain the status information of each resource node.
[0151] The evaluation value determination module is used to determine the criticality evaluation value and reliability evaluation value of each resource node according to the status information of each resource node.
[0152] The related node determination module is used to determine the key resource nodes and their corresponding backup resource nodes among multiple resource nodes according to the criticality evaluation value and reliability evaluation value of each resource node.
[0153] In the embodiment of the present application, the status information includes the mean time between failures, the mean time to repair, and the resource node information that has a dependency relationship with the resource node; the evaluation value determination module may include:
[0154] The graph construction unit is used to construct a node dependency graph according to the status information of each resource node. The node dependency graph includes a plurality of nodes and edges connecting two nodes having a dependency relationship. Each node in the node dependency graph represents a resource node.
[0155] The criticality evaluation value determination unit is used to determine the criticality evaluation value of each resource node according to the node dependency graph.
[0156] The reliability evaluation value determination unit is used to determine the reliability evaluation value of each resource node according to the mean time between failures and the mean time to repair of the resource node.
[0157] In the embodiment of the present application, the relevant node determination module may include:
[0158] The backup urgency value determination unit is used to determine the backup urgency value of each resource node according to the criticality evaluation value and the reliability evaluation value of the resource node.
[0159] The key resource node determination unit is used to determine the resource nodes whose backup urgency values meet the preset node screening conditions as key resource nodes.
[0160] The backup resource node determination unit is used to determine, for each key resource node, a backup resource node corresponding to the key resource node from resource nodes that have a dependency relationship with the key resource node and do not meet the preset node screening condition.
[0161] In the embodiment of the present application, the device may further include:
[0162] The task acquisition module is used to acquire the current computing task.
[0163] A task allocation module is used to determine the target resource node and its task for executing the current computing task through an improved optimization algorithm. The improved optimization algorithm generates its fitness function based on a preset objective function, and the preset objective function aims to minimize the total cost of resource scheduling and maximize resource utilization. The preset objective function has constraints. The constraints include a first resource quantity constraint and a second resource quantity constraint. The first resource quantity constraint is used to constrain the total amount of resources allocated to the user to be less than or equal to the total amount of system resources, and the second resource quantity constraint is used to constrain the amount of resources allocated to a single user to be greater than or equal to the resource demand of the user.
[0164] In an embodiment of the present application, the task allocation module may include:
[0165] The first initialization unit is used to initialize the particle group, wherein each particle in the particle group has an initial position and an initial velocity.
[0166] The first solution generating unit is used to generate a preliminary task allocation solution based on the particle swarm through a preset iterative updating algorithm.
[0167] The second initialization unit is used to initialize the population according to the preliminary task allocation plan.
[0168] The fitness function determination unit is used to determine the inverse of the preset objective function as the fitness function of the improved genetic algorithm.
[0169] The second solution generating unit is used to solve the improved genetic algorithm based on the population and the fitness function to obtain an optimal task allocation solution, wherein the optimal task allocation solution includes a target resource node and its tasks.
[0170] In the embodiment of the present application, the device may further include:
[0171] A data backup module is used to synchronize the operation data and data change information generated by the target resource node when executing the current computing task to its corresponding backup resource node, and update the data of the backup resource node when the operating status of the target resource node executing the current computing task is normal and the node type of the target resource node is a key resource node.
[0172] Since the resource scheduling device provided in the embodiment of the present application is a virtual device corresponding to the resource scheduling method of the above embodiment, it can also solve the problem that the dynamic scheduling method in the prior art is difficult to make timely and effective adjustments when facing resource failures in the cloud computing environment, resulting in system performance degradation or service interruption.
[0173] An embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the resource scheduling method described in the above embodiment when executing the computer program.
[0174] The electronic device provided in the embodiment of the present application includes a processor capable of running the resource scheduling method of the aforementioned embodiment, and can therefore also solve the problem that the dynamic scheduling method in the prior art is difficult to make timely and effective adjustments when facing resource failures in a cloud computing environment, resulting in system performance degradation or service interruption.
[0175] An embodiment of the present application provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the resource scheduling method described in the above embodiment.
[0176] The machine-readable storage medium provided in the embodiment of the present application stores instructions for enabling the machine to execute the resource scheduling method of the above embodiment. Therefore, it can also solve the problem that the dynamic scheduling method in the prior art is difficult to make timely and effective adjustments when facing resource failures in the cloud computing environment, resulting in system performance degradation or service interruption.
[0177] Figure 3 The internal structure diagram of the computer device of the embodiment of the present application is schematically shown. Figure 3 As shown, in one embodiment of the present application, a computer device is provided, which may be a terminal. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05 and a memory (not shown in the figure) connected via a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor A01, a resource scheduling method is implemented. The display screen A04 of the computer device may be a liquid crystal display or an electronic ink display, and the input device A05 of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0178] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure 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 certain components, or have a different arrangement of components.
[0179] In one embodiment, the resource scheduling device provided by the present application can be implemented in the form of a computer program. The computer program can be Figure 3 The computer device is run on the computer device shown. The memory of the computer device can store various program modules constituting the resource scheduling device, and the computer program composed of the various program modules enables the processor to execute the steps of the resource scheduling method of each embodiment of the present application described in this specification.
[0180] Figure 3 The computer device shown can be Figure 2 The status monitoring module in the resource scheduling device shown executes step 200, the fault node type determination module executes step 400, the first resource scheduling module executes step 600 to execute the task operation of the target resource node through the backup resource node corresponding to the target resource node, and the second resource scheduling module executes step 600 to determine the new resource node and its task for executing the current computing task among the resource nodes in normal operating status.
[0181] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0182] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0183] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0184] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0185] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0186] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0187] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0188] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0189] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A resource scheduling method, characterized in that: Applied to a cloud computing system, the cloud computing system includes a plurality of resource nodes, and the method includes: Monitor the operating status of each resource node while the target resource node is executing the current computing task; When it is detected that the running state of the target resource node is a fault state, determining the node type of the target resource node; If the node type of the target resource node is a key resource node, the task of the target resource node is executed through the backup resource node corresponding to the target resource node; If the node type of the target resource node is not a critical resource node, a new resource node and its task for executing the current computing task are determined from resource nodes whose running status is a normal status.
2. The method according to claim 1, characterized in that: The method further comprises: Get the status information of each resource node; Determine the criticality evaluation value and reliability evaluation value of each resource node according to the status information of each resource node; According to the criticality evaluation value and the reliability evaluation value of each resource node, a critical resource node and its corresponding backup resource node are determined from the plurality of resource nodes.
3. The method according to claim 2, characterized in that The status information includes the mean time between failures, the mean time to repair, and the information of resource nodes that are dependent on the resource node; According to the status information of each resource node, determine the criticality evaluation value and reliability evaluation value of each resource node, including: Constructing a node dependency graph according to the status information of each resource node; wherein the node dependency graph includes a plurality of nodes and an edge connecting two nodes having a dependency relationship, and each node in the node dependency graph represents a resource node; Determining a criticality evaluation value of each resource node according to the node dependency graph; For each resource node, a reliability evaluation value of the resource node is determined according to the mean time between failures and the mean time to repair of the resource node.
4. The method according to claim 2, characterized in that: According to the criticality evaluation value and reliability evaluation value of each resource node, a critical resource node and its corresponding backup resource node are determined from multiple resource nodes, including: For each resource node, determine the backup urgency value of the resource node according to the criticality evaluation value and reliability evaluation value of the resource node; Determine resource nodes whose backup urgency values meet preset node screening conditions as key resource nodes; For each key resource node, a backup resource node corresponding to the key resource node is determined from resource nodes that have a dependency relationship with the key resource node and do not meet the preset node screening condition.
5. The method according to claim 1, characterized in that The method further comprises: Obtaining the current computing task; Determine the target resource node and its task for executing the current computing task by means of an improved optimization algorithm; wherein the improved optimization algorithm generates its fitness function based on a preset objective function, wherein the preset objective function aims to minimize the total cost of resource scheduling and maximize resource utilization, and the preset objective function has constraints; Among them, the constraint conditions include a first resource quantity constraint and a second resource quantity constraint, the first resource quantity constraint is used to constrain the total amount of resources allocated to users to be less than or equal to the total amount of system resources, and the second resource quantity constraint is used to constrain the amount of resources allocated to a single user to be greater than or equal to the resource demand of the user.
6. The method according to claim 5, characterized in that Determining the target resource node and its task for executing the current computing task by improving the optimization algorithm includes: Initializing a particle swarm; wherein each particle in the particle swarm has an initial position and an initial velocity; Based on the particle swarm, a preliminary task allocation plan is generated through a preset iterative update algorithm; Initializing the population according to the preliminary task allocation plan; Determining the inverse of the preset objective function as the fitness function of the improved genetic algorithm; Based on the population and the fitness function, the improved genetic algorithm is solved to obtain an optimal task allocation scheme; wherein the optimal task allocation scheme includes target resource nodes and their tasks.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: When the operating status of the target resource node executing the current computing task is normal and the node type of the target resource node is a key resource node, the operation data and data change information generated when the target resource node executes the task are synchronized to its corresponding backup resource node, and the backup resource node is updated with data.
8. A resource scheduling device, characterized in that: Configured in a cloud computing system, the cloud computing system includes a plurality of resource nodes, and the device includes: The status monitoring module is used to monitor the operating status of each resource node while the target resource node is executing the current computing task; A fault node type determination module is used to determine the node type of the target resource node when the operating state of the target resource node is detected to be a fault state; A first resource scheduling module, configured to execute the task of the target resource node through a backup resource node corresponding to the target resource node if the node type of the target resource node is a key resource node; The second resource scheduling module is used to determine a new resource node and its task for executing the current computing task from resource nodes in a normal operating state if the node type of the target resource node is not a critical resource node.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the resource scheduling method according to any one of claims 1 to 7 is implemented.
10. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to execute the resource scheduling method according to any one of claims 1 to 7.