Resource coordination scheduling method and apparatus, device, medium, and computer program product
By acquiring decision tuples from historical tasks, calculating resource constraints, user satisfaction constraints, and load constraints, and training a resource collaborative scheduling model, the problems of untrusted nodes and unbalanced load in existing technologies are solved, thus achieving the effectiveness and reliability of cloud-edge-device task scheduling.
Patent Information
- Application Number
- CN202210699667.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-20
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2042-06-20
AI Technical Summary
Existing blockchain-based task scheduling systems fail to guarantee the honesty and trustworthiness of nodes and lack consideration for cloud-edge-device task scheduling and network load balancing.
By obtaining decision tuples from historical tasks, resource constraints, user satisfaction constraints, and load constraints are calculated. A resource collaborative scheduling model is trained to generate a resource scheduling strategy, taking into account cloud-edge-device task scheduling and network load balancing.
It achieves honest and trustworthy service of nodes, ensures the effectiveness of task scheduling and network load balancing, and improves the reliability and efficiency of task execution.
Smart Images

Figure CN115334079B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blockchain, and particularly relates to a resource collaborative scheduling method and device, equipment, medium and computer program product. BACKGROUND
[0002] The existing task scheduling system based on blockchain needs to monitor the node load in real time, and when task migration needs to be performed, the external load is obtained through an external load detection system, and a migration object is determined, a migration route is determined through a node routing system, and the migration of the entire task is completed through a node task migration system to realize task scheduling, but the cloud-edge-end task scheduling is not considered, the initial task scheduling is not researched, the load capacity of the node is not considered, and the load balancing of the network is not researched, and the honesty and reliable service of the node cannot be guaranteed. SUMMARY
[0003] The present application provides a resource collaborative scheduling method, device, equipment, storage medium and computer program product to solve the technical problem that the existing task scheduling system based on blockchain cannot guarantee the honesty and reliable service of the node.
[0004] The present application provides a resource collaborative scheduling method, comprising:
[0005] obtaining a decision tuple of a historical task;
[0006] executing the historical task, and calculating resource constraints, user satisfaction constraints and load constraints according to resource data in the decision tuple;
[0007] training a resource collaborative scheduling model according to the resource constraints, the user satisfaction constraints and the load constraints;
[0008] inputting a resource task to be scheduled into the trained resource collaborative scheduling model to obtain a resource scheduling strategy.
[0009] According to the resource collaborative scheduling method provided by the present application, the step of obtaining the decision tuple of the historical task comprises:
[0010] obtaining a serial number of a resource node for executing the historical task, an execution position of the historical task, a resource amount provided by the resource node, an edge communication node for allocating communication resources for the historical task, and a communication bandwidth allocated by the edge communication node;
[0011] adding the serial number of the resource node, the execution position, the resource amount, the edge communication node and the communication bandwidth into a target tuple to obtain the decision tuple of the historical task.
[0012] According to the resource cooperative scheduling method provided by the application, the step of calculating the user satisfaction constraint according to the resource data in the decision tuple when the historical task is executed comprises:
[0013] The execution time of the historical task, the terminal energy consumption of the historical task and the resource cost of the terminal of initiating the historical task are calculated according to the serial number of the resource node, the execution location, the resource amount, the edge communication node and the communication bandwidth of the historical task.
[0014] The actual resource data of executing the historical task is obtained, and the user satisfaction constraint is calculated according to the execution time, the terminal energy consumption, the resource cost and the actual resource data.
[0015] According to the resource cooperative scheduling method provided by the application, the step of calculating the resource constraint according to the resource data in the decision tuple comprises:
[0016] A preset bandwidth threshold, a preset cost threshold and a preset memory requirement constraint are obtained.
[0017] The resource constraint is calculated according to the first comparison result of the communication bandwidth and the preset bandwidth threshold, the second comparison result of the resource cost and the preset cost threshold and the preset memory requirement constraint.
[0018] According to the resource cooperative scheduling method provided by the application, the step of calculating the load constraint according to the resource data in the decision tuple comprises:
[0019] The current used resource and resource weight of the resource node and the container set of the historical task running by the resource node are obtained.
[0020] The first weighted load rate and the second weighted load rate are calculated according to the resource weight, and the single-node load rate is obtained by adding the first weighted load rate and the second weighted load rate.
[0021] The resource node load rate is calculated according to the communication bandwidth.
[0022] The load constraint is calculated according to the single-node load rate and the resource node load rate.
[0023] According to the resource cooperative scheduling method provided by the application, the step of inputting the to-be-scheduled resource task into the trained resource cooperative scheduling model to obtain the resource scheduling strategy comprises:
[0024] The task execution node of the to-be-scheduled resource task and the to-be-migrated container are determined according to the resource constraint, the user satisfaction constraint and the load constraint.
[0025] According to the task execution node and the container to be migrated, a resource scheduling strategy corresponding to the resource task to be scheduled is determined.
[0026] The application further provides a resource collaborative scheduling device, comprising:
[0027] A decision tuple acquisition module is configured to acquire a decision tuple of a historical task.
[0028] A constraint calculation module is configured to execute the historical task, and calculate a resource constraint, a user satisfaction constraint and a load constraint according to resource data in the decision tuple.
[0029] A model training module is configured to train a resource collaborative scheduling model according to the resource constraint, the user satisfaction constraint and the load constraint.
[0030] A resource scheduling strategy acquisition module is configured to input a resource task to be scheduled into the trained resource collaborative scheduling model to obtain a resource scheduling strategy.
[0031] The application further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the resource collaborative scheduling method according to any of the above when executing the program.
[0032] The application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the resource collaborative scheduling method according to any of the above.
[0033] The application further provides a computer program product comprising a computer program, wherein the computer program is executable on a processor to implement the resource collaborative scheduling method according to any of the above.
[0034] The resource collaborative scheduling method, device, equipment, storage medium and computer program product provided by the application acquire a decision tuple of a historical task, and calculate a resource constraint, a user satisfaction constraint and a load constraint according to resource data in the decision tuple when executing the historical task, and then train a resource collaborative scheduling model that can generate a resource scheduling strategy when a task is executed according to the resource constraint, the user satisfaction constraint and the load constraint, so as to finally obtain a resource scheduling strategy of a resource task to be scheduled through the trained resource collaborative scheduling model. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0036] Figure 1 is one of the flowcharts of the resource cooperative scheduling method provided by the present application;
[0037] Figure 2 is the second flowchart of the resource cooperative scheduling method provided by the present application;
[0038] Figure 3 is the structural schematic diagram of the resource cooperative scheduling device provided by the present application;
[0039] Figure 4 is the structural schematic diagram of the electronic device provided by the present application. DETAILED DESCRIPTION
[0040] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely below in combination with the drawings in the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort belong to the protection scope of the present application.
[0041] The resource cooperative scheduling method of the present application will be described below in combination with Figures 1-2
[0042] Please refer to Figure 1 The present application provides a resource cooperative scheduling method, which comprises:
[0043] Step S100, obtaining a decision tuple of a historical task;
[0044] Specifically, the resource cooperative scheduling method disclosed in the present embodiment is applied to a distributed resource cooperative scheduling architecture based on a block chain. The distributed resource cooperative scheduling architecture based on the block chain is divided into three layers: an Internet of Things resource layer, a shared resource scheduling decision layer and an application layer. Internet of Things terminals are randomly distributed. Some terminals have computing tasks to be executed, and some terminals have rich resources to share resources externally. The computing task of terminal i is defined as a triple Ti(Fi, Di, Ri). Fi describes the total CPU cycle number required to execute task Ti (i.e. the historical task in the present embodiment), Di represents the data amount to be transmitted to other resource nodes when the task is offloaded, and Ri is the delay, energy consumption and cost expectation when the task is executed. i = (rti , re i , rc i ), wherein rt i represents a task execution delay, re i represents a task execution energy consumption, and rc i represents a task execution cost expectation. It is defined that tasks of the same type have the same Ri, and the offloading destinations of terminal tasks include edge servers and cloud servers. The edge servers are deployed near base stations or routers at the network edge and can provide services to terminals at close range. The cloud servers are geographically farther away than the edge servers. It is defined that there are K edge servers and J cloud servers. The K edge servers are configured at K edge communication nodes, and the communication nodes have channel bandwidths Bi. Users offload tasks to edge servers through orthogonal frequency division multiplexing channels to ensure that there is no interference between communications. Data transmission from edge communication nodes to cloud resources is implemented through a core backbone network.
[0045] The Internet of Things terminal, edge server, and cloud server are resource nodes, each of which has d types of resources, including CPU capability and memory size. It is defined that the service capability of a resource node is C i = (s i , m i ).
[0046] The scheduling decision five-tuple of a task Ti is wherein num i represents the serial number of a resource node that executes the task Ti, and the value range is affected by a i . represents the amount of different types of resources allocated to the task Ti by the corresponding resource node with the serial number num i , and d = 2 in this embodiment. num i represents an edge communication node that allocates communication resources for the task Ti, and B i represents the communication bandwidth allocated to the terminal by the edge communication node. a i = {0, 1, 2} represents the optional location of the execution of the task Ti, a i = 0 indicates that the Internet of Things terminal executes the task in the local range, that is, offloads the task to other Internet of Things terminal resource nodes in the local range or in a D2D (Device-to-Device Communication) communication mode, in which case num i ∈ N; a i = 1 indicates that the task is offloaded to an edge server, in which case num i ∈ K; a i = 2 indicates that the task Ti is offloaded to a cloud server, in which case num i ∈ J. The above scheduling decision five-tuple is the decision tuple in this embodiment.
[0047] Step S200, performing the historical task, calculating the resource constraints, user satisfaction constraints and load constraints according to the resource data in the decision tuple;
[0048] Specifically, a i = 0, num i = j, the task is executed on terminal j. At this time, the task initiator is the D2D sending terminal, and the task executor is the D2D receiving terminal. It is assumed that the D2D communication limit distance of the terminal is D2D multiplexes the downlink of the cell, and communicates through the orthogonal signal allocated by the base station. The container resource allocated to j is C j = (s j , m j ), then the Ti calculation delay is defined as
[0049] Where D i ≤ m i is the memory requirement constraint. If j is the terminal i that initiates Ti, there is no transmission delay cost when Ti is executed, so the local task execution time P i d is the computing power of terminal i, and the i energy consumption is At this time, the cost of renting resources to execute the task Ti is pay i = 0. If j is other terminal resource node, the task execution is completed in the local range in D2D mode. The geographical distance between terminal i and j is The path loss is inversely proportional to the α (α > 2) power of the distance, the link will experience independent and identically distributed sharp fading, and the fading coefficient obeys the exponential distribution with mean E[h] = 1, then the power of the receiving terminal j is P j = P i hdis ij -α , where P i is the sending power of terminal i. The signal-to-noise ratio of the interference signal received by terminal j from the cell base station can be calculated as where I BD is the interference of the cell base station to the receiving terminal, and σ 2 is the link additive white noise. Then the transmission rate between i and j in D2D mode is where is the link bandwidth obtained by D2D allocation. The Ti data transmission time can be obtained as
[0050] The calculation time cost of completing task execution in D2D mode is where is the calculation delay, is the data transmission delay. The total execution delay of task Ti is The energy consumption of i is If the unit resource price of terminal j is p j , then the cost of terminal i renting resources is pay i = p j s j .
[0051] In this embodiment, the resource constraint is calculated according to the resource data in the decision tuple. If the edge server j executes the task set W j , then the resource constraint is defined as and
[0052] In step S300, the resource collaborative scheduling model is trained according to the resource constraint, the user satisfaction constraint and the load constraint.
[0053] Specifically, in the user satisfaction model, it is considered that the resource node providing the service satisfying the user needs to meet the task execution delay constraint, as few resource rental cost as possible and as little terminal energy consumption as possible. Based on the above, it is considered that the satisfaction degree is 0 when the task cannot be completed, and the user satisfaction degree is calculated based on the following model when the task is completed. The smaller the values of delay, cost and energy consumption, the higher the user satisfaction degree. Therefore, the single-factor satisfaction quantification function is designed as follows:
[0054]
[0055] wherein x i is the actual execution of task Ti, r i (r i ∈ R i ) is the expected completion constraint, r i / x i is in the range of [0, +∞]. When x i < r i , the user is satisfied with the execution of the task, at this time r i / x i > 1, corresponding to the value of S(x i ) in the range of (0.5, 1]; when t i = R i , the task is completed at the constraint point, corresponding to S(x i ) = 0.5; when t i > R i , the execution of the task exceeds the expected constraint, and the user satisfaction degree decreases, r i / x i < 1, corresponding to the value of S(x i ) in the range of [0, 0.5). r i / x i The smaller the value of , the lower the user satisfaction. The user satisfaction with the task execution time, energy consumption, and cost is obtained as S(t). i =arctan(rt) i / t i ) / π / 2,S(t i =arctan(re i / e i ) / π / 2,S(t i =arctan(rc) i / pay i ) / π / 2, overall user satisfaction is defined as ρ1, ρ2, and ρ3 are user satisfaction tendency indices, with values ranging from [0,1], satisfying ρ1+ρ2+ρ3=1.
[0056] In this embodiment, the overall user satisfaction with task scheduling and execution satisfies the following constraint S(t). i ,e i ,pay i ≥0.5.
[0057] A resource collaborative scheduling model is trained by incorporating resource constraints, user satisfaction constraints, and load constraints.
[0058] Step S400: Input the resource task to be scheduled into the trained resource collaborative scheduling model to obtain the resource scheduling strategy.
[0059] The resource task to be scheduled is input into the trained resource collaborative scheduling model to obtain the resource scheduling strategy corresponding to the resource task to be scheduled. The resource scheduling strategy includes the task execution node and the container to be migrated.
[0060] This embodiment obtains decision tuples containing resource data from historical tasks. When executing historical tasks, resource constraints, user satisfaction constraints, and load constraints are calculated based on the resource data in the decision tuples. Then, based on the resource constraints, user satisfaction constraints, and load constraints, a resource collaborative scheduling model is trained that can generate resource scheduling strategies during task execution. Finally, the resource scheduling strategy for the resource task to be scheduled is obtained through the trained resource collaborative scheduling model. This invention considers cloud-edge-device task scheduling, takes into account the load capacity of nodes, studies the load balancing of the network, and ensures the honest and reliable service of resource nodes.
[0061] In one embodiment, the resource collaborative scheduling method provided in this application may further include:
[0062] Step S110: Obtain the sequence number of the resource node executing the historical task, the execution location of the historical task, the amount of resources provided by the resource node, the edge communication node that allocates communication resources to the historical task, and the communication bandwidth allocated by the edge communication node.
[0063] Step S120: Add the sequence number of the resource node, the execution location, the resource quantity, the edge communication node, and the communication bandwidth to the target tuple to obtain the decision tuple of the historical task.
[0064] Specifically, the resource nodes in this embodiment include IoT terminals, edge servers, and cloud servers, and the scheduling decision quintuple for historical task Ti is defined as follows: Where, num i The index of the resource node representing the execution task Ti (i.e., the index of the resource node representing the execution history task in this embodiment) has a value range subject to a. i The impact of the value. The representative serial number is num i The corresponding resource node is the amount of different types of resources allocated to task Ti (i.e., the amount of resources provided by the resource node in this embodiment), where d = 2 in this embodiment. i B represents the edge communication node that allocates communication resources for historical task Ti. i This represents the communication bandwidth allocated by the edge communication node to the terminal. i ={0,1,2} represents the optional execution location of task Ti (i.e., the execution location of historical tasks in this embodiment, including local execution, edge server execution, and cloud server execution), a i =0 indicates that the IoT terminal executes the task locally, that is, offloads the task to other IoT terminal resource nodes locally or via D2D (Device-to-Device Communication). In this case, num i ∈N; a i =1 indicates that the task is unloaded to the edge server, at which point num i ∈K; a i =2 indicates that task Ti is unloaded to the cloud server, at which point num i ∈J. The sequence number, execution location, resource quantity, edge communication node, and communication bandwidth of the above resource nodes constitute the decision tuple of the historical task.
[0065] This embodiment fully considers cloud-edge-device task scheduling by defining decision tuples for tasks, takes into account the load capacity of nodes, studies the load balancing of the network, and ensures the honest and reliable service of resource nodes.
[0066] In one embodiment, the resource collaborative scheduling method provided in this application may further include:
[0067] Step S210: Execute the historical task. Calculate the execution time of the historical task, the terminal energy consumption of the terminal executing the historical task, and the resource cost of the terminal initiating the historical task based on the sequence number of the resource node, the execution location, the resource quantity, the edge communication node, and the communication bandwidth in the decision tuple.
[0068] Step S220: Obtain the actual resource data for executing the historical task, and calculate the user satisfaction constraint based on the execution time, terminal energy consumption, resource cost, and actual resource data.
[0069] Specifically, the user satisfaction model considers that resource nodes providing satisfactory service to users must meet constraints on task execution latency, minimize resource rental costs, and minimize terminal energy consumption. Based on these considerations, satisfaction is considered zero when a task cannot be completed, and user satisfaction is calculated based on the following model when the task is completed. The lower the values of latency, cost, and energy consumption, the higher the user satisfaction. Therefore, the single-factor satisfaction quantification function is designed as follows:
[0070]
[0071] Where, x i For the actual execution status of task Ti (i.e., the actual resource data in this embodiment), r i (r i ∈R i ) represents the expected completion constraint, r i / x i The value of x is in the range [0, +∞]. i <r i When the user is satisfied with the execution of the task, r i / x i >1, corresponding to S(x) i The value of t is in the range (0.5, 1); when t i =R i At that time, the task is completed exactly at the constraint point, corresponding to S(x) i ) = 0.5; when t i >R i When the task execution exceeds expected constraints, user satisfaction decreases. i / x i <1, corresponding to S(x) i The value of r is in the range [0, 0.5). i / x iThe smaller the value is, the lower the user satisfaction is. According to the execution time, terminal energy consumption and resource cost, the user satisfaction of the time, energy consumption and cost of executing the task Ti is calculated as S(t i ) = arctan(rt i / t i ) / π / 2, S(t i ) = arctan(re i / e i ) / π / 2, S(t i ) = arctan(rc i / pay i ) / π / 2, and the overall user satisfaction is defined as ρ1, ρ2 and ρ3 are user satisfaction inclination indexes, and the value range is [0, 1], and ρ1 + ρ2 + ρ3 = 1.
[0072] In the task scheduling in the embodiment, the overall user satisfaction of task execution satisfies the following constraint S(t i ,e i ,pay i ) ≥ 0.5.
[0073] The embodiment calculates the user satisfaction constraint through the execution time, terminal energy consumption and resource cost, fully considers the cloud edge task scheduling, considers the load capacity of the node, studies the load balancing of the network, and guarantees the honesty and trusted service of the resource node.
[0074] In one embodiment, the resource cooperative scheduling method provided by the embodiment of the application can further include the following steps.
[0075] In step S230, a preset bandwidth threshold, a preset cost threshold and a preset memory requirement constraint are obtained.
[0076] In step S240, according to the first comparison result of the communication bandwidth and the preset bandwidth threshold, the second comparison result of the resource cost and the preset cost threshold and the preset memory requirement constraint, the resource constraint is calculated.
[0077] Specifically, a i = 0, num i = j, the task Ti is unloaded to the edge server j for execution, and the Ti calculation delay is The resource amount allocated to j for executing the task Ti. The data rate of the terminal i to the edge server j in the edge wireless communication network is The nodes communicate by OFDM (Orthogonal Frequency Division Multiplexing) mode, and the nodes do not affect each other, but the node communication is affected by the node pair in the D2D mode. Therefore where I DB is the influence of D2D communication on the base station. P j =P i hdis ij -α is the receiving power of the edge server, is the distance from the edge server j to the terminal i, is the communication bandwidth allocated to the task Ti. If the maximum access range of the base station is the data transmission delay of Ti is the overall execution delay of the task Ti is the energy consumption of the terminal i is the resource unit price of j is p j the cost of terminal i to rent resources is if the edge server j executes the task set W j the resource constraint is defined as and
[0078] The embodiment calculates the resource constraint through the resource data in the decision tuple, considers the cloud-edge-end task scheduling, and ensures the honesty and trusted service of the resource node.
[0079] Please refer to Figure 2 In one embodiment, the resource cooperative scheduling method provided by the embodiment of the application can further include:
[0080] Step S201, obtaining the current used resource and resource weight of the resource node, and a container set of the historical tasks run by the resource node;
[0081] Step S202, calculating a first weighted load rate and a second weighted load rate according to the resource weight, and adding the first weighted load rate and the second weighted load rate to obtain a single-node load rate;
[0082] Step S203, calculating a resource node load rate according to the communication bandwidth;
[0083] Step S204, calculating a load constraint according to the single-node load rate and the resource node load rate.
[0084] The resource of the cloud, edge and terminal resource node i is C i =(s i ,m iAfter the resource scheduling is completed, the load rates of the computing resources and the memory resources of the single resource node are wherein, The current used resources of the node (i.e., the current used resources in the embodiment) are EC i The container set of the resource node i running the task is defined as resource The resource weight in the node i is The weighted load rates of the computing resources and the memory resources in the node i are (i.e., the first weighted load rate in the embodiment), (i.e., the second weighted load rate in the embodiment), the resource load rate u i (i.e., the single node load rate in the embodiment) is The overall computing resource node set is RS = H∪K∪J, and the overall load rate variance of the cloud-edge-end resource nodes is defined as If the task set forwarded to the edge server i through the edge communication node i is W i The task set forwarded to the cloud server is The load rate of i (i.e., the resource node load rate in the embodiment) is wherein, and respectively represent the bandwidths of the edge server and the cloud server performing the task allocation. The load constraint is defined as
[0085] In the embodiment, the resource data in the decision tuple is used to calculate the load constraint, the load capacity of the node is considered, the load balancing of the network is researched, and the honest and reliable service of the resource node is ensured.
[0086] In one embodiment, the resource cooperative scheduling method provided by the embodiment of the application can further include the following steps.
[0087] In step S410, the task execution node of the to-be-scheduled resource task and the to-be-migrated container are determined according to the resource constraint, the user satisfaction constraint and the load constraint.
[0088] In step S420, the resource scheduling strategy corresponding to the to-be-scheduled resource task is determined according to the task execution node and the to-be-migrated container.
[0089] Specifically, according to the edge communication node load rate, the load rate variance among the K edge communication nodes is described as The decision variable The corresponding resource scheduling scheme of the service task Ti is determined, and the global reward is defined as the reciprocal of the network load rate variance value (i.e., the load rate variance described above), and the smaller the load rate variance value is, the greater the global reward is, which promotes network load balancing, and the goal of the Markov decision model is to find a strategy π θ (s,a), assuming that the Markov decision process starts from the initial state S0eS, and the decision is made according to the strategy π θ (s,a), a development trajectory is obtained, the expected reward is obtained by considering the discount factor λ, and the state-action value function is The optimal strategy is By training the approximate optimal function model , an approximate optimal strategy can be obtained.
[0090] This embodiment considers cloud edge task scheduling, considers the load capacity of nodes, studies the network load balancing, and guarantees the honesty and credibility of resource nodes.
[0091] The resource collaborative scheduling device provided by the present application is described below, and the resource collaborative scheduling device described below can be correspondingly referred to the resource collaborative scheduling method described above.
[0092] Please refer to Figure 3 The present application also provides a resource collaborative scheduling device, comprising:
[0093] A decision tuple acquisition module 301 is configured to acquire a decision tuple of a historical task.
[0094] A constraint calculation module 302 is configured to execute the historical task, and calculate resource constraints, user satisfaction constraints and load constraints according to resource data in the decision tuple.
[0095] A model training module 303 is configured to train a resource collaborative scheduling model according to the resource constraints, the user satisfaction constraints and the load constraints.
[0096] A resource scheduling strategy acquisition module 304 is configured to input a resource task to be scheduled into the trained resource collaborative scheduling model, and obtain a resource scheduling strategy.
[0097] The decision tuple acquisition module comprises:
[0098] A resource data acquisition unit is configured to acquire a serial number of a resource node executing the historical task, an execution position of the historical task, a resource amount provided by the resource node, an edge communication node allocating communication resources for the historical task, and a communication bandwidth allocated by the edge communication node.
[0099] A decision tuple obtaining unit is configured to add the serial number of the resource node, the execution location, the resource amount, the edge communication node and the communication bandwidth into a target tuple to obtain a decision tuple of the historical task.
[0100] The constraint calculation module comprises:
[0101] A first calculation unit is configured to calculate an execution time of the historical task, a terminal energy consumption of executing the historical task and a resource cost of a terminal initiating the historical task according to the serial number of the resource node, the execution location, the resource amount, the edge communication node and the communication bandwidth in the decision tuple when the historical task is executed.
[0102] A second calculation unit is configured to obtain actual resource data of executing the historical task and calculate a user satisfaction constraint according to the execution time, the terminal energy consumption, the resource cost and the actual resource data.
[0103] The constraint calculation module further comprises:
[0104] A first obtaining unit is configured to obtain a preset bandwidth threshold, a preset cost threshold and a preset memory requirement constraint.
[0105] A third calculation unit is configured to calculate a resource constraint according to a first comparison result of the communication bandwidth and the preset bandwidth threshold, a second comparison result of the resource cost and the preset cost threshold and the preset memory requirement constraint.
[0106] The constraint calculation module further comprises:
[0107] A second obtaining unit is configured to obtain a current used resource of the resource node and a resource weight and a container set of the resource node running the historical task.
[0108] A load rate calculation unit is configured to calculate a first weighted load rate and a second weighted load rate according to the resource weight and add the first weighted load rate and the second weighted load rate to obtain a single-node load rate.
[0109] A resource node load rate calculation unit is configured to calculate a resource node load rate according to the communication bandwidth.
[0110] A load constraint calculation unit is configured to calculate a load constraint according to the single-node load rate and the resource node load rate.
[0111] The resource scheduling strategy obtaining module comprises:
[0112] The task execution node determination unit is used to determine the task execution node and the container to be migrated for the resource task to be scheduled based on the resource constraints, the user satisfaction constraints, and the load constraints.
[0113] The resource scheduling strategy determination unit is used to determine the resource scheduling strategy corresponding to the resource task to be scheduled based on the task execution node and the container to be migrated.
[0114] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute a resource collaborative scheduling method, which includes: obtaining decision tuples of historical tasks; executing the historical tasks, calculating resource constraints, user satisfaction constraints, and load constraints based on resource data in the decision tuples; training a resource collaborative scheduling model based on the resource constraints, the user satisfaction constraints, and the load constraints; and inputting the resource task to be scheduled into the trained resource collaborative scheduling model to obtain a resource scheduling strategy.
[0115] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0116] In another aspect, the present application also provides a computer program product comprising a computer program, which can be stored on a non-transitory computer readable storage medium, and the computer program is executable by a processor to enable a computer to perform the resource coordination scheduling method provided by the above method, which comprises: obtaining decision tuples of historical tasks; performing the historical tasks, and calculating resource constraints, user satisfaction constraints and load constraints according to resource data in the decision tuples; training a resource coordination scheduling model according to the resource constraints, the user satisfaction constraints and the load constraints; inputting a to-be-scheduled resource task into the trained resource coordination scheduling model to obtain a resource scheduling strategy.
[0117] In another aspect, the present application also provides a non-transitory computer readable storage medium having a computer program stored thereon, and the computer program is executable by a processor to implement the resource coordination scheduling method provided by the above method, which comprises: obtaining decision tuples of historical tasks; performing the historical tasks, and calculating resource constraints, user satisfaction constraints and load constraints according to resource data in the decision tuples; training a resource coordination scheduling model according to the resource constraints, the user satisfaction constraints and the load constraints; inputting a to-be-scheduled resource task into the trained resource coordination scheduling model to obtain a resource scheduling strategy.
[0118] The device embodiments described above are only schematic, wherein the units shown as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment. Those skilled in the art can understand and implement without creative labor.
[0119] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be implemented by means of software plus necessary universal hardware platforms, and of course can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0120] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; and although the present application has been described in detail with reference to the foregoing embodiments, it should be appreciated by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features thereof can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A resource collaborative scheduling method, characterized in that, include: Obtain the decision tuples of historical tasks; Execute the historical task and calculate the resource constraints, user satisfaction constraints, and load constraints based on the resource data in the decision tuple; Train a resource collaborative scheduling model based on the resource constraints, user satisfaction constraints, and load constraints; Input the resource tasks to be scheduled into the trained resource collaborative scheduling model to obtain the resource scheduling strategy; The steps for obtaining the decision tuples of historical tasks include: Obtain the sequence number of the resource node executing the historical task, the execution location of the historical task, the amount of resources provided by the resource node, the edge communication node that allocates communication resources to the historical task, and the communication bandwidth allocated by the edge communication node. The sequence number of the resource node, the execution location, the resource quantity, the edge communication node, and the communication bandwidth are added to the target tuple to obtain the decision tuple of the historical task. The step of executing the historical task and calculating the user satisfaction constraint based on the resource data in the decision tuple includes: Execute the historical task, and calculate the execution time, terminal energy consumption, and resource cost of the terminal that initiated the historical task based on the sequence number of the resource node, the execution location, the resource quantity, the edge communication node, and the communication bandwidth in the decision tuple. Obtain the actual resource data for executing the historical task, and calculate the user satisfaction constraint based on the execution time, terminal energy consumption, resource cost, and actual resource data; The step of calculating resource constraints based on the resource data in the decision tuple includes: Obtain preset bandwidth thresholds, preset cost thresholds, and preset memory requirement constraints; Based on the first comparison result between the communication bandwidth and the preset bandwidth threshold, the second comparison result between the resource cost and the preset cost threshold, and the preset memory requirement constraint, the resource constraint is calculated. The step of calculating the load constraint based on the resource data in the decision tuple includes: Obtain the currently used resources and resource weights of the resource node, as well as the set of containers on which the resource node runs the historical tasks; Based on the resource weights, a first weighted load rate and a second weighted load rate are calculated, and the first weighted load rate and the second weighted load rate are added together to obtain the single node load rate. The resource node load rate is calculated based on the communication bandwidth. The load constraint is calculated based on the single node load rate and the resource node load rate.
2. The resource collaborative scheduling method according to claim 1, characterized in that, The step of inputting the resource task to be scheduled into the trained resource collaborative scheduling model to obtain the resource scheduling strategy includes: Based on the resource constraints, user satisfaction constraints, and load constraints, determine the task execution nodes and containers to be migrated for the resource tasks to be scheduled. Based on the task execution node and the container to be migrated, determine the resource scheduling strategy corresponding to the resource task to be scheduled.
3. A resource collaborative scheduling device, characterized in that, include: The decision tuple acquisition module is used to acquire decision tuples from historical tasks. The constraint calculation module is used to execute the historical task and calculate resource constraints, user satisfaction constraints, and load constraints based on the resource data in the decision tuple. The model training module is used to train a resource collaborative scheduling model based on the resource constraints, the user satisfaction constraints, and the load constraints. The resource scheduling strategy acquisition module is used to input the resource task to be scheduled into the trained resource collaborative scheduling model to obtain the resource scheduling strategy. The decision tuple acquisition module is specifically used for: Obtain the sequence number of the resource node executing the historical task, the execution location of the historical task, the amount of resources provided by the resource node, the edge communication node that allocates communication resources to the historical task, and the communication bandwidth allocated by the edge communication node. The sequence number of the resource node, the execution location, the resource quantity, the edge communication node, and the communication bandwidth are added to the target tuple to obtain the decision tuple of the historical task. The constraint calculation module is specifically used for: Execute the historical task, and calculate the execution time, terminal energy consumption, and resource cost of the terminal that initiated the historical task based on the sequence number of the resource node, the execution location, the resource quantity, the edge communication node, and the communication bandwidth in the decision tuple. Obtain the actual resource data for executing the historical task, and calculate the user satisfaction constraint based on the execution time, terminal energy consumption, resource cost, and actual resource data; Obtain preset bandwidth thresholds, preset cost thresholds, and preset memory requirement constraints; Based on the first comparison result between the communication bandwidth and the preset bandwidth threshold, the second comparison result between the resource cost and the preset cost threshold, and the preset memory requirement constraint, the resource constraint is calculated. Obtain the currently used resources and resource weights of the resource node, as well as the set of containers on which the resource node runs the historical tasks; Based on the resource weights, a first weighted load rate and a second weighted load rate are calculated, and the first weighted load rate and the second weighted load rate are added together to obtain the single node load rate. The resource node load rate is calculated based on the communication bandwidth. The load constraint is calculated based on the single node load rate and the resource node load rate.
4. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the resource collaborative scheduling method as described in any one of claims 1 or 2.
5. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the resource collaborative scheduling method as described in any one of claims 1 or 2.
6. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the resource collaborative scheduling method as described in any one of claims 1 or 2.