WO2022252456A1 - 一种任务调度方法、装置、电子设备及可读存储介质 - Google Patents

一种任务调度方法、装置、电子设备及可读存储介质 Download PDF

Info

Publication number
WO2022252456A1
WO2022252456A1 PCT/CN2021/121894 CN2021121894W WO2022252456A1 WO 2022252456 A1 WO2022252456 A1 WO 2022252456A1 CN 2021121894 W CN2021121894 W CN 2021121894W WO 2022252456 A1 WO2022252456 A1 WO 2022252456A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
scheduling
training
candidate
subtasks
Prior art date
Application number
PCT/CN2021/121894
Other languages
English (en)
French (fr)
Inventor
张亚强
李茹杨
赵雅倩
李仁刚
Original Assignee
苏州浪潮智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Priority to US18/037,414 priority Critical patent/US11934871B1/en
Publication of WO2022252456A1 publication Critical patent/WO2022252456A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing

Definitions

  • the present application relates to the technical field of edge computing, and in particular to a task scheduling method, a task scheduling device, electronic equipment, and a computer-readable storage medium.
  • edge computing Edge Computing, EC
  • edge computing is facing important challenges in user demand response optimization.
  • Users have more stringent requirements for network services, especially for aspects such as service response speed, coverage, and connectivity that affect user experience quality.
  • related technologies schedule the demands submitted by each user on a single edge server.
  • the functions and logic of the service business are becoming more and more complex and diverse, and the needs sent by users to the service network are becoming more and more personalized. It usually requires processing and aggregation of different tasks. Therefore, the scheduling method of related technologies is only task scheduling based on priority. In most cases, it is not the optimal scheduling method, which makes the efficiency of the edge computing network low and the response speed of user needs slow.
  • the purpose of the present application is to provide a task scheduling method, a task scheduling device, an electronic device, and a computer-readable storage medium, which improve the efficiency of the edge server and reduce the time required for completing task requirements.
  • the task requirement is split to obtain a plurality of subtasks with constraint relationships
  • the performing condition detection on non-candidate subtasks includes:
  • the state detection of the server network formed by the edge server to obtain server state information and communication information includes:
  • the remaining transmission duration is detected for each network channel in the server network to obtain the communication information.
  • the training process of the action value evaluation model includes:
  • the initial network is updated by using the loss value, and the action value evaluation model is obtained through iterative training.
  • the acquisition of multiple training data includes:
  • sampling threshold If the sampling threshold is reached, use the training data and the performance parameters corresponding to the previous training round to generate new candidate training data, and randomly select the sampling threshold pieces from the candidate training data. the training data;
  • sampling threshold determines the latest candidate training data from the candidate training data, and input the latest candidate training data into the initial network to obtain a plurality of training sessions corresponding to each of the scheduling actions.
  • the assessed value
  • the post-scheduling environment information to obtain training performance parameters corresponding to the training scheduling action, and using the training performance parameters, the post-scheduling environment information, the training scheduling action and the latest candidate training data to generate target training data , and determine the target training data as the candidate training data.
  • the obtaining the training performance parameters corresponding to the training scheduling action by using the post-scheduling environment information includes:
  • An average delay is obtained by using each of the task delays, and the average delay is determined as the training performance parameter.
  • the task requirements are split to obtain multiple subtasks with constraint relationships, including:
  • Each of the subtasks detects input data and output data, obtains a detection result, and obtains the constraint relationship between each of the subtasks based on the detection result.
  • the present application also provides a task scheduling device, including:
  • a splitting module configured to split the task requirement if the task requirement is obtained, to obtain a plurality of subtasks with constraint relationships
  • a queue update module configured to perform execution condition detection on non-candidate subtasks, determine the non-candidate subtasks that meet the execution conditions as candidate subtasks, and put the candidate subtasks into a task queue;
  • the status detection module is used to detect the status of the server network formed by the edge server, and obtain server status information and communication information;
  • a scheduling module configured to determine a target scheduling action among multiple scheduling actions by using the evaluation value, and schedule the candidate subtasks in the task queue based on the target scheduling action.
  • the present application also provides an electronic device, including a memory and a processor, wherein:
  • the memory is used to store computer programs
  • the processor is configured to execute the computer program to implement the above task scheduling method.
  • the present application also provides a computer-readable storage medium for storing a computer program, wherein the above-mentioned task scheduling method is implemented when the computer program is executed by a processor.
  • the task scheduling method if the task requirements are obtained, the task requirements are split to obtain multiple subtasks with constraint relationships; the execution conditions of the non-candidate subtasks are detected, and the non-candidate subtasks that meet the execution conditions are The task is determined as a candidate subtask, and the candidate subtask is put into the task queue; the status detection of the server network composed of edge servers is performed to obtain server status information and communication information; the queue information corresponding to the server status information, communication information and task queue Input the action value evaluation model to obtain multiple evaluation values corresponding to multiple scheduling actions; use the evaluation values to determine the target scheduling action among multiple scheduling actions, and schedule candidate subtasks in the task queue based on the target scheduling action.
  • the queue information of the task queue may indicate the status of tasks that can be executed.
  • the action value evaluation model can be used to evaluate the effects of various feasible scheduling actions based on the above information, and obtain corresponding evaluation values.
  • the best target scheduling action in the current situation can be selected from multiple scheduling actions, and the candidate subtasks in the task queue can be scheduled based on it.
  • the candidate subtasks that constitute different task requirements are scheduled in parallel on multiple edge servers. Multiple edge servers execute multiple task requirements in parallel.
  • This scheduling method can further refine the scheduling of task requirements, thereby further improving the efficiency of task execution, improving the efficiency of edge servers, and reducing the time required to complete task requirements.
  • the response speed of task requirements is improved, and the problems of low edge computing network efficiency and slow response speed of user requirements in related technologies are solved.
  • FIG. 1 is a flowchart of a task scheduling method provided in an embodiment of the present application
  • FIG. 2 is a directed acyclic graph corresponding to a task requirement provided by an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 1 is a flow chart of a task scheduling method provided in an embodiment of the present application.
  • the method includes:
  • the task requirement refers to the computing task that the user wants to perform using the edge computing network. By realizing the task requirement, the data that the user wants can be obtained or the operation that the user wants to complete can be completed.
  • edge computing the functions and logic of the services it can provide become more and more complex, which usually need to be composed of multiple different subtasks, and the task requirements can be completed by completing each subtask.
  • the task requirement includes multiple subtasks, and each subtask has a certain constraint relationship.
  • the constraint relationship is used to constrain the execution sequence, input data, and execution interval of each subtask, and its specific category and quantity are not limited. Through the constraint relationship, the position of each subtask in the entire task requirement can be determined, and then subsequently determine which subtasks should be executed in the current situation according to the completion progress of the entire task requirement and the position of the subtask in the task requirement.
  • the constraint relationship can be expressed in any form, for example, it can be expressed in the form of a directed acyclic graph, or it can be expressed in the form of a formula.
  • This embodiment does not limit the specific acquisition method of the task requirement.
  • the task request sent by the terminal can be obtained and analyzed to obtain the task requirement; in another implementation manner, the specified path can be scanned, and Determine the data under the specified path as task requirements.
  • this embodiment does not limit the execution timing of the step of acquiring task requirements, which may be executed in real time or periodically. There can be one or more task requirements obtained each time. After the task requirements are obtained, they need to be split. Therefore, it is understandable that the data expression of the task requirements should conform to the preset rules, so that after the task requirements are obtained, they can be split according to the preset rules to obtain the corresponding constraints. relational subtasks.
  • This embodiment does not limit the specific content of the preset rule, which can be set as required.
  • the preset rule is a directed acyclic graph rule, that is, each subtask is used as a vertex of a directed acyclic graph, and the relationship between subtasks is used as a directed edge to generate a corresponding task requirement.
  • FIG. 2 is a directed acyclic graph corresponding to a task requirement provided by an embodiment of the present application.
  • the task requirement Req can be expressed as:
  • Subtask k represents the kth subtask, and there are K subtasks in total, t w represents the timing constraints and logical sequence constraints between subtasks, and W represents the set of edges.
  • Dt n is the input data obtained from other edge servers required by the subtask
  • N is the set of edge servers
  • Dt n is specifically the input data obtained from the nth edge server
  • Proc is the subtask’s input data to the edge server A request for computing resources.
  • W i is a set of timing constraints and logical sequence constraints corresponding to the i-th subtask.
  • the constraint between Subtask 1 and Subtask 2 is t1, which means that the maximum value of the time interval between the execution of the subtask numbered 1 and the execution of the subtask numbered 2 is t1.
  • the subtask numbered 3 not only uses the execution result of the subtask numbered 1 as input data, but also obtains data from the edge servers numbered i and j as input data.
  • Step 12 Multiple subtasks are used to detect input data and output data, obtain detection results, and obtain constraint relationships among various subtasks based on the detection results.
  • the task requirement includes each subtask and the input and output information of each subtask, and each subtask constituting the task requirement can be obtained by performing subtask detection on the task requirement.
  • the specific method of subtask detection is not limited.
  • the subtask detection method is different. For example, when the subtask is marked with ⁇ , the ⁇ label in the task requirement can be detected, and the large The data in brackets is determined as the data corresponding to the subtask.
  • Input data and output data detection refers to the detection of the input data required to identify subtasks and the resulting output data. Since each subtask completes the entire task requirement together, the execution result of some subtasks must be the input data of another part of subtasks.
  • Non-candidate subtasks that is, subtasks that are not put into the task queue, are tasks that cannot be executed before this scheduling.
  • non-candidate subtasks can be subtasks obtained after the last task scheduling and before this task scheduling. It could not be executed before the last scheduling; or it could be a subtask that existed but could not be executed before the last task scheduling. Although it existed in the last scheduling, it could not be executed, the specific reason is that its corresponding preorder The task is not completed, and the input data required for the execution of the subtask is insufficient, so it cannot be executed.
  • This embodiment does not limit the specific method of execution condition detection.
  • it can be determined whether each non-candidate subtask has an executable flag. If there is an executable flag, it is determined that it meets the execution condition.
  • the executable flag can be Generated according to input instructions.
  • it may be determined whether the input data of each non-candidate subtask is complete, and if so, it is determined that it satisfies the execution condition.
  • the process of performing execution condition detection on non-candidate subtasks may specifically include the following steps:
  • Step 21 Determine whether the non-candidate subtask is a demand initiation task.
  • Step 23 If it is not a required initial task, then judge whether all the preceding tasks of the non-candidate subtasks have been executed.
  • Step 24 If all the previous tasks are executed, it is determined that the non-candidate subtasks meet the execution conditions.
  • the demand start task refers to the first executed subtask in the task requirement, which is the beginning of the entire task requirement process, and its input data does not depend on the input data generated by other subtasks, but in The task requirement has been determined when it is determined, so the requirement initiation task can be executed directly in any case.
  • the non-candidate subtask is the demand initiation task, it can be directly determined that it satisfies the execution condition. If the non-candidate subtask is not the required initial task, it needs to judge whether the input data required for its execution is complete. Specifically, it can be judged whether all the preceding tasks have been executed.
  • a predecessor task refers to a subtask that has a direct constraint relationship with a subtask and is located before the subtask in the task logic sequence. Specifically, please refer to Figure 2.
  • the subtask numbered 1 is its corresponding predecessor task.
  • the subtask numbered 3 is Its corresponding pre-order task, and the subtask numbered 1 is not its corresponding pre-order task.
  • the multiple edge servers form a server network, which jointly participate in task scheduling and complete multiple task requirements in parallel.
  • the server status information refers to the information reflecting the load pressure of the server. Specifically, it may be the information of the remaining computing time of the server, the information of the processor usage rate, etc., and the specific content may be set as required.
  • the communication information refers to the information reflecting the use of each network channel in the server network, specifically, it may be the bandwidth utilization rate information of the network channel, the remaining transmission time of the network channel, etc. Similarly, its specific content may be set as required. Since the server status information can represent the load pressure of the edge server, the communication information can reflect the communication between servers in the network, and the time required for the completion of candidate subtasks is related to the load pressure of the server and the transmission speed of data in the cluster. Therefore, as the basic information for efficient scheduling, the server status information and communication information can be used for efficient and accurate task scheduling in the future.
  • the scheduling may be considered to be executed when the execution condition detection instruction is detected, or in the case of non-real-time updating of server state information and communication information, the scheduling may be considered to be executed when the state detection instruction is detected.
  • the steps of acquiring and splitting task requirements can be performed at any time.
  • the process of performing status detection on a server network composed of edge servers, and obtaining server status information and communication information may specifically include the following steps:
  • Step 31 Perform remaining computing duration detection on each edge server to obtain server status information.
  • Step 32 Perform remaining transmission duration detection on each network channel in the server network to obtain communication information.
  • S104 Input the server status information, communication information and queue information corresponding to the task queue into the action value evaluation model to obtain multiple evaluation values corresponding to multiple scheduling actions.
  • Queue information refers to information that reflects the task status of each candidate subtask in the task queue, specifically including the amount of input data of the candidate subtask and the allowable waiting time corresponding to the candidate subtask.
  • the allowable wait time can also be called the most pressing timing constraint. Since the execution time interval between each preceding task and candidate subtasks cannot be too large, and when there are multiple preceding tasks, the maximum threshold of timing constraints between each preceding task and candidate subtasks may be different, and each preceding task The execution completion time of the sequence task may also be different. In this case, the most urgent timing constraint corresponding to the candidate subtask is the minimum value of each timing constraint when each preceding task is executed. Therefore, within the allowed waiting time, the candidate subtask must be started.
  • the queue information can correspond to the previous target number of candidate subtasks in the task queue, and the target number is the number of edge servers.
  • the action value evaluation model can be used to evaluate Under this limitation, the value of each scheduling method (ie scheduling action) is evaluated to obtain the corresponding evaluation value.
  • Each scheduling action will lead to a corresponding scheduling result, and the task execution time corresponding to the scheduling result corresponds to the value of the scheduling action. The lower the task execution time is, the more effective the scheduling is, and the higher the value of the scheduling action is. The more ineffective, the lower the value of dispatching actions. Therefore, through the evaluation value, the value of each scheduling action can be determined in the current situation, and then the appropriate scheduling action can be selected for scheduling.
  • S105 Using the evaluation value to determine a target scheduling action among multiple scheduling actions, and scheduling candidate subtasks in the task queue based on the target scheduling action.
  • This embodiment does not limit the specific manner of determining the target scheduling action, and the determination manner of the target scheduling action may be different according to the specific calculation manner of the evaluation value.
  • the scheduling action corresponding to the minimum or maximum evaluation value can be determined as the target scheduling action; in another implementation, a greedy algorithm (such as ⁇ -greedy algorithm) can be used to obtain Determine the target value in , and determine the scheduling action corresponding to the target value as the target scheduling action.
  • the target scheduling action is the optimal scheduling action in the current situation, so the candidate subtasks can be scheduled based on the target scheduling action.
  • Applying the task scheduling method provided by the embodiment of the present application does not regard the user's task requirements as a whole, but separates the subtasks that make up the task requirements, schedules each subtask, and realizes the task in one decision stage.
  • the effect of scheduling multiple task requirements internally improves the efficiency of the edge computing network to the greatest extent.
  • Multiple subtasks can be obtained by splitting the requirements of each task, and each subtask has a constraint relationship, which is used to constrain the execution sequence of the subtasks. By detecting the execution conditions of non-candidate subtasks, it is judged that they can start to be executed, and when they meet the execution conditions, they are put into the task queue and wait to be scheduled.
  • the server status information representing the load status of the edge server and the communication information indicating the network communication pressure between the servers can be obtained.
  • the queue information of the task queue may indicate the status of tasks that can be executed.
  • the action value evaluation model can be used to evaluate the effects of various feasible scheduling actions based on the above information, and obtain corresponding evaluation values. According to the evaluation value, the best target scheduling action in the current situation can be selected from multiple scheduling actions, and the candidate subtasks in the task queue can be scheduled based on it.
  • the candidate subtasks that constitute different task requirements are scheduled in parallel on multiple edge servers.
  • Multiple edge servers execute multiple task requirements in parallel.
  • This scheduling method can further refine the scheduling of task requirements, thereby further improving the efficiency of task execution, improving the efficiency of edge servers, and reducing the time required to complete task requirements.
  • the response speed of task requirements is improved, and the problems of low edge computing network efficiency and slow response speed of user requirements in related technologies are solved.
  • the task scheduling model can be trained to obtain an action value evaluation model.
  • This embodiment does not limit the specific training method and process of the action value evaluation model.
  • the training process of the action value evaluation model may specifically include the following steps:
  • Step 41 Obtain a plurality of training data, input the training data into the initial network respectively, and obtain a plurality of training evaluation values corresponding to each training data.
  • the initial network is an untrained network model, and when its training reaches convergence, it will be transformed into an action value evaluation model.
  • the specific content of the training data is not limited, and it can be understood that there must be training environment information in it, and the training environment information includes server status information, communication information, and queue information used for training.
  • the training data is obtained, it is input into the initial network, so that the initial network can process it, and obtain multiple training evaluation values corresponding to each training data.
  • the training evaluation value is the same as the generation process of the evaluation value in the above embodiment.
  • the initial network is a DNN network (Deep Neural Network, deep neural network).
  • the initial network can be represented by QN, and its parameters can be represented by ⁇ .
  • externally input data may be obtained as the training data.
  • the process of obtaining multiple training data may specifically include the following steps:
  • Step 51 Judging whether the number of candidate training data reaches the sampling threshold.
  • candidate training data refers to data that can be selected as training data. Specifically, candidate training data can be placed in a cache pool, and the size of the cache pool can be D, and D should be much larger than M in theory.
  • Step 52 If the sampling threshold is reached, use the training data and performance parameters corresponding to the previous training round to generate new candidate training data, and randomly select the sampling threshold training data from the candidate training data.
  • the number of candidate training data reaches the sampling threshold, it means that there are enough candidate data, and some of them can be selected as training data.
  • the training data used in the previous training round and the corresponding performance parameters can be used to generate new candidate training data, so as to expand the candidate training data, and the new candidate training
  • the specific generation process of the data is the same as that of the subsequent target training data, which will be explained later.
  • a random selection method can be used to select a sampling threshold candidate training data as the training data of the current round of training.
  • Step 53 If the sampling threshold is not reached, determine the latest candidate training data from the candidate training data, and input the latest candidate training data into the initial network to obtain multiple training evaluation values corresponding to each scheduling action.
  • the initial network can be used to generate training data. Specifically, the newly generated candidate training data is obtained and used as the basis for generating the target training data, and input into the initial network, then the initial model can be used to memorize it, and multiple corresponding training evaluation values can be obtained.
  • CP t i is the server status information, which specifically represents the load pressure of the i-th edge server at time t. Since there are N edge servers in total, the dimension of CP t i is 1*N, and each element represents an edge The load pressure of the server can be, for example, the next idle moment of the edge server.
  • L i,j t is the communication information, which specifically represents the data transmission pressure of the communication channel from the i-th edge server to the j-th edge server, for example, it can be the next idle time of the channel. Since the communication channel is bidirectional, bidirectional are different, so the dimension of the communication information is N*N.
  • RT t is queue information.
  • it is specifically the information corresponding to the first N candidate subtasks in the task queue.
  • the dimension of the queue information can be 2*N, where the first column element represents the allowed waiting time corresponding to the candidate subtasks Duration, the second column element indicates the amount of input data corresponding to the candidate subtask.
  • the training evaluation value corresponding to each scheduling action can be obtained, which can be called the Q value.
  • the specific size of the Q value is different according to the input data, model parameters, and scheduling actions.
  • Step 54 Use the training evaluation value to determine the training scheduling action, and perform task scheduling based on the training scheduling action.
  • the greedy algorithm can be used to process it to obtain the corresponding target value, and the scheduling action corresponding to the target value is determined as the training scheduling action.
  • the training scheduling action can be represented by At .
  • the task scheduling is performed based on the state transition equation Pt , where:
  • Step 55 Check the status of the server network after task scheduling, and generate post-scheduling environment information by using the obtained post-scheduling status information, post-scheduling communication information, and post-scheduling queue information corresponding to the task queue.
  • the state of the cluster After scheduling based on the training scheduling action, the state of the cluster has changed, and the changed state can be represented by S t+1 .
  • the information corresponding to the scheduled task queue is obtained through state detection, that is, the scheduled queue information, and the post-scheduled environment is generated by using it, the post-scheduled status information, and the post-scheduled communication information information, that is, S t+1 .
  • Step 56 Use the post-scheduling environment information to obtain the training performance parameters corresponding to the training scheduling actions, and use the training performance parameters, post-scheduling environment information, training scheduling actions and the latest candidate training data to generate target training data, and determine the target training data as candidates training data.
  • the edge server corresponding to each subtask to be scheduled can be determined according to it, and then the corresponding training performance parameters can be calculated according to the distribution of the subtasks to be scheduled, so that it can be used in conjunction with the post-scheduled environment information, training scheduling action Generate target training data with the latest candidate training data, and use the target training data as new candidate training data to expand the candidate training data.
  • the training performance parameter refers to the parameter that can represent the quality of the environment information after scheduling, and also characterizes the quality of the training scheduling action. In the application scenario of this embodiment, the shorter the average time required for the edge computing network to execute subtasks , the better the training scheduling action is, on the contrary, the worse the training scheduling action is.
  • the average time required for the edge computing network to perform subtasks can be determined as a training performance parameter.
  • This embodiment does not limit the specific calculation method of the training performance parameters. It can be understood that the more accurate the calculation of the average duration, the more accurate the training performance parameters and the higher the quality of the candidate training data.
  • the process of obtaining the training performance parameters corresponding to the training scheduling action by using the post-scheduling environment information may specifically include the following steps:
  • Step 61 Use the data processing duration and data transmission duration of each subtask to be scheduled involved in the training scheduling action to obtain the task processing delay.
  • the subtasks participating in the scheduling during the training process are the subtasks to be scheduled.
  • the time required for the edge server to execute the subtasks to be scheduled includes two parts. One part is the task processing delay for processing the subtasks to be scheduled, and the other part is the task waiting time.
  • the task waiting time is the remaining computing time. The time required for the edge server to complete the currently unfinished tasks.
  • the task waiting time of the second part can be obtained by detecting the remaining computing time of the server to be scheduled, and will not be repeated here.
  • the task processing delay it also consists of two parts, including the processing time for processing the task, and the transmission time for obtaining the required input data through data transmission.
  • the task processing delay can be:
  • T(S) is the task processing delay
  • T ij (S) is the transmission time
  • TP(S) is the processing time
  • S is the data volume of the input data of the subtask to be scheduled
  • i and j represent the number of the edge server
  • B ij represents the channel bandwidth between two edge servers
  • d ij represents the inherent delay of the channel
  • Z represents the number of processor cycles required to process a unit amount of data
  • F represents the processor frequency.
  • Step 62 Detect the remaining computing duration of each server to be scheduled involved in the training scheduling action to obtain the remaining computing duration.
  • T waiting may be used to indicate the remaining calculation duration.
  • Step 63 Add the task processing delay and the corresponding remaining calculation time to obtain the task delay corresponding to each server to be scheduled.
  • the task delay is specifically:
  • T waiting is the remaining calculation duration corresponding to the edge server numbered n
  • T(S) is the task processing delay corresponding to the subtask to be scheduled assigned by the edge server numbered n.
  • Step 64 Use each task delay to obtain an average delay, and determine the average delay as a training performance parameter.
  • the average delay can be represented by R t+1 , where:
  • N t represents the set of edge servers participating in scheduling
  • represents the number of edge servers in N t .
  • the total delay of multiple scheduling is the smallest.
  • the target training data ⁇ S t , A t , R t+1 , S t+1 ⁇ , and put it into the cache pool.
  • the acquisition of training data can be completed. After inputting the training data into the initial model, the corresponding training evaluation value can be obtained.
  • Step 42 Use the training evaluation value to determine the target training scheduling action, and perform task scheduling according to the target training scheduling action, and obtain the performance parameters corresponding to each training data.
  • the way of calculating the performance parameter by using the training evaluation value is the same as the way of calculating the training performance parameter in the above steps, and the performance parameter can also be represented by R t+1 .
  • the evaluation value is processed based on the greedy algorithm, and the target training scheduling action A t is obtained, and the target training scheduling action is executed, and the scheduled environmental information S t+1 is obtained, and corresponding performance parameters are generated R t+1 .
  • Step 43 Use the performance parameters to obtain the target evaluation value, and use the training evaluation value and the target evaluation value to obtain the loss value.
  • the target evaluation value can be represented by Q target , where:
  • is the reward discount factor
  • min A' Q(S t+1 , A', ⁇ )
  • min A' Q(S t+1 , A', ⁇ )
  • m is the number of the training data in the current round of training
  • a m is the scheduling action obtained after the training data numbered m is processed by the initial model
  • S m is the system environment parameter corresponding to the training data, that is, the training data numbered m
  • S t is denoted as S m here.
  • Step 44 Use the loss value to update the initial network, and iteratively train to obtain the action value evaluation model.
  • the initial network may be updated based on gradient backpropagation. Iterative training is carried out after the initial network is updated, that is, new training data is reselected to repeat the above training process until the initial model reaches convergence and is converted into an action value evaluation model.
  • the task scheduling device provided by the embodiment of the present application is introduced below, and the task scheduling device described below and the task scheduling method described above may be referred to in correspondence.
  • FIG. 3 is a schematic structural diagram of a task scheduling device provided in an embodiment of the present application, including:
  • a splitting module 110 configured to split the task requirement if the task requirement is obtained, to obtain a plurality of subtasks with constraint relationships
  • the queue update module 120 is used to detect the execution conditions of the non-candidate subtasks, determine the non-candidate subtasks that meet the execution conditions as candidate subtasks, and put the candidate subtasks into the task queue;
  • the status detection module 130 is used to detect the status of the server network formed by the edge server, and obtain server status information and communication information;
  • An action evaluation module 140 configured to input server status information, communication information, and queue information corresponding to task queues into the action value evaluation model to obtain multiple evaluation values corresponding to multiple scheduling actions;
  • the scheduling module 150 is configured to use the evaluation value to determine a target scheduling action among multiple scheduling actions, and schedule candidate subtasks in the task queue based on the target scheduling action.
  • the state detection module 130 includes:
  • An initial judging unit configured to judge whether a non-candidate subtask is a required initial task
  • the first determining unit is configured to determine that the non-candidate subtask satisfies the execution condition if the initial task is required;
  • a preorder judging unit configured to judge whether all preorder tasks of the non-candidate subtasks have been executed if they are not required initial tasks
  • the second judging unit is used to determine that the non-candidate subtasks meet the execution conditions if all the previous tasks are executed;
  • the third judging unit is configured to determine that the non-candidate subtasks do not meet the execution conditions if the preceding tasks are not all executed.
  • the state detection module 130 includes:
  • the remaining computing duration detection unit is used to detect the remaining computing duration of each edge server to obtain server status information
  • the remaining transmission duration detection unit is configured to detect the remaining transmission duration of each network channel in the server network to obtain communication information.
  • the performance parameter calculation module is used to determine the target training scheduling action by using the training evaluation value, and perform task scheduling according to the target training scheduling action, and obtain the corresponding performance parameters of each training data;
  • the loss calculation module is used to obtain the target evaluation value by using the performance parameter, and obtain the loss value by using the training evaluation value and the target evaluation value;
  • the update module is used to update the initial network by using the loss value, and iteratively trains to obtain the action value evaluation model.
  • the training data input module includes:
  • a threshold judging unit configured to judge whether the number of candidate training data reaches the sampling threshold
  • a random selection unit is used to generate new candidate training data using the training data and performance parameters corresponding to the previous training round if the sampling threshold is reached, and randomly select the sampling threshold training data from the candidate training data;
  • the input unit is used to determine the latest candidate training data from the candidate training data if the sampling threshold is not reached, and input the latest candidate training data into the initial network to obtain a plurality of training evaluation values corresponding to each scheduling action;
  • the target training data generation unit is used to obtain the training performance parameters corresponding to the training scheduling action by using the post-scheduling environment information, and generate target training data by using the training performance parameters, post-scheduling environment information, training scheduling actions and the latest candidate training data, and convert the target The training data is determined as candidate training data.
  • the target training data generation unit includes:
  • the remaining calculation duration calculation subunit is used to detect the remaining calculation duration of each server to be scheduled involved in the training scheduling action, and obtain the remaining calculation duration;
  • the average calculation subunit is used to obtain the average delay by using the delay of each task, and determine the average delay as a training performance parameter.
  • the computer-readable storage medium provided by the embodiments of the present application is introduced below, and the computer-readable storage medium described below and the task scheduling method described above may be referred to in correspondence.
  • the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned task scheduling method are implemented.
  • the computer-readable storage medium may include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc., which can store program codes. medium.
  • each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can be referred to each other.
  • the description is relatively simple, and for the related information, please refer to the description of the method part.
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • registers hard disk, removable disk, CD-ROM, or any other Any other known storage medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computer And Data Communications (AREA)

Abstract

一种任务调度方法、装置、电子设备及计算机可读存储介质,该方法包括:若获取到任务需求,则对任务需求进行拆分,得到多个具有约束关系的子任务(S101);对非候选子任务进行执行条件检测,将满足执行条件的非候选子任务确定为候选子任务,并将候选子任务放入任务队列(S102);对边缘服务器构成的服务器网络进行状态检测,得到服务器状态信息和通信信息(S103);将服务器状态信息、通信信息和任务队列对应的队列信息输入动作价值评估模型,得到多个调度动作分别对应的多个评估值(S104);利用评估值在多个调度动作中确定目标调度动作,并基于目标调度动作对任务队列中的候选子任务进行调度(S105);该方法提高了边缘服务器的效率,减少了完成任务需求所需要的时长。

Description

一种任务调度方法、装置、电子设备及可读存储介质
本申请要求在2021年6月1日提交中国专利局、申请号为202110606786.1、发明名称为“一种任务调度方法、装置、电子设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及边缘计算技术领域,特别涉及一种任务调度方法、任务调度装置、电子设备及计算机可读存储介质。
背景技术
边缘计算(Edge Computing,EC)技术的发展有效缓解了云计算在网络资源利用效率、用户体验质量等方面所面临的严峻挑战。然而,边缘计算正面临着用户需求响应优化方面的重要挑战。用户对网络服务的要求更加严苛,尤其是对服务响应速度、覆盖性和连通性等影响用户体验质量的方面。为了提高对用户需求的响应速度,相关技术对各个用户提交的需求在单个边缘服务器上进行调度。然而,服务业务的功能和逻辑愈加复杂多样,用户向服务网络发送的需求愈加个性化,其通常需要将不同任务进行处理和聚合,因此相关技术的调度方式仅为基于优先级进行任务调度,在大部分情况下并不是最优调度方式,使得边缘计算网络的效率较低,用户需求响应速度慢。
因此,相关技术存在的边缘计算网络效率较低、用户需求响应速度慢的问题,是本领域技术人员需要解决的技术问题。
发明内容
有鉴于此,本申请的目的在于提供一种任务调度方法、任务调度装置、电子设备及计算机可读存储介质,提高了边缘服务器的效率,减少了完成任务需求所需要的时长。
为解决上述技术问题,本申请提供了一种任务调度方法,包括:
若获取到任务需求,则对所述任务需求进行拆分,得到多个具有约束关系的子任务;
对非候选子任务进行执行条件检测,将满足执行条件的所述非候选子任务确定为候选子任务,并将所述候选子任务放入任务队列;
对边缘服务器构成的服务器网络进行状态检测,得到服务器状态信息和通信信息;
将所述服务器状态信息、所述通信信息和所述任务队列对应的队列信息输入动作价值评估模型,得到多个调度动作分别对应的多个评估值;
利用所述评估值在多个所述调度动作中确定目标调度动作,并基于所述目标调度动作对所述任务队列中的所述候选子任务进行调度。
可选地,所述对非候选子任务进行执行条件检测,包括:
判断所述非候选子任务是否为需求起始任务;
若是所述需求起始任务,则确定所述非候选子任务满足所述执行条件;
若不是所述需求起始任务,则判断所述非候选子任务的前序任务是否全部执行完毕;
若所述前序任务全部执行完毕,则确定所述非候选子任务满足所述执行条件;
若所述前序任务未全部执行完毕,则确定所述非候选子任务不满足所述执行条件。
可选地,所述对边缘服务器构成的服务器网络进行状态检测,得到服务器状态信息和通信信息,包括:
对各个所述边缘服务器进行剩余计算时长检测,得到所述服务器状态信息;
对所述服务器网络中的各个网络信道进行剩余传输时长检测,得到所述通信信息。
可选地,所述动作价值评估模型的训练过程,包括:
获取多个训练数据,并将所述训练数据分别输入初始网络,得到各个所述训练数据分别对应的多个训练评估值;
利用所述训练评估值确定目标训练调度动作,并根据所述目标训练调度动作进行任务调度,并得到各个所述训练数据对应的性能参数;
利用所述性能参数得到目标评估值,并利用所述训练评估值和所述目标评估值得到损失值;
利用所述损失值更新所述初始网络,迭代训练得到所述动作价值评估模型。
可选地,所述获取多个训练数据,包括:
判断候选训练数据的数量是否达到采样阈值;
若达到所述采样阈值,则利用上一训练轮次对应的所述训练数据和所述性能参数生成新的所述候选训练数据,并从所述候选训练数据中随机选择所述采样阈值个所述训练数据;
若未达到所述采样阈值,则从所述候选训练数据中确定最新候选训练数据,并将所述最新候选训练数据输入所述初始网络,得到各个所述调度动作分别对应的多个所述训练评估值;
利用所述训练评估值确定训练调度动作,并基于所述训练调度动作进行任务调度;
对任务调度后的所述服务器网络进行状态检测,并利用得到的调度后状态信息、调度后通信信息和所述任务队列对应的调度后队列信息生成调度后环境信息;
利用所述调度后环境信息得到所述训练调度动作对应的训练性能参数,并利用所述训练性能参数、所述调度后环境信息、所述训练调度动作和所述最新候选训练数据生成目标训练数据,并将所述目标训练数据确定为所述候选训练数据。
可选地,所述利用所述调度后环境信息得到所述训练调度动作对应的训练性能参数,包括:
利用所述训练调度动作涉及的各个待调度子任务的数据处理时长和数据传输时长得到任务处理时延;
对所述训练调度动作涉及的各个待调度服务器进行剩余计算时长检测,得到剩余计算时长;
将所述任务处理时延和所述剩余计算时长相加,得到各个所述待调度服务器对应的任务延迟;
利用各个所述任务延迟得到平均延迟,并将所述平均延迟确定为所述训练性能参数。
可选地,所述对所述任务需求进行拆分,得到多个具有约束关系的子任务,包括:
对所述任务需求进行子任务检测,得到多个所述子任务;
多各个所述子任务进行输入数据和输出数据检测,得到检测结果,并基于所述检测结果得到各个所述子任务之间的所述约束关系。
本申请还提供了一种任务调度装置,包括:
拆分模块,用于若获取到任务需求,则对所述任务需求进行拆分,得到多个具有约束关系的子任务;
队列更新模块,用于对非候选子任务进行执行条件检测,将满足执行条件的所述非候选子任务确定为候选子任务,并将所述候选子任务放入任务队列;
状态检测模块,用于对边缘服务器构成的服务器网络进行状态检测,得到服务器状态信息和通信信息;
动作评估模块,用于将所述服务器状态信息、所述通信信息和所述任务队列对应的队列信息输入动作价值评估模型,得到多个调度动作分别对应的多个评估值;
调度模块,用于利用所述评估值在多个所述调度动作中确定目标调度动作,并基于所述目标调度动作对所述任务队列中的所述候选子任务进行调度。
本申请还提供了一种电子设备,包括存储器和处理器,其中:
所述存储器,用于保存计算机程序;
所述处理器,用于执行所述计算机程序,以实现上述的任务调度方法。
本申请还提供了一种计算机可读存储介质,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现上述的任务调度方法。
本申请提供的任务调度方法,若获取到任务需求,则对任务需求进行拆分,得到多个具有约束关系的子任务;对非候选子任务进行执行条件检测,将满足执行条件的非候选子任务确定为候选子任务,并将候选子任务放入任务队列;对边缘服务器构成的服务器网络进行状态检测,得到服务器状态信 息和通信信息;将服务器状态信息、通信信息和任务队列对应的队列信息输入动作价值评估模型,得到多个调度动作分别对应的多个评估值;利用评估值在多个调度动作中确定目标调度动作,并基于目标调度动作对任务队列中的候选子任务进行调度。
可见,该方法并不将用户的任务需求看作一个整体,而是将其组成该任务需求的各个子任务拆分出来,对各个子任务进行调度,实现在一个决策阶段内对多个任务需求进行调度的效果,最大程度上提高边缘计算网络的效率。对各个任务需求进行拆分可以得到多个子任务,各个子任务之间具有约束关系,用于约束子任务的执行先后顺序。通过对非候选子任务进行执行条件的检测,判断其能够开始被执行,并在其满足执行条件时将其放入任务队列,等待被调度。通过对服务器网络进行检测,可以得到表征边缘服务器负载状态的服务器状态信息,以及表示各个服务器之间网络通信压力的通信信息。任务队列的队列信息可以表示可以被执行的任务的情况。通过将队列信息、通信信息和服务器状态信息输入动作价值评估模型,可以利用动作价值评估模型基于上述信息,对各种可行的调度动作的效果进行评估,得到对应的评估值。根据评估值可以从多个调度动作中选择在当前情况下最佳的目标调度动作,并基于其对任务队列中的候选子任务进行调度。通过将用户需求进行拆分,并根据多个边缘服务器的状态、网络通信压力和可以被执行的子任务的情况,对构成不同任务需求的候选子任务在多个边缘服务器上进行并行调度,利用多个边缘服务器并行执行多个任务需求,这样的调度方式可以将任务需求的调度进一步细化,进而进一步提高任务执行效率,提高了边缘服务器的效率,减少了完成任务需求所需要的时长,进而提高了任务需求的响应速度,解决了相关技术存在的边缘计算网络效率较低、用户需求响应速度慢的问题。
此外,本申请还提供了一种任务调度装置、电子设备及计算机可读存储介质,同样具有上述有益效果。
附图说明
为了更清楚地说明本申请实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请实施例提供的一种任务调度方法流程图;
图2为本申请实施例提供的一种任务需求对应的有向无环图;
图3为本申请实施例提供的一种任务调度装置的结构示意图;
图4为本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参考图1,图1为本申请实施例提供的一种任务调度方法流程图。该方法包括:
S101:若获取到任务需求,则对任务需求进行拆分,得到多个具有约束关系的子任务。
任务需求是指用户想要利用边缘计算网络执行的计算任务,通过实现任务需求,即可得到用户想要的数据或完成用户想完成的操作。随着边缘计算的发展,其能够提供的服务的功能和逻辑愈加复杂,其通常需要由多个不同子任务组成,通过将各个子任务完成,即可完成任务需求。在本实施例中,任务需求中包括多个子任务,各个子任务之间具有一定的约束关系。
约束关系用于对各个子任务的执行顺序、输入数据、执行间隔时长等进行约束,其具体类别和数量不做限定。通过约束关系,可以确定各个子任务在整个任务需求中的位置,进而在后续依据整个任务需求的完成进度和子任务在任务需求中的位置确定当前情况下应当执行哪些子任务。约束关系可以 采用任意形式表示,例如可以采用有向无环图形式表示,或者可以采用公式形式。
本实施例并不限定任务需求的具体获取方式,在一种实施方式中,可以获取并解析终端发送的任务请求,得到任务需求;在另一种实施方式中,可以对指定路径进行扫描,并将指定路径下的数据确定为任务需求。进一步的,本实施例并不限定获取任务需求的步骤的执行时机,可以实时执行或按照周期执行。每次获取到的任务需求可以为一个或多个。在得到任务需求后需要对其进行拆分,因此可以理解的是,任务需求的数据表达应当符合预设规则,以便在获取任务需求后按照预设规则对其进行拆分,得到对应的具有约束关系的子任务。本实施例并不限定预设规则的具体内容,可以根据需要进行设置。在一种实施方式中,预设规则为有向无环图规则,即将各个子任务作为有向无环图的顶点,将子任务之间的关系作为有向边生成对应的任务需求。请参考图2,图2为本申请实施例提供的一种任务需求对应的有向无环图。其中,任务需求Req可以表达为:
Req={{SubTask k} k∈K,{t w} w∈W}
其中,Subtask k表示第k个子任务,共有K个子任务,t w表示子任务之间的时序约束和逻辑顺序约束,W表示边的集合。
对于每个子任务,可以有:
Figure PCTCN2021121894-appb-000001
其中,Dt n为子任务所需的从其他边缘服务器获取的输入数据,N为边缘服务器的集合,Dt n具体为从第n个边缘服务器处获取的输入数据,Proc为子任务对边缘服务器的计算资源的请求。W i为第i个子任务对应的时序约束和逻辑顺序约束集合。
从图2可以看出,Subtask 1到Subtask 2之间的约束为t1,表示编号为1的子任务执行结束到编号为2的子任务开始执行的时间间隔的最大值为t1。同时可以看出,编号为3的子任务在除了将编号为1的子任务的执行结果作为输入数据外,还从编号为i和j的边缘服务器处分别获取了数据作为输入数据。
本实施例并不限定对任务需求进行拆分的具体拆分方式,在一种实施方式中,任务需求中可以直接包括子任务和对应的约束关系。在另一种实施方式中,对任务需求进行拆分,得到多个具有约束关系的子任务的过程具体可以包括如下步骤:
步骤11:对任务需求进行子任务检测,得到多个子任务。
步骤12:多各个子任务进行输入数据和输出数据检测,得到检测结果,并基于检测结果得到各个子任务之间的约束关系。
在本实施方式中,任务需求中包括各个子任务以及各个子任务的输入输出的信息,通过对任务需求进行子任务检测,可以得到组成任务需求的各个子任务。子任务检测的具体方式不做限定,根据子任务的表示方式的不同,子任务检测的方式不同,例如当子任务用{}进行标识时,可以检测任务需求中的{}标号,并将大括号中的数据确定为子任务对应的数据。输入数据和输出数据检测是指识别子任务所需的输入数据和得到的输出数据的检测。由于各个子任务共同完成整个任务需求,因此一部分子任务的执行结果必然为另一部分子任务的输入数据。通过输入数据和输出数据检测,可以得到对应的检测结果,进而根据检测结果确定各个子任务之间的关系,即得到各个子任务之间的约束关系。通过该实施方式,可以直接准确地得到各个子任务之间的约束关系,保证任务需求的正确执行。
S102:对非候选子任务进行执行条件检测,将满足执行条件的非候选子任务确定为候选子任务,并将候选子任务放入任务队列。
非候选子任务,即没有被放入任务队列中的子任务,其为在本次调度之前无法被执行的任务。具体的,非候选子任务可以为在上次任务调度后,在本次任务调度前新获取到的任务需求拆分得到的子任务,由于其在上次调度后才被获取,因此其在本次调度前无法被执行;或者可以为在上次任务调度前已经存在但是无法被执行的子任务,其虽然在上一次调度时已经存在,但是其无法被执行,具体原因在于其对应的前序任务没有执行完毕,该子任务执行所需的输入数据不足,因此其同样无法被执行。
在进行新的一次调度时,需要确定哪些子任务可以被执行,以便后续将其部署在各个边缘服务器上执行,因此需要对非候选子任务进行执行条件检测,判断是否有非候选子任务在本次调度时满足了执行条件。在检测结束后, 将满足执行条件的非候选子任务确定为候选子任务,候选子任务是指能够被执行的任务。通过将候选子任务放入任务队列,可以在后续通过检测任务队列的队列信息确定需要被调度的各个子任务的情况,并根据其进行合理地调度。本实施例并不限定任务队列的具体形式,为了提高任务需求的反馈速度,任务队列可以采用先入先出模式。
本实施例并不限定执行条件检测的具体方式,在一种实施方式中,可以判断各个非候选子任务是否存在可执行标记,若存在可执行标记,则确定其满足执行条件,可执行标记可以根据输入指令生成。在另一种实施方式中,可以判断各个非候选子任务的输入数据是否齐全,若齐全,则确定其满足执行条件。为了提高执行条件检测的速度,进而提高任务调度速度,对非候选子任务进行执行条件检测的过程具体可以包括如下步骤:
步骤21:判断非候选子任务是否为需求起始任务。
步骤22:若是需求起始任务,则确定非候选子任务满足执行条件。
步骤23:若不是需求起始任务,则判断非候选子任务的前序任务是否全部执行完毕。
步骤24:若前序任务全部执行完毕,则确定非候选子任务满足执行条件。
步骤25:若前序任务未全部执行完毕,则确定非候选子任务不满足执行条件。
对上述步骤进行具体说明。首先,需求起始任务是指任务需求中第一个被执行的子任务,该子任务为整个任务需求流程的开端,其输入数据中并不存在依赖其他子任务生成的输入数据,而是在任务需求确定时已经被确定好,因此需求起始任务在任何情况下均可以被直接执行。当检测到非候选子任务为需求起始任务时,可以直接确定其满足执行条件。若非候选子任务不是需求起始任务,则需要判断其执行所需的输入数据是否齐全,具体的,可以判断其前序任务是否全部执行完毕。前序任务是指与某一子任务具有直接约束关系且在任务逻辑顺序中位于该子任务之前的子任务。具体的,请参考图2,对于编号为2的子任务来说,编号为1的子任务即为其对应的前序任务,对于编号为5的子任务来说,编号为3的子任务即为其对应的前序任务,而编号为1的子任务并不是其对应的前序任务。当前序任务均执行完毕时,说明 该非候选子任务所需的输入数据已经齐全,可以确定该非候选子任务满足执行条件,否则不满足执行条件。
S103:对边缘服务器构成的服务器网络进行状态检测,得到服务器状态信息和通信信息。
在本实施例中,边缘服务器的数量为多个,多个边缘服务器构成服务器网络,共同参与任务调度,并行完成多个任务需求。在进行任务调度时,需要根据服务器网络(即边缘计算网络)的状态,对各个候选子任务进行合理调度,因此需要对服务器网络进行状态检测,得到边缘服务器对应的服务器状态信息和服务器网络的通信信息。服务器状态信息是指反映服务器负载压力的信息,具体可以为服务器剩余计算时长信息、处理器使用率信息等,其具体内容可以根据需要进行设置。通信信息是指反映服务器网络中各个网络信道使用情况的信息,具体可以为网络信道的带宽利用率信息、网络信道的剩余传输时长等,同样的,其具体内容可以根据需要进行设置。由于服务器状态信息可以表示边缘服务器的负载压力情况,通信信息可以反映网络中服务器间通信情况,而候选子任务执行完毕所需的时长与服务器的负载压力和数据在集群中的传输速度相关。因此服务器状态信息和通信信息作为进行高效调度的基础信息,可以利用其在后续进行高效准确地任务调度。
需要说明的是,关于状态检测的执行时机,在一种实施方式中,可以实时执行,以便对服务器状态信息和通信信息进行实时更新,在调度时直接使用即可;在另一种实施方式中,可以在检测到需要进行调度时执行,以便减少计算资源的消耗。进一步的,步骤S102和步骤S103的执行顺序并不进行限定,二者可以串行执行或并行执行,串行执行时的执行先后顺序同样不做限定。本实施例同样不限定调度开始的标志,在一种实施方式中,可以在获取到任务需求时认为开始执行调度。在另一种实施方式中,可以在检测到执行条件检测指令时认为开始执行调度,或者在非实时更新服务器状态信息和通信信息的情况下,检测到状态检测指令时认为开始执行调度。在这种实施方式中,获取任务需求并对其进行拆分的步骤可以在任意时刻执行。
本实施例并不限定状态检测的具体检测方式,根据服务器状态信息和通信信息的具体内容的不同,检测方式可以不同。例如在一种实施方式中,对 边缘服务器构成的服务器网络进行状态检测,得到服务器状态信息和通信信息的过程具体可以包括如下步骤:
步骤31:对各个边缘服务器进行剩余计算时长检测,得到服务器状态信息。
步骤32:对服务器网络中的各个网络信道进行剩余传输时长检测,得到通信信息。
在本实施例中,剩余计算时长检测用于检测当前情况下,完成当前正在处理的子任务所需的剩余时长,得到剩余计算时长。剩余计算时长同样是候选子任务被部署到该边缘服务器之后等待被开始执行的时长。与其类似的,剩余传输时长为两个边缘服务器将当前正在传输的数据传输完毕所需的剩余时长。通过对各个网络信道进行剩余传输时长检测得到剩余传输时长,可以确定子任务在某一边缘服务器上执行时,从另一边缘服务器处获取输入数据的过程所需要等待的时长。剩余计算时长和剩余传输时长能够准确地表征边缘服务器的负载压力和网络信道的传输压力。
S104:将服务器状态信息、通信信息和任务队列对应的队列信息输入动作价值评估模型,得到多个调度动作分别对应的多个评估值。
在得到服务器状态信息、通信信息,并对任务队列更新完毕后,可以将服务器状态信息、通信信息以及任务队列的队列信息输入动作价值评估模型,得到用于表征在当前情况下采用各种调度动作进行调度后集群状态的评估值。
队列信息是指反映任务队列中各个候选子任务的任务情况的信息,具体包括候选子任务的输入数据的数据量和候选子任务对应的允许等待时长。允许等待时长也可以称为最紧迫时序约束。由于各个前序任务与候选子任务之间的执行时间间隔不能过大,而当前序任务为多个时,各个前序任务与候选子任务之间的时序约束的最大阈值可能不同,且各个前序任务的执行完毕时刻也可能不同。在这种情况下,候选子任务对应的最紧迫时序约束即为各个前序任务执行完毕时,各个时序约束中的最小值。因此在允许等待时长内,该候选子任务必须被开始执行。可以理解的是,由于任务队列采用先入先出模式,且每个边缘服务器在一个时刻下仅能处理一个子任务,因此队列信息 可以对应于任务队列中前目标数量个候选子任务,而目标数量即为边缘服务器的数量。
通过综合服务器状态信息、通信信息和队列信息,可以对边缘服务器负载压力、服务器间的数据传输压力、候选子任务的紧迫情况和数据传输需求这三个角度进行限定,并利用动作价值评估模型对在这种限定下各个调度方式(即调度动作)的价值进行评估,得到对应的评估值。每种调度动作均会导致对应的调度结果,而调度结果对应的任务执行时长则与调度动作的价值相对应,任务执行时长越低,说明调度越有效,调度动作的价值越高,反之说明调度越无效,调度动作的价值越低。因此通过评估值,可以确定在当前情况下各个调度动作的价值,进而选择合适的调度动作进行调度。
S105:利用评估值在多个调度动作中确定目标调度动作,并基于目标调度动作对任务队列中的候选子任务进行调度。
本实施例并不限定确定目标调度动作的具体方式,根据评估值的具体计算方式的不同,目标调度动作的确定方式可以不同。在一种实施方式中,可以将最小评估值或最大评估值对应的调度动作确定为目标调度动作;在另一种实施方式中,可以利用贪婪算法(例如∈-greedy算法)从多个评估值中确定目标值,并将目标值对应的调度动作确定为目标调度动作。目标调度动作即为在当前情况下最优的调度动作,因此可以基于目标调度动作对候选子任务进行调度。
应用本申请实施例提供的任务调度方法,不将用户的任务需求看作一个整体,而是将其组成该任务需求的各个子任务拆分出来,对各个子任务进行调度,实现在一个决策阶段内对多个任务需求进行调度的效果,最大程度上提高边缘计算网络的效率。对各个任务需求进行拆分可以得到多个子任务,各个子任务之间具有约束关系,用于约束子任务的执行先后顺序。通过对非候选子任务进行执行条件的检测,判断其能够开始被执行,并在其满足执行条件时将其放入任务队列,等待被调度。通过对服务器网络进行检测,可以得到表征边缘服务器负载状态的服务器状态信息,以及表示各个服务器之间网络通信压力的通信信息。任务队列的队列信息可以表示可以被执行的任务的情况。通过将队列信息、通信信息和服务器状态信息输入动作价值评估模型,可以利用动作价值评估模型基于上述信息,对各种可行的调度动作的效 果进行评估,得到对应的评估值。根据评估值可以从多个调度动作中选择在当前情况下最佳的目标调度动作,并基于其对任务队列中的候选子任务进行调度。通过将用户需求进行拆分,并根据多个边缘服务器的状态、网络通信压力和可以被执行的子任务的情况,对构成不同任务需求的候选子任务在多个边缘服务器上进行并行调度,利用多个边缘服务器并行执行多个任务需求,这样的调度方式可以将任务需求的调度进一步细化,进而进一步提高任务执行效率,提高了边缘服务器的效率,减少了完成任务需求所需要的时长,进而提高了任务需求的响应速度,解决了相关技术存在的边缘计算网络效率较低、用户需求响应速度慢的问题。
基于上述实施例,可以理解的是,在利用动作价值评估模型进行任务调度之前,可以对任务调度模型进行训练,得到动作价值评估模型。本实施例并不限定动作价值评估模型的具体训练方式和过程,在一种实施方式中,动作价值评估模型的训练过程具体可以包括如下步骤:
步骤41:获取多个训练数据,并将训练数据分别输入初始网络,得到各个训练数据分别对应的多个训练评估值。
初始网络为未训练完毕的网络模型,其训练达到收敛时,即转变为动作价值评估模型。训练数据的具体内容不做限定,可以理解的是,其中必然存在训练环境信息,训练环境信息包括用于训练的服务器状态信息、通信信息和队列信息。在得到训练数据后将其输入初始网络,以便初始网络对其进行处理,得到各个训练数据分别对应的多个训练评估值。训练评估值与上述实施例中评估值的生成过程相同。
本实施例并不限定初始网络的具体形式和架构,在一种实施方式中,初始网络为DNN网络(Deep Neural Network,深度神经网络),该初始网络可以用QN表示,其参数可以用ω表示。对于训练数据的获取方式,在一种可行的实施方式中,可以获取外部输入的数据作为训练数据。在另一种可行的实施方式中,由于任务调度过程较复杂,训练数据的质量对模型的性能影响较大,因此为了得到准确的训练数据,获取多个训练数据的过程具体可以包括如下步骤:
步骤51:判断候选训练数据的数量是否达到采样阈值。
由于整个训练过程由多轮迭代的训练过程组成,在每轮训练时利用多个训练数据,训练数据的数量即为采样阈值,可以用M表示。在获取训练数据时,首先需要判断是否有足够的训练数据用于获取,因此判断候选训练数据的数量是否达到采样阈值,候选训练数据是指可以被选择作为训练数据的数据。具体的,候选训练数据可以被放置于缓存池,缓存池大小可以为D,理论上,D应当远远大于M。
步骤52:若达到采样阈值,则利用上一训练轮次对应的训练数据和性能参数生成新的候选训练数据,并从候选训练数据中随机选择采样阈值个训练数据。
当候选训练数据的数量达到采样阈值时,说明有足够的候选数据,能够从中选择部分作为训练数据。在这种情况下,为了对候选训练数据进行扩充,可以利用上一训练轮次中使用的训练数据以及对应的性能参数生成新的候选训练数据,以便对候选训练数据进行扩充,新的候选训练数据的具体生成过程与后续目标训练数据的生成方式相同,将在后续说明。
此外,为了防止训练数据之间存在强关联性,提高模型训练的效果,可以采用随机选择的方式选择采样阈值个候选训练数据作为本轮训练的训练数据。
步骤53:若未达到采样阈值,则从候选训练数据中确定最新候选训练数据,并将最新候选训练数据输入初始网络,得到各个调度动作分别对应的多个训练评估值。
若未达到采样阈值,则说明当前的候选训练数据的数量不足,不足以支撑开始一轮训练,在这种情况下,为了保证训练数据的准确性,可以利用初始网络生成训练数据。具体的,获取最新生成的候选训练数据,并将其作为生成目标训练数据的基础,将其输入初始网络,即可利用初始模型对其记性处理,得到对应的多个训练评估值。
具体的,在本实施例中,可以利用
Figure PCTCN2021121894-appb-000002
表示候选训练数据和训练数据,在本实施方式中,还可以利用其表示最新候选训练数据。其中,CP t i为服务器状态信息,其具体表示第i个边缘服务 器在t时刻下的负载压力,由于共有N的边缘服务器,因此CP t i的维度为1*N,每个元素表示一个边缘服务器的负载压力,例如可以为边缘服务器的下一个空闲时刻。L i,j t为通信信息,其具体表示第i个边缘服务器到第j个边缘服务器方向上通信信道的数据传输压力,例如可以为该信道下一个空闲时刻,由于通信信道为双向,双向情况不同,因此通信信息的维度为N*N。RT t为队列信息,在本实施例中,其具体为任务队列前N个候选子任务对应的信息,队列信息的维度可以为2*N,其中第一列元素表示候选子任务对应的允许等待时长,第二列元素表示候选子任务对应的输入数据的数据量。将其输入QN网络,可以得到各个调度动作对应的训练评估值,可以称为Q值,根据输入数据、模型参数、调度动作的不同,Q值的具体大小也不同。
步骤54:利用训练评估值确定训练调度动作,并基于训练调度动作进行任务调度。
在得到训练评估值后,可以利用贪婪算法对其进行处理,得到对应的目标值,并将该目标值对应的调度动作确定为训练调度动作。具体的,该训练调度动作可以用A t表示。在确定训练调度动作后,基于状态转移方程P t进行任务调度,其中:
P t=P[S t+1|St A t]
其具体记录了在S t状态下执行训练调度动作A t后转换到下一环境状态S t+1的概率分布。
步骤55:对任务调度后的服务器网络进行状态检测,并利用得到的调度后状态信息、调度后通信信息和任务队列对应的调度后队列信息生成调度后环境信息。
在基于训练调度动作进行调度后,集群状态发生了改变,而改变后的状态可以用S t+1表示。具体的,在调度结束后的下一次调度开始时,通过状态检测并获取调度后任务队列对应的信息,即调度后队列信息,并利用其与调度后状态信息、调度后通信信息生成调度后环境信息,即S t+1
步骤56:利用调度后环境信息得到训练调度动作对应的训练性能参数,并利用训练性能参数、调度后环境信息、训练调度动作和最新候选训练数据生成目标训练数据,并将目标训练数据确定为候选训练数据。
在得到调度后环境信息后,可以根据其确定各个待调度子任务对应的边缘服务器,进而根据待调度子任务的分配情况计算对应的训练性能参数,以便利用其与调度后环境信息、训练调度动作和最新候选训练数据生成目标训练数据,并将目标训练数据作为新的候选训练数据,实现对候选训练数据的扩充。其中,训练性能参数是指能够表征调度后环境信息优劣的参数,同样表征了训练调度动作的优劣,在本实施例的应用场景下,边缘计算网络执行子任务所需的平均时长越小,则训练调度动作越好,相反则训练调度动作越差。因此可以将边缘计算网络执行子任务所需的平均时长确定为训练性能参数。本实施例并不限定训练性能参数的具体计算方式,可以理解的是,平均时长的计算越精确,则训练性能参数越准确,候选训练数据质量越高。在一种具体的实施方式中,利用调度后环境信息得到训练调度动作对应的训练性能参数的过程具体可以包括如下步骤:
步骤61:利用训练调度动作涉及的各个待调度子任务的数据处理时长和数据传输时长得到任务处理时延。
在本实施例中,训练过程中参与调度的子任务即为待调度子任务。边缘服务器执行待调度子任务所需的时长共包括两个部分,一个部分为对待调度子任务进行处理的任务处理时延,另一部分为任务等待时长,任务等待时长即为剩余计算时长,是指边缘服务器执行完当前未完成的任务所需的时长。第二部分的任务等待时长可以通过对待调度服务器进行剩余计算时长检测的方式得到,在此不再赘述。
对于任务处理时延,其同样由两部分组成,其中包括对任务进行处理的处理时长,还包括通过数据传输获取其所需输入数据的传输时长。具体的,任务处理时延可以为:
T(S)=T ij(S)+TP(S),
Figure PCTCN2021121894-appb-000003
其中,T(S)为任务处理时延,T ij(S)为传输时长,TP(S)为处理时长,S为待调度子任务的输入数据的数据量,i和j表示边缘服务器的编号,B ij表示两个边缘服务器之间的信道带宽,d ij表示信道的固有延迟,Z表示处理单位数据量所需的处理器周期数,F表示处理器频率。
步骤62:对训练调度动作涉及的各个待调度服务器进行剩余计算时长检测,得到剩余计算时长。
在本实施例中,可以利用T waiting表示剩余计算时长。
步骤63:将任务处理时延和对应的剩余计算时长相加,得到各个待调度服务器对应的任务延迟。
任务延迟具体为:
Figure PCTCN2021121894-appb-000004
其具体表示编号为n的边缘服务器从t时刻开始至执行完待调度子任务时刻的总时长。具体的,T waiting即为编号为n的边缘服务器对应的剩余计算时长,T(S)即为编号为n的边缘服务器分配的待调度子任务对应的任务处理时延。
步骤64:利用各个任务延迟得到平均延迟,并将平均延迟确定为训练性能参数。
在得到各个边缘服务器分别对应的任务延迟后,利用其计算平均延迟,并将其确定为训练性能参数。平均延迟可以用R t+1表示,其中:
Figure PCTCN2021121894-appb-000005
其中,N t表示参与调度的边缘服务器的集合,|N t|表示N t中边缘服务器的数量。由此可见,该训练性能参数越小,说明计算所需要的时长越短,调度动作越优。而本申请的最终目的为:
Figure PCTCN2021121894-appb-000006
即在多次调度的总延时最小。
在得到训练性能参数后,利用训练性能参数R t+1、调度后环境信息S t+1、训练调度动作A t、最新候选训练数据S t共同组成目标训练数据{S t,A t,R t+1,S t+1},并将其放入缓存池。
利用上述步骤51~步骤56和步骤61~步骤64中的技术方案,可以完成训练数据的获取。将训练数据输入初始模型后,即可得到对应的训练评估值。
步骤42:利用训练评估值确定目标训练调度动作,并根据目标训练调度动作进行任务调度,并得到各个训练数据对应的性能参数。
需要说明的是,本实施中利用训练评估值计算得到性能参数的方式,与上述步骤中计算得到训练性能参数的方式相同,该性能参数同样可以用R t+1表示。具体的,在得到评估值后,基于贪婪算法对评估值进行处理,得到目标训练调度动作A t,并执行目标训练调度动作,得到调度后的环境信息S t+1,并生成对应的性能参数R t+1
步骤43:利用性能参数得到目标评估值,并利用训练评估值和目标评估值得到损失值。
在得到性能参数后,利用其生成对应的目标评估值,进而生成损失值。在本实施例中,目标评估值可以用Q target表示,其中:
Q target=R t+1*min A′(Q(S t+1,A′,ω))
其中,γ为回报折扣因子,min A′(Q(S t+1,A′,ω))为各个训练评估值中的最小值,该评估值对应于调度动作A’。在得到目标评估值后,利用其计算损失值L,其中:
Figure PCTCN2021121894-appb-000007
其中,m为本轮训练中训练数据的编号,A m为编号为m的训练数据经初始模型处理后得到的调度动作,S m为该训练数据对应的系统环境参数,即编号为m的训练数据对应的S t,在此表示为S m
步骤44:利用损失值更新初始网络,迭代训练得到动作价值评估模型。
本实施例并不限定对初始网络进行更新的具体方式,例如可以基于梯度反向传播的方式更新初始网络。在初始网络更新后进行迭代训练,即重新选择新的训练数据重复上述训练过程,直至初始模型达到收敛,转换为动作价值评估模型。
下面对本申请实施例提供的任务调度装置进行介绍,下文描述的任务调度装置与上文描述的任务调度方法可相互对应参照。
请参考图3,图3为本申请实施例提供的一种任务调度装置的结构示意图,包括:
拆分模块110,用于若获取到任务需求,则对任务需求进行拆分,得到多个具有约束关系的子任务;
队列更新模块120,用于对非候选子任务进行执行条件检测,将满足执行条件的非候选子任务确定为候选子任务,并将候选子任务放入任务队列;
状态检测模块130,用于对边缘服务器构成的服务器网络进行状态检测,得到服务器状态信息和通信信息;
动作评估模块140,用于将服务器状态信息、通信信息和任务队列对应的队列信息输入动作价值评估模型,得到多个调度动作分别对应的多个评估值;
调度模块150,用于利用评估值在多个调度动作中确定目标调度动作,并基于目标调度动作对任务队列中的候选子任务进行调度。
可选地,状态检测模块130,包括:
起始判断单元,用于判断非候选子任务是否为需求起始任务;
第一确定单元,用于若是需求起始任务,则确定非候选子任务满足执行条件;
前序判断单元,用于若不是需求起始任务,则判断非候选子任务的前序任务是否全部执行完毕;
第二判断单元,用于若前序任务全部执行完毕,则确定非候选子任务满足执行条件;
第三判断单元,用于若前序任务未全部执行完毕,则确定非候选子任务不满足执行条件。
可选地,状态检测模块130,包括:
剩余计算时长检测单元,用于对各个边缘服务器进行剩余计算时长检测,得到服务器状态信息;
剩余传输时长检测单元,用于对服务器网络中的各个网络信道进行剩余传输时长检测,得到通信信息。
可选地,包括:
训练数据输入模块,用于获取多个训练数据,并将训练数据分别输入初始网络,得到各个训练数据分别对应的多个训练评估值;
性能参数计算模块,用于利用训练评估值确定目标训练调度动作,并根据目标训练调度动作进行任务调度,并得到各个训练数据对应的性能参数;
损失计算模块,用于利用性能参数得到目标评估值,并利用训练评估值和目标评估值得到损失值;
更新模块,用于利用损失值更新初始网络,迭代训练得到动作价值评估模型。
可选地,训练数据输入模块,包括:
阈值判断单元,用于判断候选训练数据的数量是否达到采样阈值;
随机选择单元,用于若达到采样阈值,则利用上一训练轮次对应的训练数据和性能参数生成新的候选训练数据,并从候选训练数据中随机选择采样阈值个训练数据;
输入单元,用于若未达到采样阈值,则从候选训练数据中确定最新候选训练数据,并将最新候选训练数据输入初始网络,得到各个调度动作分别对应的多个训练评估值;
训练调度动作确定单元,用于利用训练评估值确定训练调度动作,并基于训练调度动作进行任务调度;
调度后环境信息生成单元,用于对任务调度后的服务器网络进行状态检测,并利用得到的调度后状态信息、调度后通信信息和任务队列对应的调度后队列信息生成调度后环境信息;
目标训练数据生成单元,用于利用调度后环境信息得到训练调度动作对应的训练性能参数,并利用训练性能参数、调度后环境信息、训练调度动作和最新候选训练数据生成目标训练数据,并将目标训练数据确定为候选训练数据。
可选地,目标训练数据生成单元,包括:
任务处理时延计算子单元,用于利用训练调度动作涉及的各个待调度子任务的数据处理时长和数据传输时长得到任务处理时延;
剩余计算时长计算子单元,用于对训练调度动作涉及的各个待调度服务器进行剩余计算时长检测,得到剩余计算时长;
任务延迟计算子单元,用于将任务处理时延和剩余计算时长相加,得到各个待调度服务器对应的任务延迟;
平均计算子单元,用于利用各个任务延迟得到平均延迟,并将平均延迟确定为训练性能参数。
可选地,拆分模块110,包括:
子任务检测单元,用于对任务需求进行子任务检测,得到多个子任务;
约束关系获取单元,用于多各个子任务进行输入数据和输出数据检测,得到检测结果,并基于检测结果得到各个子任务之间的约束关系。
下面对本申请实施例提供的电子设备进行介绍,下文描述的电子设备与上文描述的任务调度方法可相互对应参照。
请参考图4,图4为本申请实施例提供的一种电子设备的结构示意图。其中电子设备100可以包括处理器101和存储器102,还可以进一步包括多媒体组件103、信息输入/信息输出(I/O)接口104以及通信组件105中的一种或多种。
其中,处理器101用于控制电子设备100的整体操作,以完成上述的任务调度方法中的全部或部分步骤;存储器102用于存储各种类型的数据以支持在电子设备100的操作,这些数据例如可以包括用于在该电子设备100上操作的任何应用程序或方法的指令,以及应用程序相关的数据。该存储器102可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,例如静态随机存取存储器(Static Random Access Memory,SRAM)、电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、可擦除可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM)、可编程只读存储器(Programmable Read-Only Memory,PROM)、只读存储器(Read-Only Memory,ROM)、磁存储器、快闪存储器、磁盘或光盘中的一种或多种。
多媒体组件103可以包括屏幕和音频组件。其中屏幕例如可以是触摸屏,音频组件用于输出和/或输入音频信号。例如,音频组件可以包括一个麦克风,麦克风用于接收外部音频信号。所接收的音频信号可以被进一步存储在存储器102或通过通信组件105发送。音频组件还包括至少一个扬声器,用于输出音频信号。I/O接口104为处理器101和其他接口模块之间提供接口,上述其他 接口模块可以是键盘,鼠标,按钮等。这些按钮可以是虚拟按钮或者实体按钮。通信组件105用于电子设备100与其他设备之间进行有线或无线通信。无线通信,例如Wi-Fi,蓝牙,近场通信(Near Field Communication,简称NFC),2G、3G或4G,或它们中的一种或几种的组合,因此相应的该通信组件105可以包括:Wi-Fi部件,蓝牙部件,NFC部件。
电子设备100可以被一个或多个应用专用集成电路(Application Specific Integrated Circuit,简称ASIC)、数字信号处理器(Digital Signal Processor,简称DSP)、数字信号处理设备(Digital Signal Processing Device,简称DSPD)、可编程逻辑器件(Programmable Logic Device,简称PLD)、现场可编程门阵列(Field Programmable Gate Array,简称FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述实施例给出的任务调度方法。
下面对本申请实施例提供的计算机可读存储介质进行介绍,下文描述的计算机可读存储介质与上文描述的任务调度方法可相互对应参照。
本申请还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现上述的任务调度方法的步骤。
该计算机可读存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
本领域技术人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可 以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应该认为超出本申请的范围。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系属于仅仅用来将一个实体或者操作与另一个实体或者操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语包括、包含或者其他任何变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。
本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (10)

  1. 一种任务调度方法,其特征在于,包括:
    若获取到任务需求,则对所述任务需求进行拆分,得到多个具有约束关系的子任务;
    对非候选子任务进行执行条件检测,将满足执行条件的所述非候选子任务确定为候选子任务,并将所述候选子任务放入任务队列;
    对边缘服务器构成的服务器网络进行状态检测,得到服务器状态信息和通信信息;
    将所述服务器状态信息、所述通信信息和所述任务队列对应的队列信息输入动作价值评估模型,得到多个调度动作分别对应的多个评估值;
    利用所述评估值在多个所述调度动作中确定目标调度动作,并基于所述目标调度动作对所述任务队列中的所述候选子任务进行调度。
  2. 根据权利要求1所述的任务调度方法,其特征在于,所述对非候选子任务进行执行条件检测,包括:
    判断所述非候选子任务是否为需求起始任务;
    若是所述需求起始任务,则确定所述非候选子任务满足所述执行条件;
    若不是所述需求起始任务,则判断所述非候选子任务的前序任务是否全部执行完毕;
    若所述前序任务全部执行完毕,则确定所述非候选子任务满足所述执行条件;
    若所述前序任务未全部执行完毕,则确定所述非候选子任务不满足所述执行条件。
  3. 根据权利要求1所述的任务调度方法,其特征在于,所述对边缘服务器构成的服务器网络进行状态检测,得到服务器状态信息和通信信息,包括:
    对各个所述边缘服务器进行剩余计算时长检测,得到所述服务器状态信息;
    对所述服务器网络中的各个网络信道进行剩余传输时长检测,得到所述通信信息。
  4. 根据权利要求1所述的任务调度方法,其特征在于,所述动作价值评估模型的训练过程,包括:
    获取多个训练数据,并将所述训练数据分别输入初始网络,得到各个所述训练数据分别对应的多个训练评估值;
    利用所述训练评估值确定目标训练调度动作,并根据所述目标训练调度动作进行任务调度,并得到各个所述训练数据对应的性能参数;
    利用所述性能参数得到目标评估值,并利用所述训练评估值和所述目标评估值得到损失值;
    利用所述损失值更新所述初始网络,迭代训练得到所述动作价值评估模型。
  5. 根据权利要求4所述的任务调度方法,其特征在于,所述获取多个训练数据,包括:
    判断候选训练数据的数量是否达到采样阈值;
    若达到所述采样阈值,则利用上一训练轮次对应的所述训练数据和所述性能参数生成新的所述候选训练数据,并从所述候选训练数据中随机选择所述采样阈值个所述训练数据;
    若未达到所述采样阈值,则从所述候选训练数据中确定最新候选训练数据,并将所述最新候选训练数据输入所述初始网络,得到各个所述调度动作分别对应的多个所述训练评估值;
    利用所述训练评估值确定训练调度动作,并基于所述训练调度动作进行任务调度;
    对任务调度后的所述服务器网络进行状态检测,并利用得到的调度后状态信息、调度后通信信息和所述任务队列对应的调度后队列信息生成调度后环境信息;
    利用所述调度后环境信息得到所述训练调度动作对应的训练性能参数,并利用所述训练性能参数、所述调度后环境信息、所述训练调度动作和所述最新候选训练数据生成目标训练数据,并将所述目标训练数据确定为所述候选训练数据。
  6. 根据权利要求5所述的任务调度方法,其特征在于,所述利用所述调度后环境信息得到所述训练调度动作对应的训练性能参数,包括:
    利用所述训练调度动作涉及的各个待调度子任务的数据处理时长和数据传输时长得到任务处理时延;
    对所述训练调度动作涉及的各个待调度服务器进行剩余计算时长检测,得到剩余计算时长;
    将所述任务处理时延和所述剩余计算时长相加,得到各个所述待调度服务器对应的任务延迟;
    利用各个所述任务延迟得到平均延迟,并将所述平均延迟确定为所述训练性能参数。
  7. 根据权利要求1所述的任务调度方法,其特征在于,所述对所述任务需求进行拆分,得到多个具有约束关系的子任务,包括:
    对所述任务需求进行子任务检测,得到多个所述子任务;
    对各个所述子任务进行输入数据和输出数据检测,得到检测结果,并基于所述检测结果得到各个所述子任务之间的所述约束关系。
  8. 一种任务调度装置,其特征在于,包括:
    拆分模块,用于若获取到任务需求,则对所述任务需求进行拆分,得到多个具有约束关系的子任务;
    队列更新模块,用于对非候选子任务进行执行条件检测,将满足执行条件的所述非候选子任务确定为候选子任务,并将所述候选子任务放入任务队列;
    状态检测模块,用于对边缘服务器构成的服务器网络进行状态检测,得到服务器状态信息和通信信息;
    动作评估模块,用于将所述服务器状态信息、所述通信信息和所述任务队列对应的队列信息输入动作价值评估模型,得到多个调度动作分别对应的多个评估值;
    调度模块,用于利用所述评估值在多个所述调度动作中确定目标调度动作,并基于所述目标调度动作对所述任务队列中的所述候选子任务进行调度。
  9. 一种电子设备,其特征在于,包括存储器和处理器,其中:
    所述存储器,用于保存计算机程序;
    所述处理器,用于执行所述计算机程序,以实现如权利要求1至7任一项所述的任务调度方法。
  10. 一种计算机可读存储介质,其特征在于,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的任务调度方法。
PCT/CN2021/121894 2021-06-01 2021-09-29 一种任务调度方法、装置、电子设备及可读存储介质 WO2022252456A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/037,414 US11934871B1 (en) 2021-06-01 2021-09-29 Task scheduling method and apparatus, electronic device, and readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110606786.1 2021-06-01
CN202110606786.1A CN113254178B (zh) 2021-06-01 2021-06-01 一种任务调度方法、装置、电子设备及可读存储介质

Publications (1)

Publication Number Publication Date
WO2022252456A1 true WO2022252456A1 (zh) 2022-12-08

Family

ID=77185667

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/121894 WO2022252456A1 (zh) 2021-06-01 2021-09-29 一种任务调度方法、装置、电子设备及可读存储介质

Country Status (3)

Country Link
US (1) US11934871B1 (zh)
CN (1) CN113254178B (zh)
WO (1) WO2022252456A1 (zh)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115981871A (zh) * 2023-03-17 2023-04-18 苏州万店掌网络科技有限公司 一种gpu资源调度方法、装置、设备及存储介质
CN116302898A (zh) * 2023-05-17 2023-06-23 之江实验室 一种任务治理方法、装置、存储介质及电子设备
CN116541165A (zh) * 2023-04-23 2023-08-04 中国电子产品可靠性与环境试验研究所((工业和信息化部电子第五研究所)(中国赛宝实验室)) 实时系统任务调度方法、装置、计算机设备以及存储介质
CN116680064A (zh) * 2023-08-03 2023-09-01 中航信移动科技有限公司 一种任务节点的管理方法、电子设备及存储介质
CN117032993A (zh) * 2023-10-08 2023-11-10 麒麟软件有限公司 任务调度方法
CN117251035A (zh) * 2023-09-27 2023-12-19 中关村科学城城市大脑股份有限公司 散热控制方法、装置、电子设备和计算机可读介质
CN117785487A (zh) * 2024-02-27 2024-03-29 融科联创(天津)信息技术有限公司 一种算力资源调度方法、装置、设备和介质

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254178B (zh) * 2021-06-01 2021-10-29 苏州浪潮智能科技有限公司 一种任务调度方法、装置、电子设备及可读存储介质
CN113626173B (zh) * 2021-08-31 2023-12-12 阿里巴巴(中国)有限公司 调度方法、装置及存储介质
CN114039962A (zh) * 2021-11-04 2022-02-11 北京知道创宇信息技术股份有限公司 节点选取方法、系统、电子设备及存储介质
CN114253735B (zh) * 2021-12-29 2024-01-16 苏州浪潮智能科技有限公司 一种任务处理方法、装置及相关设备
CN114978929B (zh) * 2022-04-29 2023-08-18 苏州浪潮智能科技有限公司 一种网络调度装置和方法
CN116489230B (zh) * 2023-06-28 2023-09-22 深圳前海环融联易信息科技服务有限公司 任务调度方法、装置、计算机设备及存储介质
CN117931456B (zh) * 2024-03-20 2024-06-14 石家庄科林电气股份有限公司 多任务调度方法、装置及处理芯片

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918205A (zh) * 2019-03-25 2019-06-21 深圳市网心科技有限公司 一种边缘设备调度方法、系统、装置及计算机存储介质
US20200073710A1 (en) * 2018-08-30 2020-03-05 Baidu Online Network Technology (Beijing) Co., Ltd. Task scheduling method, apparatus, electronic device and storage medium
CN112328378A (zh) * 2020-11-05 2021-02-05 南京星环智能科技有限公司 任务调度方法、计算机设备及存储介质
CN113254178A (zh) * 2021-06-01 2021-08-13 苏州浪潮智能科技有限公司 一种任务调度方法、装置、电子设备及可读存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918201B (zh) * 2019-03-05 2021-05-11 中国联合网络通信集团有限公司 任务卸载的控制方法和系统
CN110830294B (zh) * 2019-11-01 2022-05-10 湘潭大学 一种基于分支定界法的边缘计算任务分配方法
CN111427679B (zh) * 2020-03-25 2023-12-22 中国科学院自动化研究所 面向边缘计算的计算任务调度方法、系统、装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200073710A1 (en) * 2018-08-30 2020-03-05 Baidu Online Network Technology (Beijing) Co., Ltd. Task scheduling method, apparatus, electronic device and storage medium
CN109918205A (zh) * 2019-03-25 2019-06-21 深圳市网心科技有限公司 一种边缘设备调度方法、系统、装置及计算机存储介质
CN112328378A (zh) * 2020-11-05 2021-02-05 南京星环智能科技有限公司 任务调度方法、计算机设备及存储介质
CN113254178A (zh) * 2021-06-01 2021-08-13 苏州浪潮智能科技有限公司 一种任务调度方法、装置、电子设备及可读存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SONG CHUNHE, WU TINGTING, XU WENXIANG, YU SHIMAO, ZENG PENG: "Edge Computing Model and Verification Method of Industrial Internet Intelligent Manufacturing", AUTOMATION PANORAMA, 15 January 2020 (2020-01-15), pages 48 - 51, XP093009933 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115981871A (zh) * 2023-03-17 2023-04-18 苏州万店掌网络科技有限公司 一种gpu资源调度方法、装置、设备及存储介质
CN115981871B (zh) * 2023-03-17 2024-01-26 苏州万店掌网络科技有限公司 一种gpu资源调度方法、装置、设备及存储介质
CN116541165A (zh) * 2023-04-23 2023-08-04 中国电子产品可靠性与环境试验研究所((工业和信息化部电子第五研究所)(中国赛宝实验室)) 实时系统任务调度方法、装置、计算机设备以及存储介质
CN116302898A (zh) * 2023-05-17 2023-06-23 之江实验室 一种任务治理方法、装置、存储介质及电子设备
CN116680064A (zh) * 2023-08-03 2023-09-01 中航信移动科技有限公司 一种任务节点的管理方法、电子设备及存储介质
CN116680064B (zh) * 2023-08-03 2023-10-10 中航信移动科技有限公司 一种任务节点的管理方法、电子设备及存储介质
CN117251035A (zh) * 2023-09-27 2023-12-19 中关村科学城城市大脑股份有限公司 散热控制方法、装置、电子设备和计算机可读介质
CN117251035B (zh) * 2023-09-27 2024-04-12 中关村科学城城市大脑股份有限公司 散热控制方法、装置、电子设备和计算机可读介质
CN117032993A (zh) * 2023-10-08 2023-11-10 麒麟软件有限公司 任务调度方法
CN117032993B (zh) * 2023-10-08 2024-04-05 麒麟软件有限公司 任务调度方法
CN117785487A (zh) * 2024-02-27 2024-03-29 融科联创(天津)信息技术有限公司 一种算力资源调度方法、装置、设备和介质
CN117785487B (zh) * 2024-02-27 2024-05-24 融科联创(天津)信息技术有限公司 一种算力资源调度方法、装置、设备和介质

Also Published As

Publication number Publication date
CN113254178B (zh) 2021-10-29
CN113254178A (zh) 2021-08-13
US11934871B1 (en) 2024-03-19
US20240103907A1 (en) 2024-03-28

Similar Documents

Publication Publication Date Title
WO2022252456A1 (zh) 一种任务调度方法、装置、电子设备及可读存储介质
CN108958916B (zh) 一种移动边缘环境下工作流卸载优化方法
US20220366320A1 (en) Federated learning method, computing device and storage medium
US12008445B2 (en) Black-box optimization using neural networks
US11182216B2 (en) Auto-scaling cloud-based computing clusters dynamically using multiple scaling decision makers
US20170039485A1 (en) System and Method for Balancing Computation with Communication in Parallel Learning
CN110717574B (zh) 一种神经网络运行方法、装置及异构智能芯片
CA3070133A1 (en) Interacting with a user device to provide automated testing of a customer service representative
US11302303B2 (en) Method and device for training an acoustic model
CN114298322B (zh) 联邦学习方法和装置、系统、电子设备、计算机可读介质
WO2023024252A1 (zh) 网络模型训练方法、装置、电子设备及可读存储介质
WO2023124947A1 (zh) 一种任务处理方法、装置及相关设备
CN114065864B (zh) 联邦学习方法、联邦学习装置、电子设备以及存储介质
CN111343288B (zh) 作业调度方法、系统及计算设备
CN106648831B (zh) 基于萤火虫算法和动态优先级的云工作流调度方法
CN106406494B (zh) 一种处理器调度的方法及终端
WO2020248227A1 (zh) 一种基于负载预测的Hadoop计算任务推测执行方法
CN112862112A (zh) 联邦学习方法、存储介质、终端、服务器、联邦学习系统
CN115858048A (zh) 一种面向混合关键级任务动态到达边缘卸载方法
WO2021136068A1 (zh) 资源调度方法、装置、电子设备及计算机可读介质
CN113094155B (zh) Hadoop平台下的任务调度方法及装置
US20230273830A1 (en) Resource control method for function computing, device, and medium
JP2001350639A (ja) ソフトリアルタイムにおけるスケジューリング方法
WO2023216500A1 (zh) 智算中心的算力资源部署方法、装置、设备及存储介质
Ogden et al. Layercake: Efficient Inference Serving with Cloud and Mobile Resources

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21943809

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18037414

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21943809

Country of ref document: EP

Kind code of ref document: A1