A task scheduling method, device, equipment, system, program product and medium

By determining service priorities in the edge computing environment and using genetic algorithms to optimize task scheduling, the problem that the computing needs of IoT devices cannot be met in traditional cloud computing systems is solved, and efficient and reliable task allocation and cost control are achieved.

CN118394488BActive Publication Date: 2024-10-11INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410845387.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-11
Estimated Expiration
2044-06-27

AI Technical Summary

Technical Problem

Traditional cloud computing systems cannot meet the growing computing needs of IoT devices, especially in terms of real-time performance and bandwidth. Fog computing and edge computing have limited capacity and difficulty in evenly scheduling tasks, making it difficult to meet the computing needs of IoT devices.

Method used

By determining the service priority of tasks, using fitness functions and equipment constraints, and combining genetic algorithms to perform multiple rounds of iterative updates, task scheduling is optimized to allocate execution equipment to ensure that the needs of to-be-scheduled tasks are met and the total operating cost is controlled.

Benefits of technology

It realizes efficient and reliable task scheduling in the edge computing environment, meets the computing needs of IoT devices, and reduces the total operating cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118394488B_ABST
    Figure CN118394488B_ABST
Patent Text Reader

Abstract

The present invention provides a task scheduling method, device, equipment, system, program product and medium, which relates to the field of edge computing, and can determine the service priority of the task to be scheduled according to the task information of the task to be scheduled, and determine the fitness function and device constraint conditions according to the task information and service priority. Among them, the fitness function is used to determine the total operating cost of all execution devices, the device constraint conditions are used to constrain the remaining amount of hardware resources and the processing time consumption of each execution device, and the constraint value of the device constraint conditions is positively correlated with the service priority level, which can ensure that the device constraint conditions can constrain each execution device with corresponding strength according to the service priority level; further, the present invention uses the fitness function and the device constraint conditions to perform multiple rounds of genetic algorithm iterations on the execution device, which can ensure that the scheduling allocation of the execution device meets the needs of the task to be scheduled and generates a reasonable total operating cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of edge computing, and in particular to a task scheduling method, device, equipment, system, program product and medium. Background Art

[0002] With the development of technologies such as artificial intelligence and big data, IoT devices are becoming more and more intelligent and are gradually integrated into all aspects of society, such as smart homes, smart cities, and Internet of Vehicles. The improvement of intelligence means that IoT devices need to call on more computing resources to complete computing tasks. However, traditional cloud computing-based systems can no longer meet the growing needs of IoT devices, such as in terms of real-time performance and bandwidth. The emergence of fog computing and edge computing has alleviated the limitations of traditional cloud computing in such devices to a certain extent. Therefore, offloading the computing needs of IoT devices to edge devices is also a current solution.

[0003] Compared with cloud computing, fog computing and edge computing are closer to terminal devices, and each computing device has a certain area of ​​responsibility, so they can reduce information transmission time and help IoT devices better perform computing analysis and decision-making. However, compared with cloud computing, the capacity of fog computing and edge computing is usually limited, and one computing device may not be able to meet all the computing needs of the current responsible area. In addition, since the tasks submitted by different IoT devices have different requirements for computing resources and processing latency, if tasks are indiscriminately scheduled to computing devices for execution, it will be difficult to better meet the needs of IoT devices.

[0004] Therefore, how to better schedule the tasks submitted by IoT devices to computing devices for execution is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0005] The purpose of the present invention is to provide a task scheduling method, apparatus, equipment, system, program product and medium, which can determine the fitness function and equipment constraints according to the task information and service priority of the task to be scheduled, and can use the fitness function and the equipment constraints to perform multiple rounds of genetic algorithm iterative updates on the execution device, so as to allocate execution devices to the tasks to be allocated while applying constraints corresponding to the service priority, thereby ensuring that the execution device scheduling allocation meets the needs of the tasks to be scheduled and generates a reasonable total operating cost.

[0006] In order to solve the above technical problems, the present invention provides a task scheduling method, which is applied to a control device, and the method comprises:

[0007] When a task scheduling operation is triggered, device information of multiple computing devices and task information of the tasks to be scheduled are obtained; wherein the device information includes the remaining amount of hardware resources, the amount of operating cost, and the amount of processing time consumed, and the task information includes the hardware resource consumption information, the processing time limit information, and the task level information;

[0008] Determine the service priority of the task to be scheduled according to the task information, and determine the fitness function and the device constraint condition according to the task information and the service priority level; wherein the fitness function is used to determine the total operating cost of all execution devices, the device constraint condition is used to constrain the remaining amount of hardware resources and the processing time consumption of each of the execution devices, the constraint value of the device constraint condition is positively correlated with the service priority level, and the execution device is a computing device that executes the task to be scheduled;

[0009] Determine the optimal execution device allocation information by minimizing the fitness function value using the fitness function, the device constraint condition and the genetic algorithm;

[0010] The execution device is determined according to the optimal execution device allocation information, and the task to be scheduled is sent to the execution device for processing.

[0011] Optionally, determining the service priority level of the task to be scheduled according to the task information includes:

[0012] Determine the service priority value corresponding to the task to be scheduled according to the task information;

[0013] Determine a target threshold interval in which the service priority value is located among multiple continuous threshold intervals, and determine the service priority level corresponding to the target threshold interval as the service priority level of the task to be scheduled; wherein different threshold intervals are set with different service priority levels, and the value of the threshold interval is positively correlated with the service priority level.

[0014] Optionally, determining the service priority value corresponding to the to-be-scheduled task according to the task information includes:

[0015] The delay priority value is determined according to the processing time limit information according to the following formula:

[0016] ;

[0017] The resource consumption priority value is determined according to the hardware resource consumption information according to the following formula:

[0018] ;

[0019] The task level priority value is determined according to the task level information according to the following formula:

[0020] ;

[0021] The delay priority value, the resource consumption priority value and the task level priority value are weighted according to the following formula to obtain the service priority value:

[0022] ;

[0023] in, represents the delay priority value, represents a real-time task identification value in the processing time limit information, wherein the real-time task identification value is a first value or a second value, wherein the first value indicates that the task to be scheduled needs to be processed in real time, and the second value indicates that the task to be scheduled does not need to be processed in real time, represents the task deadline in the processing time limit information, represents the remaining time of the task in the processing time limit information, e represents a natural base number, represents the resource consumption priority value, represents a resource dependency value, and the resource dependency value is positively correlated with the hardware resource consumption recorded in the hardware resource consumption information, represents a task dependency identification value in the hardware resource consumption information, the task dependency identification value is a third value or a fourth value, the third value indicates that the task to be scheduled depends on the processing results of other tasks, and the fourth value indicates that the task to be scheduled does not depend on the processing results of other tasks, represents the priority value of the task level, represents the user level in the task level information, Indicates the task level in the task level information; represents the service priority value, , , They respectively represent the weight values ​​corresponding to the delay priority value, the resource consumption priority value, and the task level priority value.

[0024] Optionally, the hardware resource consumption information and the processing time limit information in the task information are determined by a model simulation method and / or by a historical data statistical analysis method.

[0025] Optionally, determining a device constraint condition according to the task information and the service priority level includes:

[0026] Determine the remaining amount constraint of computing resources according to the service priority level:

[0027] ;

[0028] in, node represents the execution device, Capcity_Compute(node) represents the remaining amount of computing resources of the execution device, Compute_threshold 1 Indicates the remaining computing resource threshold corresponding to the low service priority level. Compute_threshold 2 Indicates the remaining computing resource threshold corresponding to the high service priority level. Compute_ threshold 1 < Compute_threshold 2 , when the service priority level is lower than the preset level, it is a low service priority level, and when the service priority level is not lower than the preset level, it is a high service priority level;

[0029] Determine the remaining memory resource constraint according to the service priority level:

[0030] ;

[0031] in, InMemory_Compute(node) Indicates the remaining amount of memory resources of the execution device, InMemory_ threshold 1 Indicates the remaining memory resource threshold corresponding to the low service priority level. InMemory_threshold 2 Indicates the remaining memory resource threshold corresponding to the high service priority level. InMemory_threshold 1 < InMemory_threshold 2 ;

[0032] Determine the remaining bandwidth resource constraint condition according to the service priority level:

[0033] ;

[0034] in, BandWidth_Compute(node) represents the remaining bandwidth resource of the execution device, BandWidth_threshold 1 Indicates the remaining bandwidth resource threshold corresponding to the low service priority level. BandWidth_ threshold 2 Indicates the remaining bandwidth resource threshold corresponding to the high service priority level. BandWidth_threshold 1 < BandWidth_threshold 2 ;

[0035] Determine the processing time constraint condition according to the processing time limit information:

[0036] ;

[0037] in, represents the processing limit time in the processing time limit information, MessagePassingTime , ServiceComputingTime , ResponseTime , DelayTime Respectively represent the task transmission time, task calculation time, task response time and delay time in the processing time consumption;

[0038] The computing resource remaining amount constraint condition, the memory resource remaining amount constraint condition, the bandwidth resource remaining amount constraint condition, and the processing time constraint condition are set as the device constraint conditions.

[0039] Optionally, determining a fitness function according to the task information and the service priority level includes:

[0040] Determine the fitness function according to the task information and the service priority:

[0041] ;

[0042] in, fitness represents the fitness function, n represents the total number of execution devices, Indicates i The energy cost of each execution device, It is expressed as:

[0043] ;

[0044] represents the energy consumption cost value required by the execution device to execute the task with low service priority level, represents the energy cost value required to maintain the execution device, represents the energy consumption cost value required by the execution device to execute the task with high service priority level, represents the first scaling factor;

[0045] represents the fixed capital cost value, It is expressed as:

[0046] ;

[0047] represents the fixed capital cost value of the execution equipment, It is expressed as:

[0048] ;

[0049] in, represents the equipment fixed maintenance capital cost value of the execution equipment, Indicates the equipment capital cost value of the execution equipment;

[0050] A system fixed maintenance capital cost value corresponding to the system composed of all the computing devices;

[0051] represents the service capital cost value, It is expressed as:

[0052] ;

[0053] represents the service capital cost value required for the execution device to execute the task with the low service priority level, represents the service capital cost value required for the execution device to execute the task with high service priority level, represents the second scaling factor, represents the capital cost value corresponding to the system during the period of providing business services, It represents the energy consumption cost value corresponding to the system during the period of providing business services.

[0054] Optionally, the operating cost and processing time in the equipment information are determined by model simulation and / or by statistical analysis of historical data.

[0055] Optionally, the determining the best execution device allocation information by using the fitness function, the device constraint condition and the genetic algorithm in a manner of minimizing the fitness function value includes:

[0056] Randomly initialize a first preset number of execution device allocation information, and convert the execution device allocation information into a chromosome; wherein the chromosome includes a gene corresponding to each of the computing devices, and the value of the gene is a first value or a second value, the first value indicates that the computing device is allocated as the execution device, and the second value indicates that the computing device is not allocated as the execution device;

[0057] Remove the chromosomes that do not meet the device constraint conditions, calculate the fitness value for each remaining chromosome using the fitness function, and determine whether there is a fitness value less than a preset threshold;

[0058] If so, determining the optimal execution device allocation information according to the chromosome corresponding to the fitness value less than the preset threshold;

[0059] If not, performing individual selection processing on the remaining chromosomes to screen out a second preset number of chromosomes; wherein the second preset number is smaller than the first preset number;

[0060] The screened chromosomes are subjected to chromosome crossover processing and chromosome variation processing to replenish the number of chromosomes from the second preset number to the first preset number, and after the processing, the chromosomes that do not meet the device constraint conditions are removed, the fitness value is calculated for each remaining chromosome using the fitness function, and it is determined whether there is a fitness value less than a preset threshold.

[0061] Optionally, performing individual selection processing on the remaining chromosomes comprises:

[0062] Initialize the iteration round to 1, and add the remaining chromosomes to the first set;

[0063] Randomly selecting a third preset number of chromosomes from the first set as chromosomes to be compared;

[0064] Move the chromosome to be compared with the lowest fitness value among the chromosomes to be compared from the first set to the second set;

[0065] Determining whether the iteration round is equal to the second preset number;

[0066] If yes, then based on the chromosomes in the second set, the step of performing chromosome crossover processing and chromosome variation processing on the selected chromosomes is performed;

[0067] If not, the iteration round is increased by 1, and the process proceeds to the step of randomly selecting a third preset number of chromosomes from the first set as chromosomes to be compared.

[0068] Optionally, performing chromosome crossover processing on the screened chromosomes comprises:

[0069] The selected chromosomes are subjected to uniform chromosome crossover treatment.

[0070] Optionally, performing chromosome variation processing on the screened chromosomes includes:

[0071] The number of chromosome mutations is determined according to the following formula based on the preset mutation rate and the total number of chromosomes;

[0072] ;

[0073] in, represents the number of chromosome mutations, represents the total number of chromosomes, Indicates the preset mutation rate, Indicates that in the interval Generate random numbers in Indicates rounding down. Indicates selecting the maximum value between a and b;

[0074] According to the number of chromosome mutations, a corresponding number of chromosomes are randomly selected from the screened chromosomes as chromosomes to be mutated;

[0075] For each of the chromosomes to be mutated, the number of mutated genes and the positions of the mutated genes in the chromosome to be mutated are determined according to the following formula;

[0076] ;

[0077] ;

[0078] in, represents the number of mutated genes, represents the total number of genes contained in each chromosome, represents the position of the variant gene, and the number of the positions of the variant gene is the number of the variant genes;

[0079] The gene at each mutated gene position in each of the chromosomes to be mutated is numerically flipped to obtain a mutated chromosome.

[0080] Optionally, before initializing multiple sets of execution device allocation information, the method further includes:

[0081] Determining whether the computing device can satisfy the device constraint;

[0082] If it can be satisfied, then enter the step of initializing multiple sets of execution device allocation information;

[0083] If it cannot be satisfied, other tasks being executed by the computing device and having a lower service priority than the task to be scheduled are removed from the computing device, and after the tasks are removed, the step of initializing multiple sets of execution device allocation information is entered.

[0084] Optionally, before obtaining the device information of the plurality of computing devices and the task information of the tasks to be scheduled, the method further includes:

[0085] The multiple computing devices are determined from a designated area; wherein the designated area is a service area where a user terminal that sends the task to be scheduled is located, or a travel area determined according to a travel route of the user terminal.

[0086] Optionally, the process of setting the control device and the plurality of computing devices in the service area includes:

[0087] Acquire task sample data corresponding to a plurality of tasks; wherein the task sample data includes the user terminal connection ratio and communication duration of each service area corresponding to when a plurality of user terminals send the tasks to each service area;

[0088] Determine the service area to which the task sample data belongs according to the user terminal connection ratio and the communication duration;

[0089] According to the task sample data of each service area and the number of user terminals connected to each computing device in the service area, the control device is determined in the computing devices in the service area, so that the number of user terminals connected to the control device is not less than a preset proportion of the total number of user terminals connected to the service area and the total communication duration of all tasks received by the control device is closest to the sum of the communication durations recorded in the task sample data of the service area;

[0090] In the network topology formed by all computing devices in the service area, all computing devices starting from the control device and having a topological connection value with the control device less than a preset value are regarded as computing devices providing services in the service area.

[0091] Optionally, trigger a task scheduling operation, including:

[0092] When a new terminal task sent by a user terminal is received, the task scheduling operation is triggered, and the new terminal task is used as the task to be scheduled; or,

[0093] When a failure of the computing device is detected, the task scheduling operation is triggered, and the task being executed by the failed computing device is used as the task to be scheduled; or,

[0094] When it is detected that a task being executed by the computing device is to be migrated, the task scheduling operation is triggered, and the task to be migrated is used as the task to be scheduled.

[0095] Optionally, when the control device fails, the task to be scheduled is scheduled by a backup node corresponding to the control device or an upper-level control device corresponding to the control device.

[0096] The present invention also provides a task scheduling device, which is applied to a control device, and the device comprises:

[0097] An information acquisition module, used to acquire device information of multiple computing devices and task information of the tasks to be scheduled when a task scheduling operation is triggered; wherein the device information includes the remaining amount of hardware resources, the amount of operating cost, and the amount of processing time consumed, and the task information includes hardware resource consumption information, processing time limit information, and task level information;

[0098] A function and condition determination module, used to determine the service priority of the task to be scheduled according to the task information, and determine the fitness function and the device constraint conditions according to the task information and the service priority level; wherein the fitness function is used to determine the total operating cost of all execution devices, the device constraint conditions are used to constrain the remaining amount of hardware resources and the processing time consumption of each of the execution devices, the constraint value of the device constraint conditions is positively correlated with the service priority level, and the execution device is a computing device that executes the task to be scheduled;

[0099] A genetic algorithm iteration module, used to determine the best execution device allocation information by minimizing the fitness function value using the fitness function, the device constraint condition and the genetic algorithm;

[0100] The appointment scheduling module is used to determine the execution device according to the best execution device allocation information, and send the task to be scheduled to the execution device for processing.

[0101] The present invention also provides a control device, comprising:

[0102] Memory for storing computer programs;

[0103] The processor is used to implement the task scheduling method as described above when executing the computer program.

[0104] The present invention also provides a task scheduling system, comprising:

[0105] A control device, used to execute the task scheduling method as described above;

[0106] A plurality of computing devices are used to process the tasks issued by the control device.

[0107] Optionally, the computing device is an edge device.

[0108] The present invention also provides a computer program product, comprising a computer program / instruction, wherein the computer program / instruction implements the steps of the task scheduling method described above when executed by a processor.

[0109] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the task scheduling method as described above is implemented.

[0110] The present invention provides a task scheduling method, which is applied to a control device. The method comprises: when a task scheduling operation is triggered, obtaining device information of multiple computing devices and task information of a task to be scheduled; wherein the device information comprises a remaining amount of hardware resources, an operating cost amount and a processing time consumption amount, and the task information comprises hardware resource consumption information, processing time limit information and task level information; determining a service priority level of the task to be scheduled according to the task information, and determining a fitness function and a device constraint condition according to the task information and the service priority level; wherein the fitness function is used to determine the total operating cost of all execution devices, the device constraint condition is used to constrain the remaining amount of hardware resources and the processing time consumption amount of each execution device, the constraint value of the device constraint condition is positively correlated with the service priority level, and the execution device is a computing device that executes the task to be scheduled; determining the optimal execution device allocation information by using the fitness function, the device constraint condition and a genetic algorithm in a manner of minimizing the fitness function value; determining the execution device according to the optimal execution device allocation information, and sending the task to be scheduled to the execution device for processing.

[0111] It can be seen that when the control device in the present invention triggers the task scheduling operation, it can first obtain the device information of multiple computing devices and the task information of the task to be scheduled. Among them, the device information may include the remaining amount of hardware resources, the amount of operating cost and the amount of processing time consumption, that is, the device information reflects the processing capacity and operating cost of each computing device; the task information includes hardware resource consumption information, processing time limit information and task level information, that is, the task information reflects the demand of the task to be scheduled for hardware resources and processing time limit. Subsequently, the control device can determine the service priority level of the task to be scheduled according to the task information, and determine the fitness function and device constraint conditions according to the task information and the service priority level. Among them, the fitness function is used to determine the total operating cost of all execution devices, and the execution device is a computing device that executes the task to be scheduled, that is, the present invention can use the fitness function and genetic algorithm to iteratively optimize the scheduling method of the computing device to ensure that the scheduling method reaches a better total operating cost; the device constraint condition is used to constrain the remaining amount of hardware resources and the processing time consumption of each execution device, and the constraint value of the device constraint condition is positively correlated with the service priority level, which can ensure that the device constraint condition can constrain the remaining amount of hardware resources and the processing time consumption of each computing device according to the service priority level to constrain the corresponding strength, so as to ensure that the computing device can reliably and efficiently execute the task to be scheduled. Subsequently, the control device uses the fitness function, the device constraint condition and the genetic algorithm to determine the optimal execution device allocation information in a manner of minimizing the fitness function value, and then determines the execution device according to the optimal execution device allocation information, and sends the task to be scheduled to the execution device for processing, so as to ensure that the scheduling allocation of the computing device meets the needs of the task to be scheduled and generates a reasonable total operating cost. The present invention also provides a task scheduling device, device, system, program product and medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0112] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0113] Figure 1 A structural block diagram of a task scheduling system provided by an embodiment of the present invention;

[0114] Figure 2 A flowchart of a task scheduling method provided by an embodiment of the present invention;

[0115] Figure 3 A schematic diagram of a first task scheduling process provided by an embodiment of the present invention;

[0116] Figure 4 A schematic diagram of a second task scheduling process provided by an embodiment of the present invention;

[0117] Figure 5 A schematic diagram of a third task scheduling process provided by an embodiment of the present invention;

[0118] Figure 6 A schematic diagram of a chromosome set according to execution device allocation information provided by an embodiment of the present invention;

[0119] Figure 7 A schematic diagram of a genetic algorithm execution process provided by an embodiment of the present invention;

[0120] Figure 8 A structural block diagram of a task scheduling device provided by an embodiment of the present invention;

[0121] Figure 9 This is a structural block diagram of a control device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0122] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0123] With the development of technologies such as artificial intelligence and big data, IoT devices are becoming more and more intelligent and are gradually integrated into all aspects of society, such as smart homes, smart cities, and Internet of Vehicles. The improvement of intelligence means that IoT devices need to call on more computing resources to complete computing tasks. However, traditional cloud computing-based systems can no longer meet the growing needs of IoT devices, such as in terms of real-time performance and bandwidth. The emergence of fog computing and edge computing has, to a certain extent, gotten rid of the limitations of traditional cloud computing in meeting the needs of such devices. Therefore, offloading the computing needs of IoT devices to edge devices is also a current solution.

[0124] Compared with cloud computing, fog computing and edge computing are closer to terminal devices, and each computing device has a certain responsible area, so they can reduce information transmission time and help IoT devices to better perform computing analysis and decision-making. However, compared with cloud computing, the capacity of fog computing and edge computing is usually limited, and one computing device may not be able to meet all the computing needs of the current responsible area. In addition, since the tasks submitted by different IoT devices have different requirements for computing resources and processing delays, if the tasks are indiscriminately scheduled to computing devices for execution, it is also difficult to better meet the needs of IoT devices. In view of this, the present invention can provide a task scheduling method, which can determine the fitness function and device constraints according to the task information and service priority of the task to be scheduled, and can use the fitness function and the device constraints to perform multiple rounds of genetic algorithm iterations on the execution device to update the execution device, so as to assign the execution device to the task to be assigned under the condition of applying the constraints corresponding to the service priority, so as to ensure that the execution device scheduling and allocation meet the needs of the task to be scheduled and generate a reasonable total operating cost.

[0125] For ease of understanding, the hardware system structure to which the present invention is applicable will be first introduced below. Figure 1 , Figure 1 This is a structural block diagram of a task scheduling system provided by an embodiment of the present invention. This task scheduling system may include at least a single control device 10 and multiple computing devices 20, wherein the control device 10 is used to receive the task to be scheduled, determine the execution device allocation plan, and schedule the task to be scheduled to the execution device for processing, wherein the execution device refers to the computing device 20 that the control device 10 determines needs to execute the task to be scheduled; and the computing device 20 is used to receive the task to be scheduled issued by the control device 10. It can be seen that in the embodiment of the present invention, the task scheduling method provided by the present invention is mainly executed by the control device 19. It should be noted that the above-mentioned task to be scheduled can be a user terminal task uploaded to the control device 10 by a user terminal (such as an Internet of Things terminal), or it can be a task currently being executed in the computing device 20. That is, the control device 10 can execute this task scheduling method according to the user terminal requirements, or it can execute this task scheduling method when there is a task migration requirement on a computing device 20 (for example, the computing device 20 fails or the remaining resources cannot meet the execution requirements of important tasks). Furthermore, the control device 10 can not only meet new user needs, but also dynamically migrate the tasks currently being executed by the computing device 20 according to the specific working conditions of the computing device 20 to ensure high-quality completion of the tasks.

[0126] Furthermore, it is understandable that the multiple computing devices 20 scheduled by the control device 10 may come from a designated area. The designated area may be either a fixed, pre-manually divided service area or a dynamically generated area. For example, in the Internet of Vehicles scenario, since the user terminal may be a movable vehicle-mounted device, a travel area may be determined according to the travel route of the user terminal, and the control device 10 may perform task scheduling in the multiple computing devices 20 contained in this travel area. It should be noted that the embodiments of the present invention do not limit the specific setting method of the service area and the travel area, nor do they limit the number of computing devices 20 that each area can contain, and can be set according to actual needs.

[0127] Furthermore, the embodiment of the present invention does not limit the number of computing devices 20, which can be set according to actual application requirements. In addition, there may be multiple control devices 10. Among these multiple control devices 10, a main control device may be included for executing the task scheduling method, and multiple backup control nodes may be included for replacing the main control device when the main control device fails. In addition, the control device 10 may also be a special computing device 20. For example, in a cluster environment of multiple computing devices 20, one of the computing devices 20 with the best computing performance and communication performance may be selected as the control device 10. In addition, the control device 10 may also have an upper-level control device (such as a cloud computing device), which can detect the fault condition of the control device 10, and switch the backup control device when it is determined that the control device 10 fails, or execute the task scheduling method for the control device 10.

[0128] Furthermore, the embodiments of the present invention do not limit the hardware form of the control device 10 and the computing device 20, and can be set according to actual application requirements. For example, in an edge computing scenario, each computing device 20 can be an edge device; and when the control device 10 is a special computing device 20, the control device 10 can also be an edge device.

[0129] Based on the above system structure description, the task scheduling method provided by the embodiment of the present invention is introduced below. Figure 2 , Figure 2 A flowchart of a task scheduling method provided by an embodiment of the present invention, which is applied to a control device, may include:

[0130] S201. When a task scheduling operation is triggered, device information of multiple computing devices and task information of the tasks to be scheduled are obtained; wherein the device information includes the remaining amount of hardware resources, the operating cost amount and the processing time consumption amount, and the task information includes the hardware resource consumption information, the processing time limit information and the task level information.

[0131] In an embodiment of the present invention, a task scheduling operation refers to an operation of assigning an execution device to a task to be scheduled. When triggering a task scheduling operation, the control device first needs to obtain device information of each computing device among a plurality of computing devices, and needs to obtain task information of the task to be scheduled. As described above, the plurality of computing devices may come from a designated area, and the control device may determine a plurality of computing devices from the designated area; wherein the designated area may be a service area where a user terminal that sends the task to be scheduled is located, or may be a travel area determined according to the travel route of the user terminal. The above device information and task information will be introduced below.

[0132] Device information is the information of each computing device itself, which may include the remaining amount of hardware resources, operating cost and processing time. The remaining amount of hardware resources indicates the remaining amount of various hardware resources in the computing device, such as the remaining amount of CPU resources, the remaining amount of memory, the remaining amount of network bandwidth, etc. The operating cost may include energy consumption cost and capital cost. The energy consumption cost refers to the energy consumption generated during the operation of the computing device, such as the energy consumption generated when running at no load and when executing tasks; the capital cost refers to the capital cost generated during the operation of the computing device, such as the capital cost required to purchase and maintain each computing device, and may further include the capital cost generated when the computing device executes tasks. The processing time refers to the amount of time required for the computing device to execute a task, which may include task transmission time, task calculation time, task response time, delay time, etc. It should be pointed out that the remaining amount of hardware resources is a numerical quantity obtained in real time, that is, when the control device triggers the task scheduling operation, it needs to obtain the remaining amount of hardware resources corresponding to each computing device at the current moment; and the operating cost and processing time can be preset quantities. For example, the operating cost and processing time in the device information are determined by model simulation, or by historical data statistical analysis, or by a combination of model simulation and historical data statistical analysis.

[0133] Furthermore, the task information is the information of the task to be scheduled, which may include hardware resource consumption information, processing time limit information and task level information. Hardware resource consumption information refers to the hardware resources consumed to execute the task to be scheduled, such as CPU resource consumption, memory consumption, network bandwidth consumption, etc. The hardware resource consumption information may limit the remaining amount of hardware resources of the computing device. The processing time limit information includes the time limit information that can be consumed to execute the task to be scheduled, such as the upper limit of time consumption, and may further include the task deadline and the task remaining time, where the amount of time remaining from the task remaining time to the current moment to the task deadline. The task level information is the task level marked by the task and manually specified, for example, it may include user level, task level, etc., where the task level is the user level corresponding to the user who submitted the task to be scheduled; the task level is the task level of the task to be scheduled, for example, it may be a real-time level that characterizes whether the task to be scheduled is executed in real time. It should be pointed out that the hardware resource consumption information, processing time limit information and task level information in the task information are all preset information, among which the hardware resource consumption information and processing time limit information in the task information can be determined through model simulation, based on historical data statistical analysis, or through a combination of model simulation and historical data statistical analysis.

[0134] Furthermore, the execution device described above can trigger the task scheduling operation when receiving a new terminal task sent by the user terminal; it can also trigger the task scheduling operation when detecting a failure of a computing device, and use the task being executed by the failed computing device as a task to be scheduled; it can also trigger the task scheduling operation when detecting that a task being executed by a computing device needs to be migrated, and use the task to be migrated as a task to be scheduled. In this way, not only can the needs of the user terminal be met, but also the tasks being executed by each computing device can be flexibly scheduled according to the working conditions of each computing device, thereby improving the overall reliability of the system.

[0135] Based on this, triggering task scheduling operations may include:

[0136] Step 11: When a new terminal task sent by a user terminal is received, a task scheduling operation is triggered, and the new terminal task is used as a task to be scheduled; or,

[0137] Step 12: When a computing device failure is detected, a task scheduling operation is triggered, and the task being executed by the failed computing device is used as a task to be scheduled; or,

[0138] Step 13: When it is detected that a task being executed by the computing device is to be migrated, a task scheduling operation is triggered, and the task to be migrated is used as a task to be scheduled.

[0139] It should be noted that the embodiments of the present invention do not limit how the control device detects the fault conditions of each computing device, and can be set according to actual application conditions.

[0140] S202. Determine the service priority of the task to be scheduled based on the task information, and determine the fitness function and device constraint conditions based on the task information and the service priority level; wherein the fitness function is used to determine the total operating cost of all execution devices, and the device constraint conditions are used to constrain the remaining amount of hardware resources and processing time consumption of each execution device. The constraint value of the device constraint condition is positively correlated with the service priority level, and the execution device is a computing device that executes the task to be scheduled.

[0141] Based on the above introduction to device information and task information, it can be understood that the remaining amount of hardware resources and the amount of processing time in the device information need to be consistent with the hardware resource consumption information and the processing time limit information in the task information to meet the task execution requirements. However, simple consistency cannot well guarantee the execution effect of the computing device on the task. For example, the computing device may execute multiple tasks at the same time, and the real-time occupation of hardware resources for each task is different, and the time limit requirements for each task are different. When some tasks are stuck and the consumption of hardware resources suddenly increases, it will affect the quality of the computing device to execute other tasks, especially the execution quality of tasks with higher task levels, and it is difficult to meet the time limit requirements of such tasks; in addition, the computing device may fail, and other computing devices are needed to replace it to execute the task. If the replaced computing device has less hardware resources left, it may also affect the execution effect. Therefore, for tasks with large hardware resource occupation and stricter time limits, the control device should ensure that the computing device has sufficient margin as fault-tolerant redundancy to ensure the execution effect of such tasks.

[0142] For this reason, when the control device assigns an execution device to a task to be assigned, it must first determine the service priority of the task to be scheduled based on the task information of the task to be scheduled, and determine the fitness function and device constraints based on the task information and the service priority. The service priority represents the priority of the task to be scheduled. The higher the priority, the more redundancy the computing device needs to leave; conversely, the lower the priority, the less redundancy the computing device needs to leave. The fitness function is used to determine the total operating cost of all execution devices. The device constraints are used to constrain the remaining hardware resources and processing time of each execution device. The constraint value of the device constraints is positively correlated with the service priority. Obviously, the embodiment of the present invention can impose constraints of corresponding strength on the execution device according to the service priority to ensure that the execution device can reliably execute various tasks. The service priority, device constraints and fitness function will be introduced separately below.

[0143] In order to facilitate the determination of the service priority level of each task to be scheduled, the embodiment of the present invention can first determine the service priority value corresponding to the task based on the task information of the task to be scheduled. The service priority value represents the priority of the task. The larger the service priority value, the higher the priority. Conversely, the lower the service priority value, the lower the priority. Subsequently, the embodiment of the present invention can preset multiple continuous threshold intervals for the service priority value, and set a corresponding service priority level for each threshold interval, wherein the value of the threshold interval is positively correlated with the service priority level. Furthermore, the embodiment of the present invention can determine in which target threshold area the service priority value of the task to be scheduled is located, and can use the service priority level of the target threshold area as the service priority level of the task to be scheduled.

[0144] Based on this, the service priority of the task to be scheduled is determined according to the task information, which may include:

[0145] Step 21: Determine the service priority value corresponding to the task to be scheduled according to the task information;

[0146] Step 22: Determine the target threshold interval where the service priority value is located in multiple continuous threshold intervals, and determine the service priority level corresponding to the target threshold interval as the service priority level of the task to be scheduled; wherein different threshold intervals are set with different service priority levels, and the value of the threshold interval is positively correlated with the service priority level.

[0147] For example, the service priority can be A, B, and C. A is the highest priority, B is the second, and C is the lowest priority. The threshold ranges of these three levels can be:

[0148] ;

[0149] Among them, service level Indicates the service priority level, and score indicates the service priority value.

[0150] Furthermore, the embodiment of the present invention does not limit the specific calculation method of the service priority value, which can be set in combination with the specific content that can be included in the task information and actual needs. A possible calculation method of the service priority value is introduced below.

[0151] Based on this, the service priority value corresponding to the task to be scheduled is determined according to the task information, including:

[0152] Step 31: Determine the delay priority value according to the following formula based on the processing time limit information:

[0153] ;

[0154] in, Indicates the delay priority value. Indicates the real-time task identification value in the processing time limit information. The real-time task identification value is a first value or a second value. The first value indicates that the task to be scheduled needs to be processed in real time, and the second value indicates that the task to be scheduled does not need to be processed in real time. Indicates the task deadline in the processing time limit information. represents the remaining time of the task in the processing time limit information, and e represents the natural base.

[0155] It should be noted that The estimation can be done by combining relevant equipment status and processing time limit information. Greater than When No more than When the task is urgent, the task can be migrated to other computing devices that can be executed efficiently. It can be considered as the latest time for the task to complete communication through the heartbeat protocol. , then by default Furthermore, the real-time task identification value can be 0 or 1, 0 indicates that the task to be scheduled does not need to be processed in real time, and 1 indicates that the task to be scheduled needs to be processed in real time.

[0156] Step 32: Determine the resource consumption priority value according to the following formula based on the hardware resource consumption information:

[0157] ;

[0158] in, Indicates the resource consumption priority value, Indicates the resource dependency value. The resource dependency value is positively correlated with the hardware resource consumption recorded in the hardware resource consumption information. Indicates the task dependency identification value in the hardware resource consumption information. The task dependency identification value is the third value or the fourth value. The third value indicates that the task to be scheduled depends on the processing results of other tasks, and the fourth value indicates that the task to be scheduled does not depend on the processing results of other tasks.

[0159] It should be noted that the resource dependency value is positively correlated with the hardware resource consumption (such as computing resource consumption, memory resource consumption, and bandwidth resource consumption) recorded in the hardware resource consumption information. In order to facilitate the determination of the resource dependency value, multiple values ​​can also be preset for the resource dependency value, and the specific value of the resource dependency value can be determined according to the number of types of hardware resource consumption that exceeds the preset resource consumption threshold. For example, the preset resource consumption threshold is 20% of the hardware resource amount of the computing device, and the resource dependency value is 0, 0.4, 0.7, and 1. The resource dependency value is taken as follows: when no hardware resource consumption is greater than 20% of the hardware resource amount of the computing device, the resource dependency value is 0; when one hardware resource consumption is greater than 20% of the hardware resource amount of the computing device, the resource dependency value is 0.4; when two hardware resource consumptions are greater than 20% of the hardware resource amount of the computing device, the resource dependency value is 0.7; when three hardware resource consumptions are greater than 20% of the hardware resource amount of the computing device, the resource dependency value is 1.

[0160] In addition, the task dependency identification value can be 0 or 1, 0 indicates that the task to be scheduled does not depend on the processing results of other tasks, and 1 indicates that the task to be scheduled depends on the processing results of other tasks.

[0161] Step 33: Determine the task level priority value according to the following formula based on the task level information:

[0162] ;

[0163] in, Indicates the task level priority value, Indicates the user level in the task level information. Indicates the task level in the task level information.

[0164] It should be noted that the task level is usually related to whether the task is a real-time task, so the value of the task level can be the same as the value of the real-time task identification value.

[0165] The value of can also be 0 or 1, 0 indicates that the user is a low-level user, and 1 indicates that the user is a high-level user. Of course, the specific user level can be set arbitrarily according to actual application requirements.

[0166] Step 34: The delay priority value, resource consumption priority value and task level priority value are weighted according to the following formula to obtain the service priority value:

[0167] ;

[0168] in, Indicates the service priority value, , , They respectively represent the weight values ​​corresponding to the delay priority value, resource consumption priority value, and task level priority value.

[0169] It should be noted that the weight value can be set arbitrarily, for example , , It can be 1, 1.5, and 1 respectively.

[0170] It can be seen that the embodiment of the present invention can comprehensively determine the service priority level of the task to be scheduled from the three aspects of latency, resource consumption, and task level, thereby ensuring the reliability of the service priority level.

[0171] Further, the device constraint condition is used to constrain the remaining amount of hardware resources and the processing time consumption of each execution device, and the constraint value of the device constraint condition is positively correlated with the service priority level. It should be noted that the embodiment of the present invention does not limit the specific positive correlation, and can be set according to the actual application requirements, for example, it can be a linear relationship, a nonlinear relationship, or a step-by-step relationship. In the embodiment of the present invention, for the convenience of setting, a preset threshold corresponding to each service priority level can be set for each computing resource remaining amount of the computing device, and the higher the service priority level, the larger the preset threshold, and the lower the service priority level, the smaller the preset threshold. In this way, the embodiment of the present invention can ensure that the constraint strength of the remaining amount of computing resources is positively correlated with the service priority level, so as to effectively ensure the execution effect of the high service priority level task. A specific device constraint condition setting method is introduced below. It should be noted that in the following example, the service priority level is only classified into a high service priority level and a low service priority level, and thresholds are set for the high service priority level and the low service priority level respectively. However, in the actual application scenario, it is also feasible to set a corresponding threshold for each service priority level.

[0172] Based on this, equipment constraints are determined according to task information and service priority, including:

[0173] Determine the remaining computing resource constraints based on service priority:

[0174] ;

[0175] in, node Indicates the execution device, Capcity_Compute(node) Indicates the remaining computing resources of the execution device. Compute_threshold 1 Indicates the remaining computing resource threshold corresponding to the low service priority level. Compute_ threshold 2 Indicates the remaining computing resource threshold corresponding to the high service priority level. Compute_threshold 1 <Compute_threshold 2 When the service priority level is lower than the preset level, it is a low service priority level; when the service priority level is not lower than the preset level, it is a high service priority level.

[0176] Determine the remaining memory resource constraints based on service priority:

[0177] ;

[0178] in, InMemory_Compute(node) Indicates the remaining memory resources of the execution device. InMemory_ threshold 1 Indicates the remaining memory resource threshold corresponding to the low service priority level. InMemory_threshold 2 Indicates the remaining memory resource threshold corresponding to the high service priority level. InMemory_threshold 1 < InMemory_threshold 2 .

[0179] Determine the remaining bandwidth resource constraints based on service priority:

[0180] ;

[0181] in, BandWidth_Compute(node) Indicates the remaining bandwidth resources of the execution device. BandWidth_ threshold 1 Indicates the remaining bandwidth resource threshold corresponding to the low service priority level. BandWidth_threshold 2 Indicates the remaining bandwidth resource threshold corresponding to the high service priority level. BandWidth_threshold 1 < BandWidth_ threshold 2 .

[0182] Determine the processing time constraints based on the processing time limit information:

[0183] ;

[0184] in, Indicates the processing limit time in the processing time limit information. MessagePassingTime , ServiceComputingTime , ResponseTime , DelayTime They respectively represent the task transmission time, task calculation time, task response time, and delay time in the processing time.

[0185] The remaining computing resource constraint, the remaining memory resource constraint, the remaining bandwidth resource constraint, and the processing time constraint are set as device constraints.

[0186] It should be pointed out that the above preset threshold can be either a fixed threshold or a dynamic threshold. For the fixed threshold, the hardware resource consumption corresponding to the tasks of various service priority levels can be counted in advance, and the fixed threshold can be set according to the statistical results to ensure that the fixed threshold is greater than the hardware resource consumption corresponding to the service priority level tasks. For the dynamic threshold, the redundancy can be accumulated in the hardware resource consumption contained in the task information, and the redundancy is positively correlated with the service priority level, so as to achieve the dynamic setting of the threshold. In addition, the above preset threshold can also be related to the number of execution devices. This is because when the task to be scheduled is split into multiple execution devices for execution and the number of execution devices is large, the hardware resource occupation of each execution device by the task to be scheduled can obviously be less than the hardware resource occupation of each execution device when the task to be scheduled is only assigned to a single or a few execution devices. Therefore, the above preset threshold can also be dynamically adjusted according to the specific allocation number of the execution device.

[0187] It can be seen that the embodiment of the present invention can set four types of device constraints, namely, computing resource remaining constraint conditions, memory resource remaining constraint conditions, bandwidth resource remaining constraint conditions, and processing time constraint conditions, and can impose comprehensive hardware resource remaining constraint conditions on the execution device, thereby ensuring that the execution device can reliably execute tasks of various service priority levels.

[0188] Furthermore, the fitness function is used to determine the total operating cost of all execution devices; and the embodiment of the present invention will determine the final execution device allocation plan in a manner that minimizes the fitness function value, that is, on the basis of ensuring the execution effect of the scheduled tasks, minimize the total operating cost of the allocation plan to control the cost within a reasonable range. Unlike the related art, the fitness function in the embodiment of the present invention can also be set in combination with the service priority level. This is because the relevant costs (such as energy consumption costs, maintenance capital costs, etc.) generated by the computing device in executing high service priority tasks are different from the relevant costs generated by executing low service priority tasks, and usually the relevant costs of executing high service priority tasks are greater than the relevant costs generated by executing low service priority tasks. Therefore, when determining the fitness function, the embodiment of the present invention will additionally consider the relevant costs generated by the computing device in executing high service priority tasks. A possible fitness function is introduced below.

[0189] Based on this, the fitness function is determined according to the task information and service priority, which may include:

[0190] Determine the fitness function based on task information and service priority:

[0191] ;

[0192] in, fitness represents the fitness function, n Indicates the total number of execution devices, Indicates i The energy cost of each execution device, It is expressed as:

[0193] ;

[0194] Indicates the energy cost value required for the execution device to perform tasks with low service priority. Indicates the energy cost value required to maintain the execution equipment, Indicates the energy cost value required for the execution device to perform tasks with high service priority. represents the first scaling factor;

[0195] represents the fixed capital cost value, It is expressed as:

[0196] ;

[0197] represents the fixed capital cost value of the execution equipment, It is expressed as:

[0198] ;

[0199] in, Indicates the equipment fixed maintenance capital cost value of the execution equipment, represents the equipment capital cost value of the execution equipment;

[0200] It represents the fixed maintenance capital cost value of the system corresponding to the system composed of all computing devices;

[0201] represents the service capital cost value, It is expressed as:

[0202] ;

[0203] It represents the service capital cost value required for the execution equipment to perform tasks with low service priority level. It represents the service capital cost value required for the execution equipment to perform tasks with high service priority level. represents the second scaling factor, Indicates the capital cost value corresponding to the system during the period of providing business services. Indicates the energy consumption cost value corresponding to the system during the period of providing business services.

[0204] It should be pointed out that when the task to be scheduled is a low service priority task, , Optional; when the task to be scheduled is a high service priority task, it needs to be retained , .

[0205] It can be seen that in the above fitness function, not only the energy consumption cost and capital cost of each execution device can be taken into account, but also the energy consumption cost and capital cost of the task scheduling system as a whole can be taken into account, thereby improving the reliability of operating cost optimization.

[0206] S203: Determine the optimal execution device allocation information by minimizing the fitness function value using the fitness function, the device constraint conditions and the genetic algorithm.

[0207] After determining the fitness function and device constraints, the embodiment of the present invention can use a genetic algorithm to determine which execution devices among the multiple computing devices are assigned to execute the task to be scheduled. Among them, the optimal execution device allocation information includes the optimal allocation method for allocating execution devices among multiple computing devices; the genetic algorithm is a computational model of the biological evolution process that simulates the natural selection and genetics mechanism of biological evolution. When solving more complex combinatorial optimization problems, it can be optimized from the perspective of population evolution. Compared with some conventional optimization algorithms, it can usually obtain better optimization results faster. Therefore, using a genetic algorithm to determine the optimal execution device allocation information can significantly improve the effect of execution device allocation, thereby ensuring that the execution device can reliably execute tasks of various service priority levels, while generating a reasonable total operating cost.

[0208] Of course, the control device can only make allocations when it is determined that the multiple computing devices can meet the above-mentioned device constraints. If it is determined that the computing device cannot meet the device constraints, then the allocation cannot be made. In the case where the device constraints cannot be met, the control device can also remove other tasks in the computing device with a service priority lower than the task to be scheduled from the computing device, thereby releasing the hardware resources of the computing device, thereby ensuring that the computing device has sufficient hardware resources to execute the task to be scheduled.

[0209] Based on this, before initializing multiple sets of execution device allocation information, the following may also be included:

[0210] Step 41: Determine whether the computing device can satisfy the device constraint condition; if it can, proceed to step 42; if it cannot, proceed to step 43;

[0211] Step 42: Enter the step of initializing multiple sets of execution device allocation information;

[0212] Step 43: other tasks being executed by the computing device and having a lower service priority than the task to be scheduled are removed from the computing device, and after the removal of the tasks is completed, the step of initializing multiple sets of execution device allocation information is entered.

[0213] Of course, if the task being executed in the computing device cannot be migrated and the service area cannot meet the needs of the user terminal, the control device can also hand over the task to the upper control device for scheduling. Figure 3 , Figure 3 A schematic diagram of a first task scheduling process provided by an embodiment of the present invention.

[0214] S204: Determine the execution device according to the optimal execution device allocation information, and send the task to be scheduled to the execution device for processing.

[0215] To understand the above task scheduling method, please refer to Figure 4 , Figure 4 This is a schematic diagram of the second task scheduling process provided by the embodiment of the present invention, which shows the main processes included in the method as a whole, namely data acquisition and service rating calibration, fitness function equipment, and algorithm training application. In addition, for the task scheduling situation under the condition of control device failure, the embodiment of the present invention also provides Figure 5 , Figure 5 This is a schematic diagram of the third task scheduling process provided by an embodiment of the present invention, which shows the process of replacing the backup device with the superior control device to perform task scheduling or replacing the failed control device to perform task scheduling in the event of a control device failure.

[0216] Based on the above embodiments, when the control device in the present invention triggers a task scheduling operation, it can first obtain the device information of multiple computing devices and the task information of the task to be scheduled. Among them, the device information may include the remaining amount of hardware resources, the amount of operating cost, and the amount of processing time, that is, the device information reflects the processing capacity and operating cost of each computing device; the task information includes hardware resource consumption information, processing time limit information, and task level information, that is, the task information reflects the demand of the task to be scheduled for hardware resources and processing time limit. Subsequently, the control device can determine the service priority level of the task to be scheduled based on the task information, and determine the fitness function and device constraint conditions based on the task information and the service priority level. Among them, the fitness function is used to determine the total operating cost of all execution devices, and the execution device is a computing device that executes the task to be scheduled, that is, the present invention can use the fitness function and genetic algorithm to iteratively optimize the scheduling method of the computing device to ensure that the scheduling method achieves a better total operating cost; the device constraint condition is used to constrain the remaining amount of hardware resources and processing time consumption of each execution device, and the constraint value of the device constraint condition is positively correlated with the service priority level, which can ensure that the device constraint condition can constrain the remaining amount of hardware resources and processing time consumption of each computing device according to the service priority level to ensure that the computing device can reliably and efficiently execute the task to be scheduled. Subsequently, the control device uses the fitness function, the device constraint condition and the genetic algorithm to determine the optimal execution device allocation information in a manner that minimizes the fitness function value, and then determines the execution device according to the optimal execution device allocation information, and sends the task to be scheduled to the execution device for processing, so as to ensure that the scheduling allocation of the computing device meets the needs of the task to be scheduled and generates a reasonable total operating cost.

[0217] Based on the above embodiment, the specific process of determining the optimal execution device allocation information by using the fitness function, the device constraint condition and the genetic algorithm is introduced below. In one possible case, determining the optimal execution device allocation information by using the fitness function, the device constraint condition and the genetic algorithm in a manner of minimizing the fitness function value may include:

[0218] S301. Randomly initialize a first preset number of execution device allocation information, and convert the execution device allocation information into a chromosome; wherein the chromosome includes a gene corresponding to each computing device, and the value of the gene is a first value or a second value, the first value indicates that the computing device is allocated as an execution device, and the second value indicates that the computing device is not allocated as an execution device.

[0219] For easier understanding of chromosomes, please refer to Figure 6 , Figure 6A schematic diagram of a chromosome set according to execution device allocation information provided by an embodiment of the present invention. If there are only four computing devices, the chromosome may contain four genes, corresponding to computing devices 1 to 4 in sequence. Each gene can be 0 or 1, where 0 means that the computing device is not allocated as an execution device, and 1 means that the computing device is allocated as an execution device. Randomly initializing the execution device allocation information and determining the chromosome based on the execution device allocation information means that the value of each gene in the chromosome is randomly determined, which ensures the diversity of the chromosome.

[0220] It should be noted that the embodiment of the present invention does not limit the specific value of the first preset number, which can be set according to actual application requirements.

[0221] S302: remove chromosomes that do not meet the device constraint conditions, calculate the fitness value for each remaining chromosome using the fitness function, and determine whether there is a fitness value less than a preset threshold.

[0222] After randomly generating several chromosomes, the embodiment of the present invention will use the device constraint conditions to screen the chromosomes to remove the chromosomes that do not meet the device constraint conditions. Subsequently, for the retained chromosomes, the embodiment of the present invention will further use the fitness function to calculate the fitness value (i.e., the total operating cost) of each chromosome, and determine whether there is a fitness value less than a preset threshold. If so, it means that the best execution device allocation information has been generated, and then it is only necessary to determine the best execution device allocation information based on the chromosome corresponding to the fitness value less than the preset threshold; if not, the retained chromosomes need to be processed by genetic algorithm.

[0223] It should be noted that the embodiment of the present invention does not limit the specific value of the preset threshold, which can be set according to actual application requirements.

[0224] Furthermore, in step S302, "fitness value is less than a preset threshold value" is the end condition of the genetic algorithm iteration. However, in actual application situations, there are multiple rounds of genetic algorithm iterations, but the chromosome whose fitness value is less than the preset threshold value cannot be determined, which leads to the inability to exit the iteration. Therefore, the embodiment of the present invention can also set other iteration exit conditions. For example, an upper limit of the number of iterations can be set. When it is determined that the current number of iterations is equal to the upper limit of the number of iterations, the iteration is exited, and the best execution device allocation information is determined based on the chromosome with the smallest fitness value at this time; for another example, the fitness value decrease rate between each round of iterations can be determined. When it is determined that the fitness value decrease rate of multiple rounds of iterations is less than the preset threshold value (that is, the fitness value basically does not decrease), the iteration can be exited, and the best execution device allocation information is determined based on the chromosome with the smallest fitness value at this time.

[0225] S303: If yes, determine the best execution device allocation information according to the chromosome corresponding to the fitness value less than the preset threshold.

[0226] It should be noted that if there are multiple chromosomes whose fitness values ​​are less than a preset threshold, the optimal execution device allocation information is determined according to the chromosome with the smallest fitness value.

[0227] S304: If not, perform individual selection processing on the remaining chromosomes to screen out a second preset number of chromosomes; wherein the second preset number is smaller than the first preset number.

[0228] In an embodiment of the present invention, the individual selection process is used to "compete" different chromosomes to further screen out chromosomes with better fitness performance. In order to reduce resource usage, the embodiment of the present invention will perform individual selection processing based on a tournament mechanism. Specifically, each round of the tournament can randomly sample s chromosomes from the chromosomes with replacement, and select the chromosome with the smallest fitness value to retain, and the remaining chromosomes continue to enter the next round of the tournament. In this way, if it is necessary to screen a second preset number of chromosomes, it is only necessary to execute the second preset number of rounds of the tournament. It is worth noting that the number of chromosomes retained by the individual selection process (i.e., the second preset number) is less than the first preset number, so that chromosomes with better performance can be selected to enter the next step of processing.

[0229] Based on this, individual selection processing is performed on the remaining chromosomes, which may include:

[0230] Step 51: Initialize the iteration round to 1, and add the remaining chromosomes to the first set;

[0231] Step 52: randomly selecting a third preset number of chromosomes from the first set as chromosomes to be compared;

[0232] Step 53: moving the chromosome to be compared with the lowest fitness value among the chromosomes to be compared from the first set to the second set;

[0233] Step 54: Determine whether the iteration round is equal to the second preset number; if so, proceed to step 55; if not, proceed to step 56:

[0234] Step 55: Based on the chromosomes in the second set, a step of performing chromosome crossover processing and chromosome variation processing on the selected chromosomes is performed;

[0235] Step 56: Add 1 to the iteration round, and enter the step of randomly selecting a third preset number of chromosomes from the first set as chromosomes to be compared.

[0236] It should be noted that the embodiment of the present invention does not limit the specific value of the second preset number, which can be set according to actual application requirements.

[0237] S305, performing chromosome crossover processing and chromosome variation processing on the screened chromosomes to replenish the number of chromosomes from the second preset number to the first preset number, and after the processing, entering the step of removing chromosomes that do not meet the device constraint conditions, using the fitness function to calculate the fitness value for each remaining chromosome, and determining whether there is a fitness value less than a preset threshold.

[0238] After completing the individual selection process, the embodiment of the present invention performs chromosome crossover processing and chromosome mutation processing on the screened chromosomes to further generate new chromosomes from the high-quality chromosomes. For chromosome crossover processing, the embodiment of the present invention can perform chromosome uniform crossover processing on the screened chromosomes, that is, the two fathers (two chromosomes) exchange their genes in turn to form new chromosomes. For chromosome mutation processing, in order to better perform mutation operations and make data mutations more random and fit the actual application scenarios, the embodiment of the present invention also determines the number of mutation bits for each chromosome and the number of chromosome mutations based on the number of computing devices and the mutation rate range, which specifically includes the following process:

[0239] Step 61: Determine the number of chromosome mutations according to the following formula based on the preset mutation rate and the total number of chromosomes;

[0240] ;

[0241] in, represents the number of chromosome mutations, represents the total number of chromosomes, Indicates the preset mutation rate, Indicates that in the interval Generate random numbers in Indicates rounding down. Indicates selecting the maximum value between a and b;

[0242] Step 62: randomly selecting a corresponding number of chromosomes from the screened chromosomes according to the number of chromosome mutations as chromosomes to be mutated;

[0243] Step 63: For each chromosome to be mutated, determine the number of mutated genes and the positions of the mutated genes in the chromosome to be mutated according to the following formula;

[0244] ;

[0245] ;

[0246] in, represents the number of mutated genes, represents the total number of genes contained in each chromosome, represents the position of the variant gene, and the number of positions of the variant gene is the number of variant genes;

[0247] Step 64: Perform a numerical flip on the gene at each mutated gene position in each chromosome to be mutated to obtain a mutated chromosome.

[0248] It should be pointed out that value flipping refers to switching the value of a gene from a current value to another value, such as switching from a first value to a second value, or from a second value to a first value; the value of the preset mutation rate can be set arbitrarily, for example, it can be 0.1. In addition, the mutated chromosome is a newly generated chromosome. It can be seen that the embodiment of the present invention can randomly determine which chromosomes to mutate based on the preset mutation rate, the total number of chromosomes, and the total number of genes, so as to mutate which gene positions in the mutated chromosomes, thereby increasing the randomness of chromosome mutation and further improving the probability of generating a chromosome with the best fitness value.

[0249] For further understanding, please refer to Figure 7 , Figure 7 A schematic diagram of a genetic algorithm execution process provided by an embodiment of the present invention.

[0250] Based on the above embodiments, the service area in the embodiments of the present invention is an artificially divided computing device coverage area that provides services to user terminals. It can be understood that the allocation of control devices and computing devices in the service area will directly affect the service quality of the area. Therefore, in order to ensure the service quality of the service area and ensure that the control device can achieve a higher service quality through the task scheduling method, the embodiments of the present invention can also dynamically allocate control devices and computing devices in each service area according to the historical execution data of the task. Based on this, the process of setting up control devices and multiple computing devices in the service area may include:

[0251] S401. Obtain task sample data corresponding to a plurality of tasks; wherein the task sample data includes a user terminal connection ratio and a communication duration in each service area corresponding to when a plurality of user terminals send tasks to each service area.

[0252] The user terminal connection ratio can be expressed as: , that is, the task sample data All user terminal IPs recorded in j The proportion of service areas. If missing Record, then It can be the default value (such as 5). The communication duration is the average time consumed by the user terminal to send tasks to the computing device in the service area, which can be expressed as , that is, the task sample data All user terminal IPs recorded in the task are sent to the j The average time taken to serve the area. Record, then It can be the topology level corresponding to the transmission time of the nearest device in the network topology structure.

[0253] S402: Determine the service area to which the task sample data belongs according to the user terminal connection ratio and the communication duration.

[0254] The purpose of step S402 is to determine which service area is responsible for processing the task corresponding to the task sample data. The process of determining the area to which the task sample data belongs can be expressed as:

[0255] ;

[0256] ;

[0257] ;

[0258] in, Represents task sample data The service area to which it belongs, Indicates j The average time it takes for a service area to receive a task, for When the value is minimum The service area to which it belongs.

[0259] S403. Determine a control device among the computing devices in the service area based on the task sample data of each service area and the number of user terminals connected to each computing device in the service area, so that the number of user terminals connected to the control device is not less than a preset proportion of the total number of user terminals connected to the service area and the total communication duration of all tasks received by the control device is closest to the sum of the communication durations recorded in the task sample data of the service area.

[0260] The purpose of step S403 is to select a control device from the multiple computing devices included in the service area. In order to achieve the purpose of control device selection, it is first necessary to ensure that the number of user terminals accessing the control device is large, and must be no less than a preset proportion of the total number of user terminals accessing the service area, such as 30%. In addition, the communication time for the user terminal to send a task to the control device must be as short as possible. Therefore, the present invention can continuously switch the control device to make the total communication time of the control device receiving the task close to the sum of the communication time recorded in the task sample data of the service area, which can be specifically expressed as:

[0261] .

[0262] Among them, in this step Indicates j Control devices in the service area, Indicates the number of user terminals connected to the control device. The total number of user terminals connected to the service area, It represents the total time for the computing device in the jth service area to transmit the computing task, and m is the total number of task sample data.

[0263] S404. In the network topology structure formed by all computing devices in the service area, all computing devices starting from the control device and having a topological connection value with the control device less than a preset value are regarded as computing devices providing services in the service area.

[0264] After determining the control node in the service area, it is necessary to further determine the computing devices contained in the area. The computing devices can be set according to the network topology connection value (set to 2 here, that is, starting from the current node, the deepest network topology structure it is connected to. If set to 2, starting from the current node, up to 2 layers of network topology development can be carried out upwards / downwards, which can be set according to actual conditions). Furthermore, when allocating resources, computing resources equivalent to the current task volume can be allocated to the computing devices, and the remaining resources are allocated in proportion to the number of topological connection layers in the service area (prioritizing resources close to the topological layer) and the degree of resource consumption (the degree of resource consumption is the sum of the normalized values ​​of all resources in the area).

[0265] Furthermore, the settings of the control devices and computing devices in the service area can be adjusted dynamically. For example, the resource consumption of computing tasks in each area can be counted at intervals, or if there is a sudden increase or decrease in resource consumption, the computing devices in each area can be recalculated and allocated.

[0266] The task scheduling device, control equipment, task scheduling system, computer program product, and computer-readable storage medium provided in the embodiments of the present invention are introduced below. The smart gateway described below and the message information processing method of the home smart gateway described above can be referenced to each other.

[0267] Please refer to Figure 8 , Figure 8 This is a structural block diagram of a task scheduling device provided by an embodiment of the present invention, which is applied to a control device and may include:

[0268] The information acquisition module 801 is used to acquire the device information of multiple computing devices and the task information of the tasks to be scheduled when the task scheduling operation is triggered; wherein the device information includes the remaining amount of hardware resources, the amount of operating cost and the amount of processing time consumed, and the task information includes the hardware resource consumption information, the processing time limit information and the task level information;

[0269] Function and condition determination module 802, used to determine the service priority of the task to be scheduled according to the task information, and determine the fitness function and device constraint conditions according to the task information and the service priority; wherein the fitness function is used to determine the total operating cost of all execution devices, the device constraint conditions are used to constrain the remaining amount of hardware resources and the processing time consumption of each execution device, the constraint value of the device constraint conditions is positively correlated with the service priority, and the execution device is a computing device that executes the task to be scheduled;

[0270] A genetic algorithm iteration module 803 is used to determine the best execution device allocation information by minimizing the fitness function value using the fitness function, the device constraint condition and the genetic algorithm;

[0271] The appointment scheduling module 804 is used to determine the execution device according to the best execution device allocation information, and send the task to be scheduled to the execution device for processing.

[0272] Optionally, the function and condition determination module 802 includes:

[0273] A service priority value determination submodule is used to determine the service priority value corresponding to the task to be scheduled according to the task information;

[0274] The service priority determination submodule is used to determine the target threshold interval where the service priority value is located in multiple continuous threshold intervals, and determine the service priority level corresponding to the target threshold interval as the service priority level of the task to be scheduled; wherein different threshold intervals are set with different service priority levels, and the value of the threshold interval is positively correlated with the service priority level.

[0275] Optionally, the service priority value determination submodule is specifically used to:

[0276] The delay priority value is determined according to the following formula based on the processing time limit information:

[0277] ;

[0278] The resource consumption priority value is determined according to the following formula based on the hardware resource consumption:

[0279] ;

[0280] The task level priority value is determined according to the following formula based on the task level information:

[0281] ;

[0282] The delay priority value, resource consumption priority value and task level priority value are weighted according to the following formula to obtain the service priority value:

[0283] ;

[0284] in, Indicates the delay priority value. Indicates the real-time task identification value in the processing time limit information. The real-time task identification value is a first value or a second value. The first value indicates that the task to be scheduled needs to be processed in real time, and the second value indicates that the task to be scheduled does not need to be processed in real time. Indicates the task deadline in the processing time limit information. represents the remaining time of the task in the processing time limit information, e represents the natural base number, Indicates the resource consumption priority value, Indicates the resource dependency value. The resource dependency value is positively correlated with the hardware resource consumption recorded in the hardware resource consumption information. Indicates the task dependency identification value in the hardware resource consumption information. The task dependency identification value is the third value or the fourth value. The third value indicates that the task to be scheduled depends on the processing results of other tasks. The fourth value indicates that the task to be scheduled does not depend on the processing results of other tasks. Indicates the task level priority value, Indicates the user level in the task level information. Indicates the task level in the task level information; Indicates the service priority value, , , They respectively represent the weight values ​​corresponding to the delay priority value, resource consumption priority value, and task level priority value.

[0285] Optionally, the function and condition determination module 802 includes a device constraint determination submodule, and the device constraint determination submodule is used to:

[0286] Determine the remaining computing resource constraints based on service priority:

[0287] ;

[0288] in, node Indicates the execution device, Capcity_Compute(node) Indicates the remaining computing resources of the execution device. Compute_threshold 1 Indicates the remaining computing resource threshold corresponding to the low service priority level. Compute_ threshold 2 Indicates the remaining computing resource threshold corresponding to the high service priority level. Compute_threshold 1 < Compute_threshold 2, when the service priority level is lower than the preset level, it is a low service priority level, and when the service priority level is not lower than the preset level, it is a high service priority level;

[0289] Determine the remaining memory resource constraints based on service priority:

[0290] ;

[0291] in, InMemory_Compute(node) Indicates the remaining memory resources of the execution device. InMemory_ threshold 1 Indicates the remaining memory resource threshold corresponding to the low service priority level. InMemory_threshold 2 Indicates the remaining memory resource threshold corresponding to the high service priority level. InMemory_threshold 1 < InMemory_threshold 2 ;

[0292] Determine the remaining bandwidth resource constraints based on service priority:

[0293] ;

[0294] in, BandWidth_Compute(node) Indicates the remaining bandwidth resources of the execution device. BandWidth_ threshold 1 Indicates the remaining bandwidth resource threshold corresponding to the low service priority level. BandWidth_threshold 2 Indicates the remaining bandwidth resource threshold corresponding to the high service priority level. BandWidth_threshold 1 < BandWidth_ threshold 2 ;

[0295] Determine the processing time constraints based on the processing time limit information:

[0296] ;

[0297] in, Indicates the processing limit time in the processing time limit information. MessagePassingTime , ServiceComputingTime , ResponseTime , DelayTime They represent the task transmission time, task calculation time, task response time, and delay time in the processing time respectively;

[0298] The remaining computing resource constraint, the remaining memory resource constraint, the remaining bandwidth resource constraint, and the processing time constraint are set as device constraints.

[0299] Optionally, the function and condition determination module 802 includes a fitness function determination submodule, and the fitness function determination submodule is used to:

[0300] Determine the fitness function based on task information and service priority:

[0301] ;

[0302] in, fitness represents the fitness function, n Indicates the total number of execution devices, Indicates i The energy cost of each execution device, It is expressed as:

[0303] ;

[0304] Indicates the energy cost value required for the execution device to perform tasks with low service priority. Indicates the energy cost value required to maintain the execution equipment, Indicates the energy cost value required for the execution device to perform tasks with high service priority. represents the first scaling factor;

[0305] represents the fixed capital cost value, It is expressed as:

[0306] ;

[0307] represents the fixed capital cost value of the execution equipment, It is expressed as:

[0308] ;

[0309] in, Indicates the equipment fixed maintenance capital cost value of the execution equipment, represents the equipment capital cost value of the execution equipment;

[0310] It represents the fixed maintenance capital cost value of the system corresponding to the system composed of all computing devices;

[0311] represents the service capital cost value, It is expressed as:

[0312] ;

[0313] It represents the service capital cost value required for the execution equipment to perform tasks with low service priority level. It represents the service capital cost value required for the execution equipment to perform tasks with high service priority level. represents the second scaling factor, Indicates the capital cost value corresponding to the system during the period of providing business services. Indicates the energy consumption cost value corresponding to the system during the period of providing business services.

[0314] Optionally, the genetic algorithm iteration module 803 includes:

[0315] The initialization submodule randomly initializes a first preset number of execution device allocation information, and converts the execution device allocation information into a chromosome; wherein the chromosome includes a gene corresponding to each computing device, and the value of the gene is a first value or a second value, the first value indicates that the computing device is allocated as an execution device, and the second value indicates that the computing device is not allocated as an execution device;

[0316] A loop control submodule is used to remove chromosomes that do not meet the device constraint conditions, calculate the fitness value for each remaining chromosome using the fitness function, and determine whether there is a fitness value less than a preset threshold;

[0317] The best execution device allocation information setting submodule is used to determine the best execution device allocation information according to the chromosome corresponding to the fitness value less than the preset threshold value, if any;

[0318] An individual selection submodule, for performing individual selection processing on the remaining chromosomes if they do not exist, so as to screen out a second preset number of chromosomes; wherein the second preset number is smaller than the first preset number;

[0319] The chromosome crossover and mutation submodule is used to perform chromosome crossover and chromosome mutation processing on the screened chromosomes to replenish the number of chromosomes from the second preset number to the first preset number, and after processing, enter the step of removing chromosomes that do not meet the device constraints, using the fitness function to calculate the fitness value for each remaining chromosome, and determine whether there is a fitness value less than a preset threshold.

[0320] Optionally, the individual selection submodule may include:

[0321] An initialization unit, used for initializing the iteration round to 1, and adding the remaining chromosomes to the first set;

[0322] A random sampling unit, used for randomly selecting a third preset number of chromosomes from the first set as chromosomes to be compared;

[0323] A championship unit, used for moving the chromosome to be compared having the lowest fitness value among the chromosomes to be compared from the first set to the second set;

[0324] A loop control unit is used to determine whether the iteration round is equal to a second preset number; if so, the step of performing chromosome crossover processing and chromosome mutation processing on the screened chromosomes based on the chromosomes in the second set is entered; if not, the iteration round is increased by 1, and the step of randomly selecting a third preset number of chromosomes from the first set as the chromosomes to be compared is entered.

[0325] Optionally, the chromosome crossover and mutation submodule includes:

[0326] The chromosome crossover unit is used to perform uniform chromosome crossover processing on the selected chromosomes.

[0327] Optionally, the chromosome crossover and mutation submodule includes:

[0328] A chromosome mutation number determination unit, used to determine the chromosome mutation number according to the following formula based on a preset mutation rate and the total number of chromosomes;

[0329] ;

[0330] in, represents the number of chromosome mutations, represents the total number of chromosomes, Indicates the preset mutation rate, Indicates that in the interval Generate random numbers in Indicates rounding down. Indicates selecting the maximum value between a and b;

[0331] A chromosome selection unit to be mutated is used to randomly select a corresponding number of chromosomes from the screened chromosomes as chromosomes to be mutated according to the number of chromosome mutations;

[0332] A mutant gene position determination unit is used to determine the number of mutant genes and the mutant gene positions that need to be mutated in each chromosome to be mutated according to the following formula;

[0333] ;

[0334] ;

[0335] in, represents the number of mutated genes, represents the total number of genes contained in each chromosome, represents the position of the variant gene, and the number of positions of the variant gene is the number of variant genes;

[0336] The mutation unit is used to perform numerical inversion on the gene at each mutation gene position in each chromosome to be mutated to obtain a mutated chromosome.

[0337] Optionally, the device may further include:

[0338] The task migration judgment module is used to judge whether the computing device can meet the device constraint conditions; if it can be met, the step of initializing multiple sets of execution device allocation information is entered; if it cannot be met, other tasks being executed by the computing device and having a lower service priority than the task to be scheduled are moved out of the computing device, and after completing the task removal, the step of initializing multiple sets of execution device allocation information is entered.

[0339] Optionally, the information acquisition module 801 further includes:

[0340] The computing device determination module is used to determine multiple computing devices from a specified area; wherein the specified area is a service area where a user terminal that sends a task to be scheduled is located, or a travel area determined according to a travel route of the user terminal.

[0341] Optionally, the device may further include:

[0342] A task sample data acquisition module is used to acquire task sample data corresponding to a variety of tasks; wherein the task sample data includes the user terminal connection ratio and communication duration of each service area corresponding to when multiple user terminals send tasks to each service area;

[0343] A task sample data classification module is used to determine the service area to which the task sample data belongs based on the user terminal connection ratio and communication duration;

[0344] A control device determination module, used to determine a control device among the computing devices in the service area according to the task sample data of each service area and the number of user terminals connected to each computing device in the service area, so that the number of user terminals connected to the control device is not less than a preset ratio of the total number of user terminals connected to the service area and the total communication duration of all tasks received by the control device is closest to the sum of the communication durations recorded in the task sample data of the service area;

[0345] The computing device determination module is used to, in the network topology structure formed by all computing devices in the service area, identify all computing devices starting from the control device and having a topological connection value with the control device less than a preset value as computing devices providing services in the service area.

[0346] Optionally, the device may further include a task triggering module, configured to:

[0347] When a new terminal task sent by a user terminal is received, a task scheduling operation is triggered, and the new terminal task is used as a task to be scheduled; or,

[0348] When a computing device failure is detected, a task scheduling operation is triggered, and the task being executed by the failed computing device is used as a task to be scheduled; or,

[0349] When it is detected that a task being executed by the computing device is to be migrated, a task scheduling operation is triggered, and the task to be migrated is used as a task to be scheduled.

[0350] Optionally, when a control device fails, a backup node corresponding to the control device or an upper-level control device corresponding to the control device schedules the task to be scheduled.

[0351] Please refer to Figure 9 , Figure 9 This is a structural block diagram of a control device provided in an embodiment of the present invention. The embodiment of the present invention provides a control device 10, including a processor 11 and a memory 12; wherein the memory 12 is used to store a computer program; and the processor 11 is used to execute the task scheduling method provided in the aforementioned embodiment when executing the computer program.

[0352] For the specific process of the above-mentioned task scheduling method, reference may be made to the corresponding contents provided in the above-mentioned embodiments, which will not be described in detail here.

[0353] Furthermore, the memory 12 as a carrier for storing resources may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.

[0354] In addition, the control device 10 also includes a power supply 13, a communication interface 14, an input / output interface 15 and a communication bus 16; wherein the power supply 13 is used to provide working voltage for each hardware device on the control device 10; the communication interface 14 can create a data transmission channel between the control device 10 and external devices, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present invention, and is not specifically limited here; the input / output interface 15 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0355] Please refer to Figure 1 , Figure 1 A structural block diagram of a task scheduling system provided by an embodiment of the present invention, the system includes:

[0356] A control device 10, configured to execute the task scheduling method as described above;

[0357] A plurality of computing devices 20 are used to process tasks issued by the control device.

[0358] Optionally, the computing device is an edge device.

[0359] Since the embodiments of the task scheduling system part correspond to the embodiments of the task scheduling method part, the embodiments of the task scheduling system part refer to the description of the embodiments of the task scheduling method part, which will not be repeated here.

[0360] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the task scheduling method described in the above embodiment is implemented.

[0361] Since the embodiments of the computer program product part correspond to the embodiments of the task scheduling method part, please refer to the description of the embodiments of the task scheduling method part for the embodiments of the computer program product part, and will not be repeated here.

[0362] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the task scheduling method described in the above embodiment is implemented.

[0363] Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the task scheduling method part, the embodiments of the storage medium part refer to the description of the embodiments of the task scheduling method part, which will not be repeated here.

[0364] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0365] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0366] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0367] The above is a detailed introduction to a task scheduling method, device, equipment, system, program product and medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A task scheduling method, characterized in that: Applied to a control device, the method comprises: When a task scheduling operation is triggered, device information of multiple computing devices and task information of the tasks to be scheduled are obtained; wherein the device information includes the remaining amount of hardware resources, the amount of operating cost, and the amount of processing time consumed, and the task information includes the hardware resource consumption information, the processing time limit information, and the task level information; Determine the service priority of the task to be scheduled according to the task information, and determine the fitness function and the device constraint condition according to the task information and the service priority level; wherein the fitness function is used to determine the total operating cost of all execution devices, the device constraint condition is used to constrain the remaining amount of hardware resources and the processing time consumption of each of the execution devices, the constraint value of the device constraint condition is positively correlated with the service priority level, and the execution device is a computing device that executes the task to be scheduled; Determine the optimal execution device allocation information by minimizing the fitness function value using the fitness function, the device constraint condition and the genetic algorithm; Determine the execution device according to the optimal execution device allocation information, and send the to-be-scheduled task to the execution device for processing; Determining the service priority level of the task to be scheduled according to the task information includes: Determine the service priority value corresponding to the task to be scheduled according to the task information; Determine a target threshold interval in which the service priority value is located in a plurality of continuous threshold intervals, and determine the service priority level corresponding to the target threshold interval as the service priority level of the task to be scheduled; wherein different threshold intervals are set with different service priority levels, and the value of the threshold interval is positively correlated with the service priority level; Determining the service priority value corresponding to the task to be scheduled according to the task information includes: The delay priority value is determined according to the processing time limit information according to the following formula: ; The resource consumption priority value is determined according to the hardware resource consumption information according to the following formula: ; The task level priority value is determined according to the task level information according to the following formula: ; The delay priority value, the resource consumption priority value and the task level priority value are weighted according to the following formula to obtain the service priority value: ; in, represents the delay priority value, represents a real-time task identification value in the processing time limit information, wherein the real-time task identification value is a first value or a second value, wherein the first value indicates that the task to be scheduled needs to be processed in real time, and the second value indicates that the task to be scheduled does not need to be processed in real time, represents the task deadline in the processing time limit information, represents the remaining time of the task in the processing time limit information, e represents a natural base number, represents the resource consumption priority value, represents a resource dependency value, and the resource dependency value is positively correlated with the hardware resource consumption recorded in the hardware resource consumption information, represents a task dependency identification value in the hardware resource consumption information, the task dependency identification value is a third value or a fourth value, the third value indicates that the task to be scheduled depends on the processing results of other tasks, and the fourth value indicates that the task to be scheduled does not depend on the processing results of other tasks, represents the priority value of the task level, represents the user level in the task level information, Indicates the task level in the task level information; represents the service priority value, , , Respectively represent the weight values ​​corresponding to the delay priority value, the resource consumption priority value, and the task level priority value; Determining device constraint conditions according to the task information and the service priority level includes: Determine the remaining amount constraint of computing resources according to the service priority level: ; in, node represents the execution device, Capcity_Compute(node) represents the remaining amount of computing resources of the execution device, Compute_threshold 1 Indicates the remaining computing resource threshold corresponding to the low service priority level. Compute_ threshold 2 Indicates the remaining computing resource threshold corresponding to the high service priority level. Compute_threshold 1 < Compute_threshold 2 , when the service priority level is lower than the preset level, it is a low service priority level, and when the service priority level is not lower than the preset level, it is a high service priority level; Determine the remaining memory resource constraint according to the service priority level: ; in, InMemory_Compute(node) Indicates the remaining amount of memory resources of the execution device, InMemory_ threshold 1 Indicates the remaining memory resource threshold corresponding to the low service priority level. InMemory_threshold 2 Indicates the remaining memory resource threshold corresponding to the high service priority level. InMemory_threshold 1 < InMemory_threshold 2 ; Determine the remaining bandwidth resource constraint condition according to the service priority level: ; in, BandWidth_Compute(node) represents the remaining bandwidth resource of the execution device, BandWidth_ threshold 1 Indicates the remaining bandwidth resource threshold corresponding to the low service priority level. BandWidth_threshold 2 Indicates the remaining bandwidth resource threshold corresponding to the high service priority level. BandWidth_threshold 1 < BandWidth_ threshold 2 ; Determine the processing time constraint condition according to the processing time limit information: ; in, represents the processing limit time in the processing time limit information, MessagePassingTime , ServiceComputingTime , ResponseTime , DelayTime Respectively represent the task transmission time, task calculation time, task response time and delay time in the processing time consumption; The computing resource remaining amount constraint condition, the memory resource remaining amount constraint condition, the bandwidth resource remaining amount constraint condition, and the processing time constraint condition are set as the device constraint conditions; Determining a fitness function according to the task information and the service priority level includes: Determine the fitness function according to the task information and the service priority: ; in, fitness represents the fitness function, n represents the total number of execution devices, Indicates i The energy cost of each execution device, It is expressed as: ; represents the energy consumption cost value required by the execution device to execute the task with low service priority level, represents the energy cost value required to maintain the execution device, represents the energy consumption cost value required by the execution device to execute the task with high service priority level, represents the first scaling factor; represents the fixed capital cost value, It is expressed as: ; represents the fixed capital cost value of the execution equipment, It is expressed as: ; in, represents the equipment fixed maintenance capital cost value of the execution equipment, Indicates the equipment capital cost value of the execution equipment; A system fixed maintenance capital cost value corresponding to the system composed of all the computing devices; represents the service capital cost value, It is expressed as: ; represents the service capital cost value required for the execution device to execute the task with the low service priority level, represents the service capital cost value required for the execution device to execute the task with high service priority level, represents the second scaling factor, represents the capital cost value corresponding to the system during the period of providing business services, It represents the energy consumption cost value corresponding to the system during the period of providing business services.

2. The task scheduling method according to claim 1, characterized in that: The hardware resource consumption information and the processing time limit information in the task information are determined by a model simulation method and / or by a historical data statistical analysis method.

3. The task scheduling method according to claim 1, characterized in that: The operating cost and processing time in the equipment information are determined by model simulation and / or by statistical analysis of historical data.

4. The task scheduling method according to claim 1, characterized in that: Determining the optimal execution device allocation information by minimizing the fitness function value using the fitness function, the device constraint condition and the genetic algorithm, including: Randomly initialize a first preset number of execution device allocation information, and convert the execution device allocation information into a chromosome; wherein the chromosome includes a gene corresponding to each of the computing devices, and the value of the gene is a first value or a second value, the first value indicates that the computing device is allocated as the execution device, and the second value indicates that the computing device is not allocated as the execution device; Remove the chromosomes that do not meet the device constraint conditions, calculate the fitness value for each remaining chromosome using the fitness function, and determine whether there is a fitness value less than a preset threshold; If so, determining the optimal execution device allocation information according to the chromosome corresponding to the fitness value less than the preset threshold; If not, performing individual selection processing on the remaining chromosomes to screen out a second preset number of chromosomes; wherein the second preset number is smaller than the first preset number; The screened chromosomes are subjected to chromosome crossover processing and chromosome variation processing to replenish the number of chromosomes from the second preset number to the first preset number, and after the processing, the chromosomes that do not meet the device constraint conditions are removed, the fitness value is calculated for each remaining chromosome using the fitness function, and it is determined whether there is a fitness value less than a preset threshold.

5. The task scheduling method according to claim 4, characterized in that: Perform individual selection processing on the remaining chromosomes, including: Initialize the iteration round to 1, and add the remaining chromosomes to the first set; Randomly selecting a third preset number of chromosomes from the first set as chromosomes to be compared; Move the chromosome to be compared with the lowest fitness value among the chromosomes to be compared from the first set to the second set; Determining whether the iteration round is equal to the second preset number; If yes, then based on the chromosomes in the second set, the step of performing chromosome crossover processing and chromosome variation processing on the selected chromosomes is performed; If not, the iteration round is increased by 1, and the process proceeds to the step of randomly selecting a third preset number of chromosomes from the first set as chromosomes to be compared.

6. The task scheduling method according to claim 4, characterized in that: Perform chromosome crossover processing on the selected chromosomes, including: The selected chromosomes are subjected to uniform chromosome crossover treatment.

7. The task scheduling method according to claim 4, characterized in that: The selected chromosomes are processed for chromosome variation, including: The number of chromosome mutations is determined according to the following formula based on the preset mutation rate and the total number of chromosomes; ; in, represents the number of chromosome mutations, represents the total number of chromosomes, Indicates the preset mutation rate, Indicates that in the interval Generate random numbers in Indicates rounding down. Indicates selecting the maximum value between a and b; According to the number of chromosome mutations, a corresponding number of chromosomes are randomly selected from the screened chromosomes as chromosomes to be mutated; For each of the chromosomes to be mutated, the number of mutated genes and the positions of the mutated genes in the chromosome to be mutated are determined according to the following formula; ; ; in, represents the number of mutated genes, represents the total number of genes contained in each chromosome, represents the position of the variant gene, and the number of the positions of the variant gene is the number of the variant genes; The gene at each mutated gene position in each of the chromosomes to be mutated is numerically flipped to obtain a mutated chromosome.

8. The task scheduling method according to claim 1, characterized in that: Before initializing multiple sets of execution device allocation information, it also includes: Determining whether the computing device can satisfy the device constraint; If satisfied, then enter the step of initializing multiple sets of execution device allocation information; If it cannot be satisfied, other tasks being executed by the computing device and having a lower service priority than the task to be scheduled are removed from the computing device, and after the tasks are removed, the step of initializing multiple sets of execution device allocation information is entered.

9. The task scheduling method according to claim 1, characterized in that: Before obtaining device information of multiple computing devices and task information of tasks to be scheduled, the following is also included: The multiple computing devices are determined from a designated area; wherein the designated area is a service area where a user terminal that sends the task to be scheduled is located, or a travel area determined according to a travel route of the user terminal.

10. The task scheduling method according to claim 9, characterized in that: The process of setting the control device and the plurality of computing devices in the service area includes: Acquire task sample data corresponding to a plurality of tasks; wherein the task sample data includes the user terminal connection ratio and communication duration of each service area corresponding to when a plurality of user terminals send the tasks to each service area; Determine the service area to which the task sample data belongs according to the user terminal connection ratio and the communication duration; According to the task sample data of each service area and the number of user terminals connected to each computing device in the service area, the control device is determined in the computing devices in the service area, so that the number of user terminals connected to the control device is not less than a preset proportion of the total number of user terminals connected to the service area and the total communication duration of all tasks received by the control device is closest to the sum of the communication durations recorded in the task sample data of the service area; In the network topology formed by all computing devices in the service area, all computing devices starting from the control device and having a topological connection value with the control device less than a preset value are regarded as computing devices providing services in the service area.

11. The task scheduling method according to claim 1, characterized in that: Trigger task scheduling operations, including: When a new terminal task sent by a user terminal is received, the task scheduling operation is triggered, and the new terminal task is used as the task to be scheduled; or, When a failure of the computing device is detected, the task scheduling operation is triggered, and the task being executed by the failed computing device is used as the task to be scheduled; or, When it is detected that a task being executed by the computing device is to be migrated, the task scheduling operation is triggered, and the task to be migrated is used as the task to be scheduled.

12. The task scheduling method according to claim 1, characterized in that: When the control device fails, the standby node corresponding to the control device or the upper-level control device corresponding to the control device schedules the task to be scheduled.

13. A task scheduling device, characterized in that: Applied to a control device, the device comprises: An information acquisition module, used to acquire device information of multiple computing devices and task information of the tasks to be scheduled when a task scheduling operation is triggered; wherein the device information includes the remaining amount of hardware resources, the amount of operating cost, and the amount of processing time consumed, and the task information includes hardware resource consumption information, processing time limit information, and task level information; A function and condition determination module, used to determine the service priority of the task to be scheduled according to the task information, and determine the fitness function and the device constraint conditions according to the task information and the service priority level; wherein the fitness function is used to determine the total operating cost of all execution devices, the device constraint conditions are used to constrain the remaining amount of hardware resources and the processing time consumption of each of the execution devices, the constraint value of the device constraint conditions is positively correlated with the service priority level, and the execution device is a computing device that executes the task to be scheduled; A genetic algorithm iteration module, used to determine the best execution device allocation information by minimizing the fitness function value using the fitness function, the device constraint condition and the genetic algorithm; An appointment scheduling module is used to determine the execution device according to the best execution device allocation information, and send the task to be scheduled to the execution device for processing; The function and condition determination module includes: A service priority value determination submodule, used to determine the service priority value corresponding to the task to be scheduled according to the task information; A service priority level determination submodule, used to determine a target threshold level interval in which the service priority value is located in a plurality of continuous threshold level intervals, and determine the service priority level corresponding to the target threshold level interval as the service priority level of the task to be scheduled; wherein different threshold level intervals are set with different service priority levels, and the value of the threshold level interval is positively correlated with the service priority level; The service priority value determination submodule is used to: The delay priority value is determined according to the processing time limit information according to the following formula: ; The resource consumption priority value is determined according to the hardware resource consumption information according to the following formula: ; The task level priority value is determined according to the task level information according to the following formula: ; The delay priority value, the resource consumption priority value and the task level priority value are weighted according to the following formula to obtain the service priority value: ; in, represents the delay priority value, represents a real-time task identification value in the processing time limit information, wherein the real-time task identification value is a first value or a second value, wherein the first value indicates that the task to be scheduled needs to be processed in real time, and the second value indicates that the task to be scheduled does not need to be processed in real time, represents the task deadline in the processing time limit information, represents the remaining time of the task in the processing time limit information, e represents a natural base number, represents the resource consumption priority value, represents a resource dependency value, and the resource dependency value is positively correlated with the hardware resource consumption recorded in the hardware resource consumption information, represents a task dependency identification value in the hardware resource consumption information, the task dependency identification value is a third value or a fourth value, the third value indicates that the task to be scheduled depends on the processing results of other tasks, and the fourth value indicates that the task to be scheduled does not depend on the processing results of other tasks, represents the priority value of the task level, represents the user level in the task level information, Indicates the task level in the task level information; represents the service priority value, , , Respectively represent the weight values ​​corresponding to the delay priority value, the resource consumption priority value, and the task level priority value; The function and condition determination module includes a device constraint determination submodule, and the device constraint determination submodule is used to: Determine the remaining amount constraint of computing resources according to the service priority level: ; in, node represents the execution device, Capcity_Compute(node) represents the remaining amount of computing resources of the execution device, Compute_threshold 1 Indicates the remaining computing resource threshold corresponding to the low service priority level. Compute_ threshold 2 Indicates the remaining computing resource threshold corresponding to the high service priority level. Compute_threshold 1 < Compute_threshold 2 , when the service priority level is lower than the preset level, it is a low service priority level, and when the service priority level is not lower than the preset level, it is a high service priority level; Determine the remaining memory resource constraint according to the service priority level: ; in, InMemory_Compute(node) Indicates the remaining amount of memory resources of the execution device, InMemory_ threshold 1 Indicates the remaining memory resource threshold corresponding to the low service priority level. InMemory_threshold 2 Indicates the remaining memory resource threshold corresponding to the high service priority level. InMemory_threshold 1 < InMemory_threshold 2 ; Determine the remaining bandwidth resource constraint condition according to the service priority level: ; in, BandWidth_Compute(node) represents the remaining bandwidth resource of the execution device, BandWidth_ threshold 1 Indicates the remaining bandwidth resource threshold corresponding to the low service priority level. BandWidth_threshold 2 Indicates the remaining bandwidth resource threshold corresponding to the high service priority level. BandWidth_threshold 1 < BandWidth_ threshold 2 ; Determine the processing time constraint condition according to the processing time limit information: ; in, represents the processing limit time in the processing time limit information, MessagePassingTime , ServiceComputingTime , ResponseTime , DelayTime Respectively represent the task transmission time, task calculation time, task response time and delay time in the processing time consumption; The computing resource remaining amount constraint condition, the memory resource remaining amount constraint condition, the bandwidth resource remaining amount constraint condition, and the processing time constraint condition are set as the device constraint conditions; The function and condition determination module includes a fitness function determination submodule, and the fitness function determination submodule is used to: Determine the fitness function according to the task information and the service priority: ; in, fitness represents the fitness function, n represents the total number of execution devices, Indicates i The energy cost of each execution device, It is expressed as: ; represents the energy consumption cost value required by the execution device to execute the task with low service priority level, represents the energy cost value required to maintain the execution device, represents the energy consumption cost value required by the execution device to execute the task with high service priority level, represents the first scaling factor; represents the fixed capital cost value, It is expressed as: ; represents the fixed capital cost value of the execution equipment, It is expressed as: ; in, represents the equipment fixed maintenance capital cost value of the execution equipment, Indicates the equipment capital cost value of the execution equipment; A system fixed maintenance capital cost value corresponding to the system composed of all the computing devices; represents the service capital cost value, It is expressed as: ; represents the service capital cost value required for the execution device to execute the task with the low service priority level, represents the service capital cost value required for the execution device to execute the task with high service priority level, represents the second scaling factor, represents the capital cost value corresponding to the system during the period of providing business services, It represents the energy consumption cost value corresponding to the system during the period of providing business services.

14. A control device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the task scheduling method according to any one of claims 1 to 13 when executing the computer program.

15. A task scheduling system, characterized in that: include: A control device, configured to execute the task scheduling method according to any one of claims 1 to 13; A plurality of computing devices are used to process the tasks issued by the control device.

16. The task scheduling system according to claim 15, characterized in that: The computing device is an edge device.

17. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the task scheduling method according to any one of claims 1 to 13 are implemented.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by the processor, the task scheduling method according to any one of claims 1 to 13 is implemented.