End-edge-cloud heterogeneous resource scheduling method and device based on RNN and particle swarm

Through a scheduling method based on RNN and particle swarm, dynamic programming and inverse Cantor expansion coding are used to optimize task sequences, solving the problems of unbalanced resource allocation and slow task response in edge cloud computing, and achieving more efficient resource utilization and scheduling strategies.

CN117453391BActive Publication Date: 2025-10-03SOUTH CHINA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311209509.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-19
Publication Date
2025-10-03
Estimated Expiration
2043-09-19

AI Technical Summary

Technical Problem

Existing technologies have problems such as unbalanced resource allocation, low utilization and slow task response in edge cloud computing architecture. In particular, there is a lack of effective integration methods on online scheduling platforms, and traditional algorithms fail to fully consider the impact of task scheduling order.

Method used

A scheduling method based on RNN and particle swarm is adopted. The data set is generated through dynamic programming to train the RNN model to identify the task sequence. The particle swarm algorithm is combined to optimize the task scheduling. The inverse Cantor expansion is used to process the sequential encoding. The inertia weight and fitness function are set to optimize the search space to obtain the optimal scheduling strategy.

Benefits of technology

It improves the online scheduling platform's ability to integrate offline algorithms, optimizes task allocation and scheduling order, and improves resource utilization and task response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117453391B_ABST
    Figure CN117453391B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for heterogeneous resource scheduling for edge and cloud based on RNN and particle swarm. The method includes: pre-processing tasks based on historical records to form a resource requirement table running on the client and obtaining information tables of each node on the client; building an RNN model, using an RNN model trained using a dataset generated by dynamic programming and capable of recognizing task sequences, to cache tasks posted online by users, thereby converting the online task scheduling problem into an offline scheduling problem. Offline scheduling is then performed using a particle swarm algorithm optimized for encoding using Cantor expansion, resulting in a scheduling strategy with comprehensive time-saving and load-balanced performance for online tasks. Compared to mainstream scheduling algorithms based on reinforcement learning, this method achieves efficient scheduling without requiring large amounts of training data or computing power.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of cloud computing resource scheduling, and specifically relates to a method and device for scheduling heterogeneous end-edge cloud resources based on RNN and particle swarm. Background Art

[0002] As a cutting-edge technology in today's information technology sector, cloud computing is widely used across various industries. Through the computing resources and services provided by cloud computing, users can meet their storage and computing needs without having to own their own physical servers or infrastructure. Furthermore, in a cloud computing environment, users are decoupled from the execution of tasks. Users no longer need to worry about how tasks are executed to achieve the highest efficiency, significantly reducing their burden. Users only need to pay for computing services.

[0003] In recent years, with the continuous development of the Internet of Things (IoT), the number of terminal devices has exploded, and the demand for network services has skyrocketed. Emerging industries such as autonomous driving and smart homes have also placed increasing demands on computing services. Traditional cloud computing frameworks are no longer able to provide the corresponding efficient computing services. This has led to the emergence of many new cloud computing technologies. For example, edge computing pushes computing and storage resources to the edge of the network, bringing data processing and analysis closer to users, thereby providing computing services with lower latency. Another example is the device-edge-cloud collaborative computing architecture, which integrates cloud servers, edge servers, and terminal devices to fully utilize the computing power of hardware. Through cloud-based management, scheduling, and collaboration, it reduces network bandwidth pressure while significantly improving service quality.

[0004] It is within this edge-edge cloud computing architecture that edge-edge cloud devices within the same framework exhibit diverse performance, leading to increasingly heterogeneous computing resources. This has led to decreased system resource utilization and difficulties in coordinating heterogeneous resources. To address this, numerous machine learning-related research projects have emerged in recent years. These efforts address issues such as heterogeneous resource coordination and task scheduling, focusing on optimizing average task duration and server load balancing to improve edge-edge cloud computing architectures. For example, Tianyi Cloud Technology Co., Ltd. proposed a heterogeneous task scheduling method based on the ant colony optimization algorithm, which optimizes task duration and calculates the optimal scheduling strategy for a group of independent user requests. Nanchang University proposed an improved particle swarm scheduling algorithm based on CloudSim, which optimizes the search process through the concept of average fitness and enhances the superiority of scheduling strategies. The National University of Defense Technology proposed a deep learning task scheduling method based on reinforcement learning, which adaptively learns and updates scheduling decisions based on online feedback, maximizing task execution efficiency and cluster resource utilization. Nanjing University of Posts and Telecommunications proposed a discrete particle swarm scheduling algorithm based on oscillating inertia weights, which uses oscillating inertia weights to adjust global and local search capabilities during the search process to achieve the global optimal solution.

[0005] However, there are still some shortcomings in current research work: First, many mainstream algorithms used in scheduling, such as ant colony algorithms and particle swarm algorithms, are mostly aimed at offline task scheduling, while in actual engineering projects, tasks are often released online. Therefore, most offline algorithms lack effective integration methods for online scheduling platforms, and algorithms for online scheduling, such as reinforcement learning, often have high requirements on the computing power of equipment, data collection, and model training; second, even for particle swarm algorithms used in offline scheduling, many studies did not consider the impact of task scheduling order on scheduling strategies during coding, and the resulting scheduling strategies still have room for optimization. Summary of the Invention

[0006] The present invention aims to solve the problems of uneven resource allocation, low resource utilization, slow task response, etc. caused by different node performance and resource heterogeneity in heterogeneous clusters in edge-cloud scenarios. A method and device for edge-cloud heterogeneous resource scheduling based on RNN and particle swarm are provided to obtain a scheduling strategy that can be applied to edge-cloud heterogeneous resource scenarios.

[0007] In order to achieve the above object, the present invention adopts the following technical solutions:

[0008] In a first aspect, the present invention provides a method for scheduling heterogeneous resources in edge-cloud based on RNN and particle swarm, comprising the following steps:

[0009] Based on historical records, pre-process the resource requirement table of the task in various operation modes and on each server cluster, and then obtain the information table of each node in the server cluster;

[0010] Build an RNN model, determine the hidden layers and activation functions of the model, and use the data set generated by dynamic programming to train the RNN model to recognize task sequences. The method for obtaining the data set is specifically as follows: obtain the task sequence, which includes the type of task and the arrival timestamp. According to the type of task, obtain the time when the task runs in all situations in the resource requirement table, and obtain the average expected running time of the task by weighting; each task used as input contains two dimensions, namely the average expected running time and its arrival timestamp; define the waiting coefficient α, calculate the optimal scheduling time point of a single task, which is the arrival time plus α times the waiting running time, and then randomly determine α first, perform dynamic programming with the sequence segmentation and minimizing the sum of variance as the goal, and then adjust α according to the final result until the minimum sum of variance is obtained; the calculated mean of tasks in the same segment is the global optimal scheduling time, which is used as the label of the data set;

[0011] A task scheduling queue is maintained in the scheduler. Every time a new task is received, it is put into the trained RNN model to obtain the time interval. After the scheduling opportunity is triggered, all cached tasks are dispatched to the particle swarm algorithm for calculation and the scheduling queue is cleared.

[0012] The position vector of the particle swarm is encoded according to the number of tasks. The encoding consists of two parts: one is the node encoding representing the task nodes and the operation mode, and the other is the sequence encoding representing the order in which the tasks are run. The sequence encoding is processed using the inverse Cantor expansion and the search space is optimized.

[0013] Set the inertia weight and fitness function of the particle swarm, count the sum of the waiting and running time of all tasks scheduled this time, the maximum completion timestamp and the total load factor of the cluster, obtain the final score through comprehensive evaluation and optimize the score during the search process, and output the final scheduling result.

[0014] As a preferred technical solution, the data set is obtained by:

[0015] The collected task sequences are sorted according to the arrival timestamp order. α is first randomly determined to calculate the optimal scheduling time for each task. Then, dynamic programming is performed to calculate the global optimal scheduling time for each task as the final label.

[0016] The state planning is described as follows:

[0017] The optimal scheduling time point of a single task, Scheduling_time, is formed into a set of scheduling time series. Then, based on the total sequence length and the expected number of tasks scheduled at a time, the scheduling time series is divided into a specified number of segments, m, so that the sum of the variances of all segments is minimized, that is:

[0018] Define the minimum sum of variances dp for the first i tasks of the sequence divided into j segments i,j , as follows:

[0019]

[0020] Where INF represents positive infinity, represents the variance of the sequence from the k+1th task to the i-th task, k is an integer variable used for traversal, 0≤i≤n, 0≤j≤m, and n represents the total number of nodes in the cluster;

[0021] Define the sequence prefix and function f expression as:

[0022]

[0023] Scheduling_time iIndicates the Scheduling_time value of the i-th task;

[0024] Define the sequence prefix square sum function. The expression of g is:

[0025]

[0026] Using the variance formula, we get The calculation formula is:

[0027]

[0028] Adjust the waiting coefficient α, when calculating the variance When the value of is the smallest, the final segmentation method of the sequence is determined;

[0029] Calculate the mean of each scheduling time series segment to obtain the global optimal scheduling time Scheduling_time_best.

[0030] As a preferred technical solution, the scheduling timing trigger is specifically:

[0031] Calculate the average of the scheduling timestamps of all tasks in the scheduling queue after model calculation. When the value is greater than the current time, the scheduling is triggered, and at the same time, the system continuously monitors whether there are new tasks.

[0032] As a preferred technical solution, the position vector of the particle swarm is encoded according to the number of tasks, specifically:

[0033] Let there be t tasks currently scheduled, and t tasks are scheduled to n nodes, then the position encoding format is defined as:

[0034] X=(x1,x2,……,x t ,a1,a2,......,a p )

[0035] Among them, the first t dimensions represent node encoding, the last p dimensions are sequential encoding, and a i Represents the i-th task, i∈[1, p]∩N + ;

[0036] Then, the sequential encoding is processed as follows:

[0037] Define the base number as c and the order number as order;

[0038] The definition number c is determined by combining the maximum value of the first t dimensions of the position code;

[0039] According to the total number of states, the constraint satisfies t! ≤c p , and the calculation formula for p is obtained:

[0040] p=「log c (t!)]

[0041] Then, set the calculation formula for the arrangement sequence as follows:

[0042]

[0043] Among them, a i represents the i-th task, when order≥t!, then order=t!-1;

[0044] The specific steps for calculating the task arrangement through order according to the inverse Cantor expansion are as follows:

[0045] (1) Initialize the empty list pList and the sequence list data to satisfy data i =i, both lists start with 1;

[0046] (2) Traverse the variable i from 1 to t, and change the subscript in data to Append the item to pList, delete the item in data, and update order to order%(ti)!;

[0047] (3) The obtained pList is a full permutation, and the original tasks are sorted according to this permutation.

[0048] As a preferred technical solution, the inertia weight of the particle swarm is a nonlinear decreasing logistic transformation, specifically:

[0049] Assume that the total number of rounds of particle swarm training is epoch_hum, and the current training reaches the epoch round. The inertia weight of the particle swarm is optimized using the nonlinear descent logistic transformation, as shown in the following formula:

[0050]

[0051] Wherein λ is a drop coefficient, and λ>0, the smaller the drop coefficient is, the more it encourages the early global search capability of the particle swarm.

[0052] As a preferred technical solution, the fitness function of the particle swarm is set as follows:

[0053] First, the waiting time is calculated and a priority queue is maintained for each node. This priority queue maintains all tasks that are currently running or waiting to run on the node, including the task's running end timestamp and the task's required resources. The running end times are ranked in ascending order as the priority of the priority queue. The resource requirement table Request_table is used to query the required resources for the task to run under the specified node and running mode. Then, the resource requirement table Resources_table is used to query the node's current resource information to determine whether the node's resources can meet the task's running requirements.

[0054] Then, when a task cannot run on the node, the resources at the head of the queue are released sequentially until the first time point at which the task can run on the node is found. The difference between this time point and the current time point is calculated to obtain the waiting time of all tasks in a single schedule. The waiting time of the task is added to the time the task runs on the node, and the running time of the task is queried from the resource demand table Request_table. The waiting time is added to the waiting time to obtain the sum of the waiting and running time of all tasks in a single schedule.

[0055] The maximum completion timestamp is the latest completion timestamp of all tasks scheduled in a single time;

[0056] Assume that a node has r resources and the usage of the i-th resource is v i The total amount of the node when it is empty is v_empty i , then define the cluster load factor l as follows:

[0057]

[0058] Sum the load factors of all clusters to obtain the total cluster load factor.

[0059] As a preferred technical solution, the resource requirement table includes the operating resource consumption parameters of each task in all operating modes and each node; the operating resource consumption parameters of all operating modes and each node include the occupancy rate of the CPU, GPU and NPU chips, as well as the physical memory occupancy, disk demand and predicted running time of each chip; the utilization rate of each node operating mode includes the CPU, GPU, NPU utilization rate of each node, as well as the remaining physical memory and remaining disk capacity of each chip.

[0060] As a preferred technical solution, the RNN model includes three hidden layers, an RNNCell and a linear rectifier unit ReLU, wherein the input enters the RNNCell through a hidden layer, and the output of the RNNCell is derived from the feedback, weighted and summed with the input, and then normalized to complete the iteration, and then passes through two hidden layers and the linear rectifier unit ReLU to output the prediction result.

[0061] In a second aspect, the present invention provides an end-edge-cloud heterogeneous resource scheduling system based on RNN and particle swarm, which is applied to the end-edge-cloud heterogeneous resource scheduling method based on RNN and particle swarm, including a task processing module, a model building module, a task scheduling module, a position encoding module and a scheduling result output module;

[0062] The task processing module is used to pre-process the resource requirement table of the task in various operation modes and on each server cluster according to the historical records, and then obtain the information table of each node of the server cluster;

[0063] The model construction module is used to build an RNN model, determine the various hidden layers and activation functions of the model, and use the data set generated by dynamic programming to train the RNN model to recognize task sequences. The method of obtaining the data set is specifically as follows: obtaining a task sequence, which includes the type of task and the arrival timestamp. According to the type of task, the time for the task to run in all situations is obtained from the resource requirement table, and the average expected running time of the task is obtained by weighting; each task used as input contains two dimensions, namely the average expected running time and the timestamp of its arrival; defining the waiting coefficient α, calculating the optimal scheduling time point of a single task, that is, the arrival time plus α times the waiting running time, and then randomly determining α first, performing dynamic programming with the sequence segmentation and minimizing the sum of variances as the goal, and then adjusting α according to the final result until the minimum sum of variances is obtained; the calculated mean of tasks in the same segment is the global optimal scheduling time, which is used as the label of the data set;

[0064] The task scheduling module is used to maintain a task scheduling queue in the scheduler. Every time a new task is received, it is put into the trained RNN model to obtain the time interval. After the scheduling opportunity is triggered, all cached tasks are dispatched to the particle swarm algorithm for calculation and the scheduling queue is cleared.

[0065] The position encoding module is used to encode the position vector of the particle swarm according to the number of tasks. The encoding consists of two parts: one is the node encoding representing the task node and the operation mode, and the other is the sequence encoding representing the order in which the tasks are run. The sequence encoding is processed using the inverse Cantor expansion and the search space is optimized.

[0066] The scheduling result output module is used to set the inertia weight and fitness function of the particle swarm, calculate the sum of the waiting and running time of all tasks scheduled this time, the maximum completion timestamp and the total load factor of the cluster, obtain the final score through comprehensive evaluation, optimize the score during the search process, and output the final scheduling result.

[0067] In a third aspect, the present invention provides an electronic device, comprising:

[0068] at least one processor; and,

[0069] a memory communicatively connected to the at least one processor; wherein,

[0070] The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the end-edge-cloud heterogeneous resource scheduling method based on RNN and particle swarm.

[0071] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0072] (1) The present invention timely caches online tasks through an RNN model trained by using dynamic programming to generate a data set, converts the original online scheduling into offline scheduling, and proposes to generate a data set by minimizing the sum of variances, providing a new scheduling algorithm, thereby improving the online scheduling platform's ability to integrate offline algorithms.

[0073] (2) The present invention encodes the position vector of the particle swarm according to the number of tasks and processes the sequential coding, proposes a particle swarm coding method based on Cantor expansion, and also proposes an n-ary optimization coding method, which reduces the dimension range and improves the search performance by expanding the dimension. Ultimately, it is possible to search for the comprehensive task allocation nodes and scheduling order with a smaller code expansion, in order to pursue a better scheduling strategy. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0075] Figure 1 This is a flow chart of a method for scheduling heterogeneous resources in edge-cloud based on RNN and particle swarm according to an embodiment of the present invention;

[0076] Figure 2 This is a flow chart of the particle swarm algorithm according to an embodiment of the present invention;

[0077] Figure 3 This is a schematic diagram of the RNN model structure according to an embodiment of the present invention;

[0078] Figure 4 This is a diagram showing an example of the change of inertia weight according to an embodiment of the present invention;

[0079] Figure 5This is a flow chart of a method for scheduling heterogeneous resources in edge-cloud based on RNN and particle swarm under the K8s framework according to an embodiment of the present invention.

[0080] Figure 6 This is a structural diagram of a device-edge-cloud heterogeneous resource scheduling system based on RNN and particle swarm according to an embodiment of the present invention;

[0081] Figure 7 2 is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0082] In order to enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0083] References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0084] See also Figure 1 This embodiment proposes a method for scheduling heterogeneous resources in edge-cloud based on RNN and particle swarm, including the following steps:

[0085] S1. Pre-process the resource requirement table of the task in various operation modes and on each server cluster based on historical records, and then obtain the information table of each node in the server cluster; the details are as follows:

[0086] The resource demand table Request_table includes the operating resource consumption parameters of each task in all operating modes and each node; the client node information table Resources_table includes the utilization rate, physical memory remaining and disk remaining of each node operating mode; the operating resource consumption parameters of all operating modes and each node include the occupancy rate of CPU, GPU and NPU chips, as well as the physical memory occupancy, disk demand and predicted operating time of each chip; the utilization rate of each node operating mode includes the CPU, GPU, NPU utilization rate of each node, as well as the physical memory remaining and disk remaining capacity of each chip.

[0087] S2. Build an RNN model, determine the model's hidden layers and activation functions, and use the resource demand table Request_table and the client's node information table Resources_table to construct a data set based on dynamic programming; perform real-time task scheduling in the online task cache, and use the tasks and data set to train the RNN model.

[0088] Furthermore, the method for obtaining a data set is specifically as follows: obtaining a task sequence, the task sequence including the type and arrival timestamp of the task, obtaining the running time of the task in all situations in the resource requirement table according to the type of the task, and obtaining the average expected running time of the task by weighting; each task used as input contains two dimensions, namely the average expected running time and its arrival timestamp; defining a waiting coefficient α, calculating the optimal scheduling time point of a single task, i.e., the arrival time plus α times the waiting running time, and then randomly determining α, performing dynamic programming with the sequence segmented and minimizing the sum of variances as the goal, and then adjusting α according to the final result until the minimum sum of variances is obtained; the calculated mean of tasks in the same segment is the global optimal scheduling time, and serves as the label of the data set.

[0089] Further, such as Figure 2 As shown, the RNN model of this embodiment is designed with three hidden layers, one RNNCell and a linear rectifier unit (ReLU). The input enters the RNNCell through one hidden layer, and the output of the RNNCell is derived from the feedback, weighted and summed with the input, and then normalized to complete the iteration. It then passes through two hidden layers and the linear rectifier unit (ReLU) to output the prediction result.

[0090] It can be understood that the above RNN model is one of the implementation methods of the present invention, and other RNN models that can implement the present invention are also applicable to the technical solution of the present invention.

[0091] Furthermore, the method for obtaining the data set required for training is as follows:

[0092] Get the task sequence through the client's historical records or randomly generated. The task sequence includes the task type and arrival timestamp.

[0093] Each task has different running time when running in different ways on different devices. Assume that a task has d situations, corresponding to d running times in different running modes on different devices. Define the task to be executed in the i-th situation. When the device is unloaded, it can execute a maximum of i The task is executed in the i-th case, so the load factor μ is defined as i , the calculation formula is:

[0094]

[0095] Where d represents the number of task execution situations, a i Indicates the maximum number of tasks that can be executed simultaneously in the i-th situation;

[0096] According to the type of task, the running time of the task in all situations is obtained from the resource demand table Request_table, and the average expected running time of each task is calculated by the weighted average_runtime formula as follows:

[0097]

[0098] where t i represents the running time of the task in the i-th case.

[0099] The optimal scheduling time for each task is:

[0100]

[0101] Among them, α is the waiting coefficient.

[0102] In fact, in step S2, the waiting coefficient α is defined, and the optimal scheduling time point of a single task, Scheduling_time, is calculated, which is the arrival time plus α times the waiting running time.

[0103] In addition, since the optimal scheduling time point for each task is only optimal for the task itself, rather than for the entire task sequence, it is not suitable as the final label. Therefore, the method for obtaining the dataset in this embodiment also includes the following steps:

[0104] The collected task sequences are sorted according to the order of arrival timestamps. First, α is randomly determined, and the optimal scheduling time point for each task is calculated. Then, dynamic programming is performed to calculate the global optimal scheduling time for each task as the final label.

[0105] In addition, this embodiment also includes a dynamic programming method. Here, the dynamic programming takes sequence segmentation and minimizes the sum of variances as the goal, specifically:

[0106] The Scheduling_time of each task forms a set of sequences, and the goal is to divide this sequence into a specified number of segments m so that the sum of the variances of all segments is minimized. Define dp i,j It represents the minimum sum of the variances of the first i tasks of the sequence divided into j segments, and has the following transfer formula:

[0107]

[0108] In the above formula, INF is positive infinity. represents the variance of the sequence from the k+1th task to the ith task, k is an integer variable used for traversal, 0≤i≤n, 0≤j≤m, and n represents the total number of nodes in the cluster. The transfer process can be optimized, and the sequence prefix and function f are defined as follows:

[0109]

[0110] Scheduling_time i Indicates the Scheduling_time value of the i-th task.

[0111] Define the sequence prefix square sum function g as:

[0112]

[0113] According to the variance formula:

[0114] Var[X]=E(X 2 )-E 2 (X) (7)

[0115] available The calculation formula is:

[0116]

[0117] Adjust the waiting coefficient α, when calculating the variance When the value of is the smallest, the final segmentation method of the sequence is determined;

[0118] Calculate the mean of each scheduling time series segment to obtain the global optimal scheduling time Scheduling_time_best.

[0119] Furthermore, dynamic programming requires recording the segmented decisions and calculating the mean of each segment. Ultimately, the global optimal scheduling time for each task is the mean of the segment it belongs to. The number of segments, m, should be determined based on the total sequence length and the expected number of tasks scheduled at a single time.

[0120] S3. Maintain a task scheduling queue in the scheduler. Every time a new task is received, it is put into the trained RNN model to obtain the time interval. After the scheduling opportunity is triggered, all cached tasks are dispatched to the particle swarm algorithm for calculation, and the scheduling queue is cleared.

[0121] Furthermore, the scheduling timing trigger is specifically:

[0122] Calculate the average of the scheduling timestamps of all tasks in the scheduling queue after model calculation. When the value is greater than the current time, the scheduling is triggered, and at the same time, the system continuously monitors whether there are new tasks.

[0123] See Figure 3 , step S3 includes the following particle swarm algorithm:

[0124] S31. Get all tasks in the scheduling queue;

[0125] S32. Determine the target to be optimized for this scheduling;

[0126] S33, encoding according to the number of tasks and the number of nodes;

[0127] S34, setting the particle swarm algorithm parameters, including the number of particles, the number of rounds, the acceleration constant, and the initialization position and speed;

[0128] S35, calculate the fitness of all particles and update the individual optimal position and the global optimal position;

[0129] S36, determine whether the number of iterations has been reached, if not, return to step S35; if yes, execute step S37;

[0130] S37: Decode the global optimal position to obtain the scheduling result.

[0131] S4. Encode the position vector of the particle swarm according to the number of tasks. The encoding consists of two parts: one is the node encoding representing the task node and the operation mode, and the other is the sequential encoding representing the order in which the tasks are run. The sequential encoding is processed using the inverse Cantor expansion and the search space is optimized.

[0132] Furthermore, in step S4, the position vector of the particle swarm is encoded according to the number of tasks and the sequence encoding is processed, specifically:

[0133] S41. Let there be t tasks currently scheduled, and t tasks are scheduled to n nodes. The position encoding format is defined as:

[0134] X=(x1,x2,……,x t ,a1,a2,......,a p ) (9)

[0135] Among them, the first t dimensions represent node encoding, and the last p dimensions are sequential encoding;

[0136] S42. Assuming there are three operating modes, CPU, GPU, and NPU are the 1st, 2nd, and 3rd operating modes respectively, then the node number of the i-th task is The operation mode is (x i %3+1) species, satisfying 0≤x i <3n.

[0137] S43, processing the sequence code, specifically:

[0138] S431. Define the base number as c and the order number as order;

[0139] S432, determine the definition base number c based on the maximum value of the first t dimensions of the position code;

[0140] S433, according to the total number of states, the constraint satisfies t! ≤ c p , and the calculation formula for p is obtained:

[0141] p=「log v (t!)] (10)

[0142] S44. Set the calculation formula for the arrangement sequence as follows:

[0143]

[0144] Among them, a i represents the i-th task, when order≥t!, then order=t!-1;

[0145] S45. The specific steps for calculating the task arrangement through order according to the inverse Cantor expansion are as follows:

[0146] S451, initialize the empty list pList, initialize the sequence list data, satisfy data i =i, both lists start with 1;

[0147] S452, traverse the variable i from 1 to t, and change the subscript in data to Append the item to pList, delete the item in data, and update order to order%(ti)!;

[0148] S453. The obtained pList is a full arrangement, and the original tasks are sorted according to this arrangement.

[0149] In addition, it should be noted that the triggering of the scheduling timing is: calculating the mean of the scheduling timestamps of all tasks in the scheduling queue after model calculation. When the mean of the scheduling timestamps is greater than the current time, the scheduling of the task is triggered, and at the same time, continuous monitoring is carried out to see if there are new tasks.

[0150] S5. Set the fitness function of the particle swarm, count the sum of the waiting and running time of all tasks in a single schedule, the maximum completion timestamp and the total load factor of the cluster, obtain the score through comprehensive evaluation and optimize the score during the search process to obtain the final scheduling result.

[0151] The inertia weight of the particle swarm is a nonlinear decreasing logistic transformation, specifically:

[0152] Assume that the total number of rounds of particle swarm training is epoch_num, and the current training reaches the epoch round. The inertia weight of the particle swarm is optimized using the nonlinear descent logistic transformation, as shown in the following formula:

[0153]

[0154] Where λ is the drop coefficient, and λ>0, such as Figure 4 As shown in Figure 3, under the same total number of particle swarm training rounds, the weight of the particle swarm with a smaller descent coefficient decreases more slowly as the number of training rounds increases. This indicates that the smaller the descent coefficient, the more it encourages the particle swarm's early global search ability.

[0155] It is understandable that the fitness function will calculate three indicators each time: the sum of the total waiting and running time of all tasks scheduled this time, the maximum completion timestamp, and the sum of the load factors of all clusters.

[0156] The method to calculate the waiting and running time of a task is:

[0157] First, the waiting time is calculated and a priority queue is maintained for each node. This priority queue maintains all tasks that are currently running or waiting to run on the node, including the task's running end timestamp and the task's required resources. The running end times are ranked in ascending order as the priority of the priority queue. The resource requirement table Request_table is used to query the required resources for the task to run under the specified node and running mode. Then, the resource requirement table Resources_table is used to query the node's current resource information to determine whether the node's resources can meet the task's running requirements.

[0158] Then, when a task cannot run on the node, the resources at the head of the queue are released sequentially until the first time point at which the task can run on the node is found. The difference between this time point and the current time point is calculated to obtain the waiting time of all tasks in a single schedule. The waiting time of the task is added to the time the task runs on the node, and the running time of the task is queried from the resource demand table Request_table. The waiting time is added to the waiting time to obtain the sum of the waiting and running time of all tasks in a single schedule.

[0159] The maximum completion timestamp is the latest completion timestamp of all tasks scheduled in a single time;

[0160] Assume that a node has r resources and the usage of the i-th resource is v i The total amount of the node when it is empty is v_empty i , then define the cluster load factor l as follows:

[0161]

[0162] Sum the load factors of all clusters to obtain the total cluster load factor.

[0163] In addition, the comprehensive evaluation method is selected according to the preference for scheduling results. It can be done through indicator mapping and reweighting, or it can be optimized based on priority.

[0164] See also Figure 5 In order to explain more intuitively, the present invention provides another more specific embodiment, and the specific steps are as follows:

[0165] S1. The hardware used was an x86 server with two T4-Tesla GPU computing chips as a cloud server, three Atlas 200DKs as edge servers, and four Raspberry Pis as terminal devices. Kubernetes was used as the cluster building framework, and a front-end program for user interaction was written.

[0166] S2. Design different types of tasks, including AI-intensive, memory-intensive, and disk-intensive, and prepare images for these tasks based on different operating modes and platforms. Obtain information about each task running on different devices in different operating modes in advance and write it into the resource requirement table Request_table. At the same time, run a script on each device to obtain device information, and write an interface in the front-end program to obtain this information. This information is organized into the node information table Resources_table.

[0167] S3. Build an RNN model, and its model structure uses Figure 1 Example. Prepare a data set, generate 1000 tasks of random types, and arrive randomly within 1000s. Calculate all load factors for each task based on the node's no-load information combined with formula (1), and calculate the average expected running time Average_runtime according to formula (2); specify the number of divisions to be 100, initialize the waiting coefficient α to 5%, and calculate the minimum sum of variances, the division scheme, and the global optimal scheduling time point Scheduling_time_best for each task through dynamic programming according to formulas (3)-(8), and then adjust α according to the variance value until the variance value is minimized;

[0168] S4. Train the RNN model. To speed up the training, preprocess the data and compress the values ​​of each dimension to [-2, 2]. Use MSE as the loss function, set the learning rate to 0.02, and train 1000 rounds.

[0169] S5. Put the trained model into the scheduler. For each task release, perform the same data preprocessing before inputting it into the model. At the same time, put the task into the queue and calculate the average optimal scheduling time of all tasks in the queue. When the current time is greater than this value, all tasks are input into the particle swarm algorithm and the queue is cleared. In addition, the same operation is performed when the number of tasks in the queue is 10.

[0170] In the coding of S6 and particle swarm, the base number c is determined to be 256, and the sequential coding length is determined according to the number of tasks each time in combination with formula (10), and the reduction coefficient λ is 0.2; in addition, the method of determining the position and speed to be updated each time is to use rounding to ensure that the position and speed are in a discrete state; when initializing, random initialization is performed according to the maximum value of different dimensions;

[0171] S7, when each position code is input into the fitness function, first decode the sequence code, use formula (11) to calculate the order, then calculate the corresponding full arrangement according to the steps, and re-arrange the task order according to this arrangement;

[0172] In S8, the fitness function processes tasks in order. If a node can support the specified operating mode, it then inquires whether the resources are sufficient for operation. If sufficient, the running time is accumulated. Otherwise, the waiting time is queried in the priority queue and the total time consumed is accumulated. If the operating mode is not supported or the task does not have this operating mode, infinity is returned to indicate that the position vector is not in the feasible solution. During the calculation process, the latest timestamp of all tasks completed in this scheduling is counted. After all tasks are processed, the sum of the load factors of all nodes is counted. The update criterion for the optimal solution is based on the priority of the above three indicators, that is, under the condition of satisfying the shortest average task time, the latest timestamp is minimized, and the sum of the load factors is minimized.

[0173] S9. Return the scheduling results and task sequence together, and schedule the tasks to the nodes according to the results through Kubernetes; randomly generate 100 tasks within 100 seconds through a script, and calculate the final completion time; deploy other mainstream scheduling algorithms in the same framework, and for the same task sequence, the total time of the present invention is finally reduced by 5%-25%.

[0174] It should be noted that, for the sake of convenience, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited to the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously.

[0175] Based on the same concept as the RNN and particle swarm-based end-edge-cloud heterogeneous resource scheduling method in the above-mentioned embodiment, the present invention also provides an RNN and particle swarm-based end-edge-cloud heterogeneous resource scheduling system, which can be used to execute the above-mentioned RNN and particle swarm-based end-edge-cloud heterogeneous resource scheduling method. For ease of explanation, the structural diagram of the embodiment of the RNN and particle swarm-based end-edge-cloud heterogeneous resource scheduling system only shows the parts related to the embodiment of the present invention. Those skilled in the art will understand that the illustrated structure does not constitute a limitation of the device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0176] See also Figure 6 In another embodiment of the present application, a device-edge-cloud heterogeneous resource scheduling system 100 based on RNN and particle swarm is provided, which includes a task processing module 101, a model building module 102, a task scheduling module 103, a position encoding module 104 and a scheduling result output module 105;

[0177] The task processing module 101 is used to pre-process the resource requirement table of the task in various operation modes and on each server cluster according to the historical records, and then obtain the information table of each node of the server cluster;

[0178] The model construction module 102 is used to build an RNN model, determine the various hidden layers and activation functions of the model, and use the data set generated by dynamic programming to train the RNN model to recognize task sequences. The method of obtaining the data set is specifically as follows: obtaining a task sequence, which includes the type of task and the arrival timestamp. According to the type of task, the time for the task to run in all situations is obtained from the resource requirement table, and the average expected running time of the task is obtained by weighting; each task used as input contains two dimensions, namely the average expected running time and the timestamp of its arrival; defining a waiting coefficient α, calculating the optimal scheduling time point of a single task, which is the arrival time plus α times the waiting running time, and then randomly determining α, performing dynamic programming with the sequence segmentation and minimizing the sum of variances as the goal, and then adjusting α according to the final result until the minimum sum of variances is obtained; the calculated mean of tasks in the same segment is the global optimal scheduling time, which is used as the label of the data set;

[0179] The task scheduling module 103 is used to maintain a task scheduling queue in the scheduler. Every time a new task is received, it is put into the trained RNN model to obtain the time interval. After the scheduling opportunity is triggered, all cached tasks are dispatched to the particle swarm algorithm for calculation and the scheduling queue is cleared.

[0180] The position encoding module 104 is used to encode the position vector of the particle swarm according to the number of tasks. The encoding includes two parts: one is a node encoding representing the node and operation mode of the task, and the other is a sequence encoding representing the order in which the tasks are run. The sequence encoding is processed using the inverse Cantor expansion and the search space is optimized.

[0181] The scheduling result output module 105 is used to set the inertia weight and fitness function of the particle swarm, calculate the sum of the waiting and running time of all tasks scheduled this time, the maximum completion timestamp and the sum of the total load factor of the cluster, obtain the final score through comprehensive evaluation, optimize the score during the search process, and output the final scheduling result. It should be noted that the end-edge cloud heterogeneous resource scheduling system based on RNN and particle swarm of the present invention corresponds one-to-one to the end-edge cloud heterogeneous resource scheduling method based on RNN and particle swarm of the present invention. The technical features and beneficial effects described in the embodiment of the end-edge cloud heterogeneous resource scheduling method based on RNN and particle swarm above are applicable to the embodiment of the end-edge cloud heterogeneous resource scheduling method based on RNN and particle swarm. For specific content, please refer to the description in the embodiment of the method of the present invention, which will not be repeated here. This is hereby declared.

[0182] In addition, in the implementation of the end-edge-cloud heterogeneous resource scheduling system based on RNN and particle swarm in the above-mentioned embodiment, the logical division of each program module is only an example. In actual application, the above-mentioned functions can be assigned to different program modules as needed, for example, for the configuration requirements of the corresponding hardware or the convenience of software implementation. That is, the internal structure of the end-edge-cloud heterogeneous resource scheduling system based on RNN and particle swarm is divided into different program modules to complete all or part of the functions described above.

[0183] See also Figure 7 In one embodiment, an electronic device for implementing an end-edge-cloud heterogeneous resource scheduling method based on RNN and particle swarm is provided. The electronic device 20 may include a first processor 21, a first memory 22 and a bus, and may also include a computer program stored in the first memory 22 and executable on the first processor 21, such as an end-edge-cloud heterogeneous resource scheduling program 23 based on RNN and particle swarm.

[0184] The first memory 22 includes at least one type of readable storage medium, including a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the first memory 22 may be an internal storage unit of the electronic device 20, such as a mobile hard disk of the electronic device 20. In other embodiments, the first memory 22 may also be an external storage device of the electronic device 20, such as a plug-in mobile hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 20. Furthermore, the first memory 22 may include both an internal storage unit of the electronic device 20 and an external storage device. The first memory 22 can be used not only to store application software and various types of data installed on the electronic device 20, such as the code of the end-edge-cloud heterogeneous resource scheduler 23 based on RNN and particle swarm, but can also be used to temporarily store data that has been output or is about to be output.

[0185] In some embodiments, the first processor 21 may be composed of an integrated circuit, such as a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The first processor 21 is the control core (Control Unit) of the electronic device, connecting the various components of the entire electronic device using various interfaces and lines, and executing or executing programs or modules stored in the first memory 22, as well as calling data stored in the first memory 22, to perform various functions of the electronic device 20 and process data.

[0186] Figure 7 Only the electronic device with components is shown, and it can be understood by those skilled in the art that Figure 7 The structure shown does not constitute a limitation on the electronic device 20 , and the electronic device 20 may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0187] The RNN- and particle swarm-based device-edge-cloud heterogeneous resource scheduling program 23 stored in the first memory 22 of the electronic device 20 is a combination of multiple instructions. When running in the first processor 21, it can achieve the following:

[0188] Based on historical records, pre-process the resource requirement table of the task in various operation modes and on each server cluster, and then obtain the information table of each node in the server cluster;

[0189] Build an RNN model, determine the hidden layers and activation functions of the model, and use the data set generated by dynamic programming to train the RNN model to recognize task sequences. The method for obtaining the data set is specifically as follows: obtain a task sequence, which includes the type of task and the arrival timestamp. According to the type of task, obtain the time when the task runs in all situations in the resource requirement table, and obtain the average expected running time of the task by weighting; each task used as input contains two dimensions, namely the average expected running time and its arrival timestamp; define the waiting coefficient α, calculate the optimal scheduling time point of a single task, which is the arrival time plus α times the waiting running time, and then randomly determine α first, perform dynamic programming with the sequence segmentation and minimizing the sum of variance as the goal, and then adjust α according to the final result until the minimum sum of variance is obtained; the calculated mean of tasks in the same segment is the global optimal scheduling time, which is used as the label of the data set;

[0190] A task scheduling queue is maintained in the scheduler. Every time a new task is received, it is put into the trained RNN model to obtain the time interval. After the scheduling opportunity is triggered, all cached tasks are dispatched to the particle swarm algorithm for calculation and the scheduling queue is cleared.

[0191] The position vector of the particle swarm is encoded according to the number of tasks. The encoding consists of two parts: one is the node encoding representing the task nodes and the operation mode, and the other is the sequence encoding representing the order in which the tasks are run. The sequence encoding is processed using the inverse Cantor expansion and the search space is optimized.

[0192] Set the inertia weight and fitness function of the particle swarm, count the sum of the waiting and running time of all tasks scheduled this time, the maximum completion timestamp and the total load factor of the cluster, obtain the final score through comprehensive evaluation and optimize the score during the search process, and output the final scheduling result.

[0193] Furthermore, if the modules / units integrated in the electronic device 20 are implemented as software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0194] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0195] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0196] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. A method for scheduling heterogeneous resources in edge-cloud based on RNN and particle swarm, characterized by: The steps include: Based on historical records, pre-process the resource requirement table of the task in various operation modes and on each server cluster, and then obtain the information table of each node in the server cluster; Build an RNN model, determine the hidden layers and activation functions of the model, and use the dataset generated by dynamic programming to train the RNN model to recognize task sequences. The method for obtaining the dataset is as follows: obtain the task sequence, which includes the type of task and the arrival timestamp. According to the type of task, obtain the time when the task runs in all situations in the resource requirement table, and obtain the average expected running time of the task by weighting; each task used as input contains two dimensions, namely the average expected running time and its arrival timestamp; define the waiting coefficient α, calculate the optimal scheduling time point of a single task, which is the arrival time plus α times the waiting running time, and then randomly determine α first, perform dynamic programming with the sequence segmentation and minimizing the sum of variance as the goal, and then adjust α according to the final result until the minimum sum of variance is obtained; the calculated mean of tasks in the same segment is the global optimal scheduling time, which is used as the label of the dataset; A task scheduling queue is maintained in the scheduler. Every time a new task is received, it is put into the trained RNN model to obtain the time interval. After the scheduling opportunity is triggered, all cached tasks are dispatched to the particle swarm algorithm for calculation and the scheduling queue is cleared. The position vector of the particle swarm is encoded according to the number of tasks. The encoding consists of two parts: one is the node encoding representing the task nodes and the operation mode, and the other is the sequence encoding representing the order in which the tasks are run. The sequence encoding is processed using the inverse Cantor expansion and the search space is optimized. Set the inertia weight and fitness function of the particle swarm, count the sum of the waiting and running time of all tasks scheduled this time, the maximum completion timestamp and the total load factor of the cluster, obtain the final score through comprehensive evaluation and optimize the score during the search process, and output the final scheduling result.

2. The method for scheduling heterogeneous resources in edge-cloud based on RNN and particle swarm according to claim 1 is characterized in that: The dataset is obtained in the following way: The collected task sequences are sorted according to the arrival timestamp order. α is first randomly determined to calculate the optimal scheduling time for each task. Then, dynamic programming is performed to calculate the global optimal scheduling time for each task as the final label. The dynamic programming is described as follows: The optimal scheduling time point of a single task, Scheduling_time, is formed into a set of scheduling time series. Then, based on the total sequence length and the expected number of tasks scheduled at a time, the scheduling time series is divided into a specified number of segments, m, so that the sum of the variances of all segments is minimized, that is: Define the minimum sum of variances dp for the first i tasks of the sequence divided into j segments i,j , as follows: Where INF represents positive infinity, represents the variance of the sequence from the k+1th task to the i-th task, k is an integer variable used for traversal, 0≤i≤n,0≤j≤m, and n represents the total number of nodes in the cluster; Define the sequence prefix and function f expression as: Scheduling_time i Indicates the Scheduling_time value of the i-th task; Define the sequence prefix square sum function g as: Using the variance formula, we get The calculation formula is: Adjust the waiting coefficient α, when calculating the variance When the value of is the smallest, the final segmentation method of the sequence is determined; Calculate the mean of each scheduling time series segment to obtain the global optimal scheduling time Scheduling_time_best.

3. The method for scheduling heterogeneous resources in edge-cloud based on RNN and particle swarm according to claim 1 is characterized in that: The scheduling timing trigger is specifically: Calculate the average of the scheduling timestamps of all tasks in the scheduling queue after model calculation. When the value is greater than the current time, the scheduling is triggered, and at the same time, the system continuously monitors whether there are new tasks.

4. The method for scheduling heterogeneous resources in edge-cloud based on RNN and particle swarm according to claim 1 is characterized in that: The position vector of the particle swarm is encoded according to the number of tasks, specifically: Suppose there are t tasks currently scheduled and t tasks are scheduled to n nodes, then the position encoding format is defined as: X=(x1,x2,……,x t ,a1,a2,……,a p ) Among them, the first t dimensions represent node encoding, the last p dimensions are sequential encoding, and a i Represents the i-th task, i∈[1,p]∩N + ; Then, the sequential encoding is processed as follows: Define the base number as c and the order number as order; The definition number c is determined by combining the maximum value of the first t dimensions of the position code; According to the total number of states, the constraint satisfies t! ≤c p , and the calculation formula for p is obtained: Then, set the calculation formula for the arrangement sequence as follows: Among them, a i represents the i-th task, when order≥t!, then order=t!-1; The specific steps for calculating the task arrangement through order according to the inverse Cantor expansion are as follows: (1) Initialize the empty list pList and the sequence list data to satisfy data i =i, both lists start with 1; (2) Traverse the variable i from 1 to t, and change the subscript in data to Append the item to pList, delete the item in data, and update order to order%(ti)!; (3) The obtained pList is a full permutation, and the original tasks are sorted according to this permutation.

5. The method for scheduling heterogeneous resources in edge-cloud based on RNN and particle swarm according to claim 1 is characterized in that: The inertia weight of the particle swarm is a nonlinear decreasing logistic transformation, specifically: Assume that the total number of rounds of particle swarm training is epoch_num, and the current training reaches the epoch round. The inertia weight of the particle swarm is optimized using the nonlinear descent logistic transformation, as shown in the following formula: Where λ is a drop coefficient, and λ>0. The smaller the drop coefficient is, the more it encourages the particle swarm's early global search capability.

6. The method for scheduling heterogeneous resources in edge-cloud based on RNN and particle swarm according to claim 1 is characterized in that: The fitness function of the particle swarm is set as follows: First, the waiting time is calculated and a priority queue is maintained for each node. This priority queue maintains all tasks that are running or waiting to run on the node, including the task's running end timestamp and the task's required resources. The running end time is used as the priority of the priority queue in ascending order. The required resources for the task running under the specified node and running mode are queried in the resource demand table Request_table. Then, the current resource information of the node is queried in the resource demand table Resources_teble to determine whether the node's resources can meet the task's running requirements. Then, when a task cannot be run on the node, the resources at the head of the queue are released sequentially until the first time point at which the task can be run on the node is found. The difference between this time point and the current time point is calculated to obtain the waiting time of all tasks in a single schedule. Add the time the task runs on the node, query the task's running time from the resource demand table Request_table, and add the waiting time to obtain the sum of the waiting and running time of all tasks scheduled in a single time; The maximum completion timestamp is the latest completion timestamp of all tasks scheduled in a single time; Assume that a node has r resources and the usage of the i-th resource is v i The total amount of the node when it is empty is v_empty i , then define the cluster load factor l as follows: Sum the load factors of all clusters to obtain the total cluster load factor.

7. The method for scheduling heterogeneous resources in edge-cloud based on RNN and particle swarm according to claim 1 is characterized in that: The resource requirement table includes the operating resource consumption parameters of each task in all operating modes and each node; the operating resource consumption parameters of all operating modes and each node include the occupancy rate of the CPU, GPU and NPU chips, as well as the physical memory occupancy, disk demand and predicted running time of each chip; the utilization rate of each node operating mode includes the CPU, GPU, NPU utilization rate of each node, as well as the remaining physical memory and remaining disk capacity of each chip.

8. The method for scheduling heterogeneous resources in edge-cloud based on RNN and particle swarm according to claim 1 is characterized in that: The RNN model includes three hidden layers, one RNNCell and a linear rectifier unit (ReLU). The input enters the RNNCell through one hidden layer, and the output of the RNNCell is fed back into the model. The model is normalized after weighted summation with the input to complete the iteration, and then passes through two hidden layers and the linear rectifier unit (ReLU) to output the prediction result.

9. The device-edge-cloud heterogeneous resource scheduling system based on RNN and particle swarm is characterized by: The method for scheduling heterogeneous resources of edge-end and cloud based on RNN and particle swarm applied to any one of claims 1-8 comprises a task processing module, a model building module, a task scheduling module, a position encoding module and a scheduling result output module; The task processing module is used to pre-process the resource requirement table of the task in various operation modes and on each server cluster according to the historical records, and then obtain the information table of each node of the server cluster; The model building module is used to build an RNN model, determine the various hidden layers and activation functions of the model, and use the data set generated by dynamic programming to train the RNN model to recognize task sequences. The method of obtaining the data set is specifically as follows: obtaining a task sequence, which includes the type of task and the arrival timestamp. According to the type of task, the time for the task to run in all situations is obtained from the resource requirement table, and the average expected running time of the task is obtained by weighting; each task used as input contains two dimensions, namely the average expected running time and its arrival timestamp; defining the waiting coefficient α, calculating the optimal scheduling time point of a single task, that is, the arrival time plus α times the waiting running time, and then randomly determining α first, performing dynamic programming with the sequence segmentation and minimizing the sum of variances as the goal, and then adjusting α according to the final result until the minimum sum of variances is obtained; the calculated mean of tasks in the same segment is the global optimal scheduling time, which is used as the label of the data set; The task scheduling module is used to maintain a task scheduling queue in the scheduler. Every time a new task is received, it is put into the trained RNN model to obtain the time interval. After the scheduling opportunity is triggered, all cached tasks are dispatched to the particle swarm algorithm for calculation and the scheduling queue is cleared. The position encoding module is used to encode the position vector of the particle swarm according to the number of tasks. The encoding consists of two parts: one is the node encoding representing the task node and the operation mode, and the other is the sequence encoding representing the order in which the tasks are run. The sequence encoding is processed using the inverse Cantor expansion and the search space is optimized. The scheduling result output module is used to set the inertia weight and fitness function of the particle swarm, calculate the sum of the waiting and running time of all tasks scheduled this time, the maximum completion timestamp and the total load factor of the cluster, obtain the final score through comprehensive evaluation, optimize the score during the search process, and output the final scheduling result.

10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the end-edge-cloud heterogeneous resource scheduling method based on RNN and particle swarm as described in any one of claims 1-8.