Complex task unloading method based on multi-agent cooperation and application thereof
By generating tasks on the mobile terminal and performing resource awareness and scheduling optimization, complex tasks are offloaded to the device with the shortest completion time, the problem of limited resources of a single intelligent device is solved, and the goal of multiple intelligent devices is achieved to coordinate the task completion efficiency and user experience are improved.
Patent Information
- Application Number
- CN202311720057.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2025-03-14
AI Technical Summary
In a network environment with different resource distributions and complex and changeable resources, the computing power resources of a single intelligent device are limited, making it difficult to meet the resource requirements of generating complex tasks in real time. The existing technology has the problem of inaccurate scheduling and poor perception effects.
A complex task unloading method based on multi-agent collaboration is adopted. The mobile terminal generates tasks and encapsulates task attributes into the expansion header of the IPv6 packet, performs task type judgment and sub-task weight calculation, performs computing power perception and resource detection, and offloads tasks to the device with the shortest completion time according to the scheduling optimization method.
It reduces the time required for mobile terminals to work in universal edge computing, improves the performance and user experience of mobile terminals, realizes collaborative services of multiple intelligent devices, and improves the overall task completion rate of the system.
Smart Images

Figure CN119629675A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communication technology, and in particular to a complex task offloading method based on multi-agent collaboration and its application. Background Art
[0002] With the development of network technology and hardware integration, smart wearables, mobile phones and other mobile smart devices are connected to the network and generate a large amount of network data, integrating with various social, economic, military and other businesses. In some resource-constrained environments, such as scenarios without infrastructure and scarce resources (battlefield environments, disaster relief, etc.), due to the lack of centralized management, the scheduling, computing and storage of tasks can only be completed by mobile smart devices with perception, storage and communication capabilities, and pervasive edge computing (PEC) applications are born.
[0003] PEC based on the field battlefield environment is an innovative technology. It consists of heterogeneous intelligent devices (such as tanks, infantry fighting vehicles, medical vehicles, smart wearables, etc.) with different resource distributions. The devices are dynamically mobile and can only perform short-range wireless communications, which meets the requirements of modern military combat fields. These devices provide support for the execution of complex, changeable and highly dynamic military operations in the future through mutual information exchange. However, in a network environment with different and complex resource distributions, the computing power resources of a single intelligent agent are limited, such as smart wearables, and may not be able to meet the resource requirements for real-time generation of complex task execution. Then multiple intelligent agents are required to complete complex tasks through the sharing of computing power resources. How to schedule tasks to suitable intelligent agents so that tasks can be completed more efficiently is a problem we need to solve, which has higher requirements for designing an efficient resource perception and task scheduling method. The existing technology is a task scheduling method based on metaheuristics and computing power perception, but in this regard, there are shortcomings such as not being suitable for scheduling real-time complex tasks and poor perception effects, which puts greater pressure on the network load.
[0004] Since the field battlefield environment is complex and changeable, efficiently perceiving and offloading real-time complex tasks and realizing collaborative services of multi-agent devices are technical problems that technicians in this field need to solve. Summary of the invention
[0005] The purpose of the present invention is to provide a complex task offloading method based on multi-agent collaboration and its application, which is applied to ubiquitous edge computing; it can reduce the time required for tasks on mobile terminals during ubiquitous edge computing and improve the performance and user experience of mobile terminals.
[0006] In order to solve the above technical problems, the present invention provides a complex task offloading method based on multi-agent collaboration, comprising:
[0007] The mobile terminal generates tasks, wherein the tasks are divided into single simple tasks and complex tasks with multiple subtask dependencies modeled by directed acyclic graphs; the task attributes of the tasks are encapsulated into an extended header part of an IPv6 packet;
[0008] Determine the type and attributes of the generated task; when the task is determined to be a complex task, calculate the weight of each subtask in the complex task;
[0009] The mobile terminal performs computing power perception on each of the simple tasks or the subtasks separately, so as to detect resource conditions of surrounding devices for each task;
[0010] According to the scheduling optimization method of the mobile terminal, the earliest completion time of each task on the surrounding devices is calculated through the calculation, transmission and waiting delay of the task, and the task is unloaded to the device with the shortest completion time;
[0011] After the mobile terminal executes the task, it sends the task result to the corresponding device for executing other tasks or serving as a sign of task completion.
[0012] In a preferred embodiment of the present invention, the directed acyclic graph modeling includes:
[0013] The complex task generated by the directed acyclic graph modeling is modeled as a graph G, where G = (T, E, ω), where T = {1, 2, ... t}, T is the set of subtasks to be executed; E is the dependency relationship between two tasks, and e ij ∈E, represents subtask t j The execution of requires subtask t i The execution result of subtask t j It is subtask t i The successor task, subtask t i It is subtask t j The predecessor task; ω is the computing power required by the subtask (C t , S t , B t ); A subtask without a predecessor task is defined as an initial task, and a subtask without a successor task is defined as an exit task.
[0014] In a preferred embodiment of the present invention, the generated task attributes of the task are encapsulated into the extended header part of the IPv6 packet, including: TS, TK, tID, sID, subID, C, S, B, delay; wherein,
[0015] TS is the message type, TK is the task type, tID is the task ID, sID is the source device ID of the generated task, subID is the subtask ID, C is the computing resources required for the task, S is the storage resources, B is the transmission resources (), delay is the latest completion time of the task;
[0016] For a simple task, TK=0, subID=0;
[0017] For complex tasks, TK is associated with the number of subtasks, and TS is associated with the type of message sent.
[0018] In a preferred embodiment of the present invention, when a task is determined to be a complex task, the weight of each subtask in the complex task is calculated, including:
[0019] For complex tasks, the weight of each subtask is calculated based on the dependencies between tasks and the average computing delay and average communication cost of the task in the network.
[0020] In a preferred embodiment of the present invention, the calculation of the weight of each subtask includes:
[0021] Starting from the exit task without successor tasks, the weight of each subtask is calculated from bottom to top; the average calculation delay and average communication cost formulas of the task are:
[0022] The average calculation delay formula is:
[0023] The average communication cost formula is:
[0024] in, is the computational latency of task t on device j, For task t i Required storage resources, B i is the transmission power of device i.
[0025] In a preferred embodiment of the present invention, the mobile terminal performs computing power perception for each simple task or subtask separately.
[0026] The task sends a query packet to nearby devices and then forwards it to detect the computing resources of surrounding devices. Within time t′, the source device communicates and inquires about the information of the generated simple task or the sequenced subtask to the surrounding devices.
[0027] The task is completed on the device at
[0028] in,
[0029]
[0030]
[0031] is the actual processing time of task t on device j, S t is the data size of the task, C t Refers to the CPU cycles required to complete each kb task, C j is the CPU cycle of device j per second, in Hz; T empty It is the idle time of the processing queue;
[0032] is the transmission delay of task t from device i to device j, Among them, B i It is represented by the bandwidth size of device i, is represented by the transmit power of device i, Denoted as the channel gain between device i and device j, D i,j It is represented by the distance between device i and device j, r is the channel fading factor, N 0 is the noise power; is the waiting delay of task t in the processing queue of device j, where m is the number of tasks ahead of task t when it enters the processing queue of device j and waits in queue.
[0033] In a preferred embodiment of the present invention, calculating the earliest completion time of each task on the surrounding devices includes:
[0034] If the task is a simple task or an initial task modeled by a directed acyclic graph, the earliest start time of the task on the corresponding device is in, is the waiting delay of the processing queue when the task arrives at device k;
[0035] If the task is a non-initial task in a complex task modeled by a directed acyclic graph, the earliest start time of the task on the corresponding device is in, is the maximum time to wait for the completion of the predecessor task; the earliest completion time of the task is
[0036] Offload tasks to the device that takes the least time to complete, including:
[0037] Select the device that takes the shortest time to complete the task and offload the task to it;
[0038] The earliest completion time of the task Where D is the task t j The collection of all devices that can communicate.
[0039] In a preferred embodiment of the present invention, sending the task result to the corresponding device includes:
[0040] The results of simple tasks are sent back to the source device to indicate the completion of the task;
[0041] In the complex tasks modeled by the directed acyclic graph, the task results of non-exit tasks are uniformly sent to the device where the exit tasks are unloaded for processing, and the processed results are used to execute the exit tasks; after the exit tasks are completed, the final results are sent back to the source device, and the entire complex task modeled by the directed acyclic graph is completed.
[0042] In a preferred embodiment of the present invention, a complex task offloading device based on multi-agent collaboration is characterized by comprising:
[0043] A task generation module, which is used for the mobile terminal to generate tasks, wherein the tasks are divided into single simple tasks and complex tasks with multiple subtask dependencies modeled by directed acyclic graphs; the task attributes of the tasks are encapsulated into the extended header part of the IPv6 packet;
[0044] A task judgment processing module is used to judge the type and attribute of the generated task; when the task is judged to be a complex task, the weight value of each subtask in the complex task is calculated;
[0045] A computing power sensing and detection module is used for the mobile terminal to sense the computing power of each simple task or subtask separately, and is used for each task to detect the resource status of surrounding devices;
[0046] The scheduling optimization module is used to calculate the earliest completion time of each task on the surrounding devices through the calculation, transmission and waiting delay of the task according to the scheduling optimization method of the mobile terminal, and unload the task to the device with the shortest completion time;
[0047] The task processing feedback module is used to send the task result to the corresponding device after the mobile terminal executes the task, which is used to execute other tasks or become a sign of task completion.
[0048] In a preferred embodiment of the present invention, a complex task offloading device based on multi-agent collaboration includes:
[0049] Memory;
[0050] processor;
[0051] as well as
[0052] Computer programs;
[0053] Wherein, the computer program is stored in the memory and is configured to be executed by the processor to implement a complex task offloading method based on multi-agent collaboration.
[0054] In a preferred embodiment of the present invention, a storage medium for complex task offloading based on multi-agent collaboration stores a computer program, which is executed by a processor to implement a complex task offloading method based on multi-agent collaboration.
[0055] The complex task offloading method based on multi-agent collaboration provided by the present invention generates a single simple task and a complex task modeled by a directed acyclic graph on a mobile terminal, and then offloads the tasks to different intelligent devices based on the computing power resources required for the tasks by sensing the computing power of surrounding intelligent devices, thereby realizing collaborative services of multiple devices; the weight of each subtask in the complex task is calculated based on a bottom-up weight method, and the perception order of the subtasks is determined based on the size of the weight; the earliest completion time required for the execution of each task is calculated by comprehensively considering resource factors such as device computing, storage, and transmission; finally, the mobile terminal schedules simple tasks or subtasks to appropriate devices for execution through a task scheduling method, thereby realizing the goal of collaborative completion of tasks by multiple intelligent devices.
[0056] The present invention solves the defects existing in the background technology, and the beneficial effects of the present invention are as follows:
[0057] A complex task offloading method based on multi-agent collaboration and its application are applied to ubiquitous edge computing; it can reduce the time required for tasks on mobile terminals during ubiquitous edge computing and improve the performance and user experience of mobile terminals. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] 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.
[0059] Figure 1 It is a flowchart of a complex task offloading method based on multi-agent collaboration in a preferred embodiment of the present invention;
[0060] Figure 2 A network environment diagram of pervasive edge computing in a preferred embodiment of the present invention;
[0061] Figure 3 A schematic example of a complex task modeled as a directed acyclic graph (DAG) in a preferred embodiment of the present invention;
[0062] Figure 4It is a design diagram of the IPv6 packet extension part in the preferred embodiment of the present invention;
[0063] Figure 5 This is a task unloading flow chart of a complex task unloading method based on multi-agent collaboration in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0064] The core of the present invention is to provide a complex task offloading method based on multi-agent collaboration and its application. The complex task offloading method based on multi-agent collaboration can achieve the goal of multiple intelligent devices collaborating to complete tasks in ubiquitous edge computing, reduce the time required for tasks on mobile terminals in ubiquitous edge computing, and improve the task completion performance and user experience of mobile terminals.
[0065] 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.
[0066] Embodiment 1:
[0067] Figure 1 A flowchart of a complex task offloading method based on multi-agent collaboration provided by an embodiment of the present invention; the complex task offloading method based on multi-agent collaboration includes:
[0068] Step s110: The mobile terminal generates a task, which is divided into a single simple task and a complex task with multiple subtask dependencies modeled by a directed acyclic graph, and the task attributes are encapsulated into the extended header part of the IPv6 packet.
[0069] The attributes of a task are abstracted as follows: {taskID, subtaskID, sourceID, C t , S t , B t , delay}. Among them, taskID is the unique identification ID of a simple task or a DAG complex task. All subtasks of a complex task modeled by a directed acyclic graph have the same taskID. subtaskID is the unique identification ID of a subtask of a complex task modeled by a directed acyclic graph. The subtaskID of a simple task is 0. sourceID is the unique identification ID of the device that generates the task (source device). t , S t , B tThe computing power, storage and bandwidth required for simple tasks or subtasks are respectively. Delay is the deadline of the task, and each task needs to be completed within the deadline.
[0070] The modeling of complex tasks and the design of extended header fields of IPv6 packets can be found in the introduction of related technologies and will not be elaborated here.
[0071] Step s120: determine the type and attributes of the generated task. If it is a complex task, calculate the weight of each subtask.
[0072] Among them, whether it is a simple task or a complex task is determined based on the attribute value of the task. For complex tasks, the weight of each subtask is calculated from the bottom up starting from the exit task without successor tasks based on the dependencies between tasks and the average computational delay and average communication cost of the tasks in the network. The formulas for the average computational delay and average communication cost of the tasks are:
[0073] Average calculation delay formula:
[0074] Average communication cost formula:
[0075] in, is the computational latency of task t on device j, For task t i Required storage resources, B i is the transmission power of device i.
[0076] The subtask without a successor task in the complex task modeled by the directed acyclic graph is defined as the exit task and defined as t exist . exist The weight rank is defined as Traverse upward from the exit task; subtask t j It is subtask t i The successor task of i The weight rank is
[0077] Task 1 For task t 2 and task t 3 The predecessor task, task t 2 and task t 3 If both are exit tasks,
[0078] Step s130: Perform computing power sensing for each simple task or subtask separately, so as to detect the resource status of surrounding devices for each task.
[0079] The task sends a query packet to nearby devices and then forwards it to detect the computing resources of surrounding devices. Within time t′, the source device communicates and inquires about the information of the generated simple task or the sequenced subtask to the surrounding devices. Within the deadline, among the candidate devices that receive the return information and are clearly able to complete the execution of the task, by comparing which device has the shortest completion time for the task, it is finally decided whether the task should be executed locally or offloaded to another device.
[0080] The task is completed on the device at
[0081] in,
[0082]
[0083]
[0084] in, is the actual processing time of task t on device j, S t is the data size of the task, C t Refers to the CPU cycles required to complete each kb task, C j is the CPU cycle of device j per second, in Hz. empty It is the idle time of the processing queue;
[0085] is the transmission delay of task t from device i to device j, Among them, B i It is represented by the bandwidth size of device i, is represented by the transmit power of device i, Denoted as the channel gain between device i and device j, D i,j It is represented by the distance between device i and device j, r is the channel fading factor, N 0 is the noise power.
[0086] is the waiting delay of task t in the processing queue of device j, where m is the number of tasks ahead of task t when it enters the processing queue of device j and waits in queue.
[0087] Step s140: According to the scheduling optimization method of the mobile terminal, the earliest completion time of the task on each of the surrounding devices is calculated according to the calculation, transmission, and waiting delays of the task, and the task is unloaded to the device with the shortest completion time.
[0088] If the task is a simple task or an initial task modeled by a directed acyclic graph, the earliest start time of the task on the device is in is the waiting delay of the processing queue when the task arrives at device k;
[0089] If the task is a non-initial task in a complex task modeled by a directed acyclic graph, the earliest start time of the task on the device is
[0090] in The maximum time to wait for the predecessor task to complete;
[0091] The earliest end time of the task is
[0092] Finally, the device with the shortest task completion time is selected and the task is offloaded to it. The earliest completion time of the task Where D is the task t j The collection of all devices that can communicate.
[0093] Step s150: After the mobile terminal executes the task, the task result is sent to the corresponding device for executing other tasks or serving as a sign of task completion.
[0094] The results of simple tasks are sent back to the source device, indicating the completion of the task. In the complex tasks modeled by the directed acyclic graph, the task results of non-exit tasks are uniformly sent to the device where the exit task is unloaded for unified processing, and the processed results are used to execute the exit task. After the exit task is completed, the final result is sent back to the source device, indicating the completion of the complex task modeled by the entire directed acyclic graph.
[0095] In the several embodiments provided in the present invention, it should be understood that the network environment of ubiquitous edge computing and the complex tasks of directed acyclic graph (DAG) modeling involved are merely schematic, and they only represent one form of the model, which can be expressed in many ways.
[0096] In summary, the complex task unloading method based on multi-agent collaboration provided by the present invention, in the scenario of ubiquitous edge computing, the mobile terminal generates a single simple task and a complex task modeled by a directed acyclic graph, and then unloads it to different intelligent devices according to the computing power resources required for the task through the computing power perception of the surrounding intelligent devices, so as to realize the collaborative service of multiple devices; according to the bottom-up weight method, the weight of each subtask in the complex task is calculated, and the perception order of the subtask is determined according to the size of the weight; comprehensively considers the resource factors such as device computing, storage, and transmission, and calculates the earliest completion time required for the execution of each task; finally, the mobile terminal schedules simple tasks or subtasks to the appropriate device for execution through the task scheduling method, so as to realize the goal of collaborative completion of tasks by multiple intelligent devices. The present invention can reduce the time required for tasks of the mobile terminal in ubiquitous edge computing, and improve the performance and user experience of the mobile terminal.
[0097] The present invention is based on the fact that in a network environment with different and complex resource distributions, the computing power resources of a single intelligent device are limited. Faced with the real-time generation of complex tasks, a method for allocating computing power resources and offloading tasks for multiple intelligent devices is designed, so that the network can meet the requirements of simple tasks with deterministic delays and complex tasks modeled by directed acyclic graphs as much as possible, reduce the overall service time required for tasks, and improve the overall task completion rate of the system.
[0098] Embodiment 2:
[0099] Based on the first embodiment, the ubiquitous edge computing environment of the present invention is introduced. Please refer to Figure 2 , Figure 2 A network environment diagram of ubiquitous edge computing provided by an embodiment of the present invention.
[0100] Considering a field battlefield environment without any network infrastructure, these smart devices (intelligent agents) form a wireless network based on their own capabilities. The computing resources of smart devices are different, and they exchange information with each other through short-distance communication. The smart devices are represented by N = (1, 2, 3, ..., n}, and the device attributes are abstractly represented as a seven-tuple: (nodeId, C, S, B, W B , V, θ}, where nodeId is the unique ID of the device, C, S, and B represent the computing power, storage capacity, and remaining bandwidth of the computing power resources of the device, respectively. B Represents the transmission power of the device. V, θ represent the speed and direction of the device's movement, respectively. Due to the limited communication range, the device only communicates directly with a small number of other devices. Devices are adjacent to each other (such as smart devices and soldiers). Devices that cannot communicate directly need to communicate indirectly through relay devices (such as smart devices and tanks). Some isolated devices are far away from other devices and cannot communicate with other devices; (such as smart watches).
[0101] Embodiment three:
[0102] Based on the first embodiment, the complex task of directed acyclic graph modeling of the present invention is introduced, referring to Figure 3 , Figure 3 A schematic diagram of a complex task modeled by a directed acyclic graph (DAG) provided in an embodiment of the present invention.
[0103] First, the soldier discovers the enemy target (subtask 1), then takes a picture with the device and uploads it (subtask 2), and uploads his location information (subtask 3). After receiving the picture, he surveys the terrain (subtask 4), and after surveying the terrain, he can accurately locate the target based on the soldier's location (subtask 5). Finally, the turret fires at the target (subtask 6). We can see that there is a dependency relationship between the subtasks.
[0104] The simple tasks and subtasks considered in this paper are independent and inseparable. The attributes of a task can be abstracted into a seven-tuple: (taskID, subtaskID, sourceID, C t , S t , B t , delay}. Among them, taskID is the unique identification ID of a simple task or a complex task modeled by a directed acyclic graph. All subtasks of a complex task modeled by a directed acyclic graph have the same taskID. subtaskID is the unique identification ID of a subtask of a complex task modeled by a directed acyclic graph. The subtaskID of a simple task is 0. sourceID is the unique identification ID of the device that generates the task (source device). t , S t , B t The computing power, storage and bandwidth required for simple tasks or subtasks are respectively. Delay is the deadline of the task, and each task needs to be completed within the deadline.
[0105] The complex task modeled by the directed acyclic graph is modeled as a graph G = (T, E, ω). T = {1, 2, ... t} represents the set of subtasks to be executed, E represents the dependency between two tasks, e ij ∈E represents subtask t j The execution of requires subtask t i The execution result of subtask t j It is subtask t i The successor task, subtask t i It is subtask t j ω represents the computing power required by the subtask (C t , S t , B t ).
[0106] In addition, in the complex task modeled by the directed acyclic graph, the subtask without a predecessor task is defined as the initial task, and the subtask without a successor task is defined as the exit task.
[0107] Embodiment 4:
[0108] Based on the first embodiment, the field design of the IPv6 packet of the present invention is introduced, referring to Figure 4 , Figure 4 The invention provides an IPv6 packet extension part design.
[0109] The extension header is placed between the IPv6 header and the upper layer protocol data unit, and the three together constitute the IPv6 packet. In the extension header section, we edited the fields to define the properties of the task.
[0110] The TK field indicates the type of task. TK=0 means that the task is a simple task. TK>0 means that the task is a complex task modeled by a directed acyclic graph. The value of TK represents the number of subtasks. The TS field represents the type of message. TS={0, 1, 2, 3}. 0 represents that the message is a task inquiry message, 1 represents that the message is a task reply message, 2 represents that the message is a task unloading message, and 3 represents that the message is a task result message. The sID field indicates the source device ID that generates the task. C, S, and B represent the computing, storage, and transmission resources required for the task, respectively. tID represents the ID of the task, and subID represents the subtask ID in the task. delay represents the latest completion time of the task. For example, suppose a device receives a message of {6, 2, 5, 2000, 3000, 1000, 8, 2, 400}, which means that the task is the second subtask in a DAG complex task containing 6 subtasks. It is generated by device No. 5 and the task ID is 8. The computing resources required for this task are 2000, 3000 and 1000 respectively, and the latest completion time of this task is 400s. Each field occupies 8 bits.
[0111] Embodiment five:
[0112] Based on the first embodiment, the task offloading process of the complex task offloading method based on multi-agent collaboration of the present invention is introduced. Figure 5 , Figure 5 The task offloading flow chart of the complex task offloading method based on multi-agent collaboration provided by the embodiment of the present invention. The task offloading process mainly includes the following steps:
[0113] (1) Task Inquiry
[0114] The source device broadcasts the information of simple tasks or ordered subtasks to the surrounding devices within time t′, and the receiving devices then broadcast and forward it to the surrounding devices. The broadcast IPv6 packet only contains the basic attributes of the task, namely the extended header field, and does not have specific message content. The broadcast extended header field includes task type (TK), message type (TS), source device ID (sID), task ID (tID), subtask ID (subID), computing resources required for the task (C, B, S) and task deadline (delay). It should be emphasized that TS=0 at this time, which means that this is a task inquiry message, and the other fields depend on the attributes of the task.
[0115] (2) Dispatch response
[0116] During time t′, only some devices can receive the task query message. These devices can obtain basic information of simple tasks or subtasks through the message, and then judge whether they can perform the task based on their own computing resources. Assume that device i can perform the task, that is, the computing resources of the device are greater than the computing resources required for the task (C i >C&S i >S&B i >B) and the earliest completion time is less than the task deadline (ET over <delay), device i sends an IPv6 packet to the source device of the task. The basic attributes include task type (TK), message type (TS), source device ID (sID), task ID (tID), and subtask ID (subID). At this time, TS=1, which means that this is a task reply message, and sID is the ID of device i. The specific message content is the earliest completion time. If device i cannot execute the task, it will not respond.
[0117] (3) Task offloading
[0118] After the source device receives multiple task reply messages sent by other devices, it can obtain the earliest completion time of a simple task or subtask on these devices. By comparison, we can get the device that makes the task complete in the shortest time. We send an IPv6 packet to the device. The basic attributes include the new message type (TS), the original device ID (sID), the task ID (tID), and the subtask ID (subID). At this time, TS = 2, which means that this is a task offloading message. The specific message content is the task data.
[0119] (4) Result transmission
[0120] A device executes a task after receiving a task unloading message from a source device. If it is a non-exit task of a DAG complex task, an IPv6 packet of the task result is sent to the device to which the exit task is unloaded, and finally a unified process is performed to obtain the result for executing the exit task. If the task is a simple task or an exit task of a DAG complex task, after the task is completed, an IPv6 packet of the task result is sent to the source device, indicating the end of the task. The basic attributes of the packet include the message type (TS), source device ID (sID), task ID (tID), and subtask ID (subID). At this time, TS=3, which means that this is a task result message, and sID is the ID of the device that executes the task. The specific message content is the result of the task.
[0121] Embodiment six:
[0122] Based on any one of the first to fifth embodiments, a complex task offloading device based on multi-agent collaboration includes:
[0123] A task generation module, which is used for the mobile terminal to generate tasks, wherein the tasks are divided into single simple tasks and complex tasks with multiple subtask dependencies modeled by directed acyclic graphs; the task attributes of the tasks are encapsulated into the extended header part of the IPv6 packet;
[0124] A task judgment processing module is used to judge the type and attribute of the generated task; when the task is judged to be a complex task, the weight value of each subtask in the complex task is calculated;
[0125] A computing power sensing and detection module is used for the mobile terminal to sense the computing power of each simple task or subtask separately, and is used for each task to detect the resource status of surrounding devices;
[0126] The scheduling optimization module is used to calculate the earliest completion time of each task on the surrounding devices through the calculation, transmission and waiting delay of the task according to the scheduling optimization method of the mobile terminal, and unload the task to the device with the shortest completion time;
[0127] The task processing feedback module is used to send the task result to the corresponding device after the mobile terminal executes the task, which is used to execute other tasks or become a sign of task completion.
[0128] Embodiment seven:
[0129] Based on any one of the first to fifth embodiments, a complex task offloading device based on multi-agent collaboration includes:
[0130] Memory;
[0131] processor;
[0132] as well as
[0133] Computer programs;
[0134] Wherein, the computer program is stored in the memory and is configured to be executed by the processor to implement a complex task offloading method based on multi-agent collaboration.
[0135] Embodiment eight:
[0136] Based on any one of the embodiments one to five, a storage medium for complex task offloading based on multi-agent collaboration is provided, on which a computer program is stored, and the computer program is executed by a processor to implement a complex task offloading method based on multi-agent collaboration.
[0137] The technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a mobile terminal (which can be a mobile phone, or a tablet computer, etc.) to execute all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0138] 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.
[0139] The above is a detailed introduction to the network, tasks, IPv6 extension headers and task offloading process of the complex task offloading method based on multi-agent collaboration provided by the present invention. The present invention uses specific examples 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, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A complex task offloading method based on multi-agent collaboration, characterized in that: include: The mobile terminal generates tasks, which are divided into single simple tasks and complex tasks with multiple subtask dependencies modeled by directed acyclic graphs; The task attributes of the task are encapsulated into the extended header part of the IPv6 packet; Determining the type and attributes of the generated task; When the task is determined to be a complex task, a weight value is calculated for each subtask in the complex task; The mobile terminal performs computing power perception on each of the simple tasks or the subtasks separately, so as to detect resource conditions of surrounding devices for each task; According to the scheduling optimization method of the mobile terminal, the earliest completion time of each task on the surrounding devices is calculated through the calculation, transmission and waiting delay of the task, and the task is unloaded to the device with the shortest completion time; After the mobile terminal executes the task, it sends the task result to the corresponding device for executing other tasks or serving as a sign of task completion.
2. The complex task offloading method based on multi-agent collaboration as claimed in claim 1, characterized in that: The directed acyclic graph modeling includes: The complex task generated by the directed acyclic graph modeling is modeled as a graph G, where G = (T, E, ω), where T = {1, 2, ... t}, T is the set of subtasks to be executed; E is the dependency between two tasks, and e ij ∈E, represents subtask t j The execution of requires subtask t i The execution result of subtask t j It is subtask t i The successor task, subtask t i It is subtask t j The predecessor task; ω is the computing power required by the subtask (C t ,S t ,B t ); A subtask without a predecessor task is defined as an initial task, and a subtask without a successor task is defined as an exit task.
3. The complex task offloading method based on multi-agent collaboration as claimed in claim 1, characterized in that: The generated task attributes of the task are encapsulated into the extended header part of the IPv6 packet, including: TS, TK, tID, sID, subID, C, S, B, delay; Among them, TS is the message type, TK is the task type, tID is the task ID, sID is the source device ID of the generated task, subID is the subtask ID, C is the computing resources required for the task, S is the storage resources, B is the transmission resources, and delay is the latest completion time of the task; For a simple task, TK=0, subID=0; For a complex task, subID≤TK; TK is associated with the number of subtasks, and TS is associated with the type of message sent.
4. The complex task offloading method based on multi-agent collaboration as claimed in claim 1, characterized in that: When the task is determined to be a complex task, the weight of each subtask in the complex task is calculated, including: For complex tasks, the weight of each subtask is calculated based on the dependencies between tasks and the average computing delay and average communication cost of the task in the network.
5. The complex task offloading method based on multi-agent collaboration as claimed in claim 4, characterized in that: The calculation of the weight of each subtask includes: Starting from the exit task without successor tasks, the weight of each subtask is calculated from bottom to top; the average calculation delay and average communication cost formulas of the task are: The average calculation delay formula is: The average communication cost formula is: in, is the computational latency of task t on device j, For task t i Required storage resources, B i is the transmission power of device i.
6. The complex task offloading method based on multi-agent collaboration as claimed in claim 1, characterized in that: The mobile terminal performs computing power perception for each simple task or subtask separately, including: The task sends a query packet to nearby devices and then forwards it to detect the computing resources of surrounding devices. Within time t', the source device communicates and inquires about the information of the generated simple task or the sequenced subtask to the surrounding devices. The task is completed on the device at in, is the actual processing time of task t on device j, S t is the data size of the task, C t Refers to the CPU cycles required to complete each kb task, C j is the CPU cycle of device j per second, in Hz; T empty It is the idle time of the processing queue; is the transmission delay of task t from device i to device j, Among them, B i It is represented by the bandwidth size of device i, is represented by the transmit power of device i, Denoted as the channel gain between device i and device j, D i,j It is represented by the distance between device i and device j, r is the channel fading factor, and N0 is the noise power; is the waiting delay of task t in the processing queue of device j, where m is the number of tasks ahead of task t when it enters the processing queue of device j and waits in queue.
7. The complex task offloading method based on multi-agent collaboration as claimed in claim 1, characterized in that: Calculate the earliest completion time of each task on the surrounding devices, including: If the task is a simple task or an initial task modeled by a directed acyclic graph, the earliest start time of the task on the corresponding device is in, is the waiting delay of the processing queue when the task arrives at device k; If the task is a non-initial task in a complex task modeled by a directed acyclic graph, the earliest start time of the task on the corresponding device is in, is the maximum time to wait for the predecessor task to complete; the earliest end time of the task is Offload tasks to the device that takes the least time to complete, including: Select the device that takes the shortest time to complete the task and offload the task to it; The earliest completion time of the task Where D is the task t j The collection of all devices that can communicate.
8. The complex task offloading method based on multi-agent collaboration as claimed in claim 1, characterized in that: The sending of the task result to the corresponding device includes: The results of simple tasks are sent back to the source device to indicate the completion of the task; In the complex tasks modeled by the directed acyclic graph, the task results of non-exit tasks are uniformly sent to the device where the exit tasks are unloaded for processing, and the processed results are used to execute the exit tasks; after the exit tasks are completed, the final results are sent back to the source device, and the entire complex task modeled by the directed acyclic graph is completed.
9. A complex task offloading device based on multi-agent collaboration, characterized in that: include: A task generation module, which is used for the mobile terminal to generate tasks, wherein the tasks are divided into single simple tasks and complex tasks with multiple subtask dependencies modeled by directed acyclic graphs; the task attributes of the tasks are encapsulated into the extended header part of the IPv6 packet; A task judgment processing module is used to judge the type and attribute of the generated task; when the task is judged to be a complex task, the weight value of each subtask in the complex task is calculated; A computing power sensing and detection module is used for the mobile terminal to sense the computing power of each simple task or subtask separately, and is used for each task to detect the resource status of surrounding devices; The scheduling optimization module is used to calculate the earliest completion time of each task on the surrounding devices through the calculation, transmission and waiting delay of the task according to the scheduling optimization method of the mobile terminal, and unload the task to the device with the shortest completion time; The task processing feedback module is used to send the task result to the corresponding device after the mobile terminal executes the task, which is used to execute other tasks or become a sign of task completion.
10. A complex task offloading device based on multi-agent collaboration, characterized in that: include: Memory; processor; as well as Computer programs; Wherein, the computer program is stored in the memory and is configured to be executed by the processor to implement the complex task offloading method based on multi-agent collaboration as described in any one of claims 1 to 8.
Citation Information
Cited By
Equipment cluster scheduling method and system based on multi-agent collaboration
CN122132609A