A network state adaptive target detection computing task offloading scheduling method
By combining dynamic scheduling of lightweight and complete target detection models in the edge environment, using chemical reaction optimization and reinforcement learning algorithms, the resource allocation and computational complexity problems of target detection tasks in the edge environment are solved, and efficient task offloading and Resource utilization.
Patent Information
- Application Number
- CN202410949725.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-16
AI Technical Summary
In edge environments, target detection tasks are difficult to achieve efficient computing on mobile devices due to insufficient computing resources, and existing technologies are difficult to effectively dynamically allocate and schedule resources, resulting in computational complexity and resource waste.
A network status adaptive target detection computing task offloading and scheduling method is proposed. By dynamically scheduling computing tasks between edge devices and edge cloud servers, a combination of a lightweight target detection model and a complete target detection model is used, combined with a chemical reaction optimization algorithm. and reinforcement learning algorithms to optimize resource allocation and task offloading decisions.
It achieves effective dynamic resource allocation and task offloading in edge environments, reduces computational complexity and energy consumption, improves task completion efficiency and service quality, and overcomes dynamic input variables in deep reinforcement learning algorithms and insufficient convergence in bandwidth environments. Stability issues.
Smart Images

Figure CN118484315B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of edge computing technology and computer vision, and in particular to a network state adaptive target detection computing task offloading scheduling method. Background Art
[0002] In recent years, with the rapid development of communication technology and artificial intelligence (AI), deep learning-based object detection is being widely used in various scenarios to support various intelligent Internet of Things (IoT) applications, such as intelligent monitoring, object detection, and autonomous driving. Among them, object detection has become one of the most basic and important applications in the fields of urban security, automatic navigation, medical diagnosis, and augmented reality.
[0003] Object detection refers to detecting the location of an object and identifying its category from an image. Object detection methods based on convolutional neural networks, such as R-CNN, YOLO, and SSD, have overcome problems such as manually constructed features and achieved good practical performance. However, such methods often require the support of high-computing servers. The resulting hardware costs and service delays are still unacceptable for object detection tasks that need to be deployed on mobile device terminals and have high real-time requirements, especially in certain edge environments with insufficient computing resources.
[0004] The difficulties in achieving effective target detection on mobile devices are mainly reflected in two aspects: (1) As the performance of target detection algorithms on benchmark datasets continues to improve, the detection accuracy continues to increase. The network structure for data collection and feature extraction is also gradually becoming deeper and more complex, which makes it difficult to deploy algorithms on mobile devices with limited resources; (2) Although using a simple network structure can reduce the requirements for mobile devices, it is difficult to achieve satisfactory confidence and accuracy in terms of the accuracy requirements of the task itself. With the development of technologies such as cloud computing and edge computing, computing resources have been greatly enriched, allowing some or all computing tasks to be offloaded to more powerful computing nodes, such as cloud servers and edge cloud servers.
[0005] Faced with the shortage of local computing resources, edge computing has become a viable solution.
[0006] In the computing offloading stage of edge computing, it is necessary to consider the data size and content of the offloading task, the energy consumption of the equipment, the task completion time requirements, the user quality experience, etc. to decide the offloading ratio of the computing task; in the resource allocation stage of edge computing, it is necessary to balance the computing resources and network resources in the system, and achieve the minimum system latency and the lowest energy consumption while meeting the business service quality through resource allocation. The computing network can allocate and flexibly schedule computing resources, storage resources, and network resources between the cloud, network, and edge on demand according to business needs. This dynamic allocation and scheduling capability enables more efficient use of computing resources and avoids waste and idleness of resources. Therefore, how edge devices can effectively dynamically allocate and schedule resources under the constraints of the above conditions to effectively meet customer needs has become a problem waiting to be solved.
[0007] In view of this, a network state adaptive target detection computing task offloading scheduling method is proposed. Summary of the invention
[0008] In view of this, the purpose of the present invention is to propose a network state adaptive target detection computing task offloading scheduling method, which can effectively solve the computational complexity problem in the dynamic environment of edge devices, and the problem of joint scheduling of network resources in the computing devices of target detection tasks in edge devices.
[0009] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0010] The present invention provides a method for offloading and scheduling target detection computing tasks with network state self-adaptation, comprising the following steps:
[0011] Step 1: According to the task in the target detection scenario, the target information required for the task is obtained and preprocessed to obtain an image dataset; specifically, the following steps are included:
[0012] Step 11: Determine the task requirements based on the tasks in the target detection scenario;
[0013] Step 12: Select the corresponding environment perception device according to the task requirements;
[0014] Step 13: Use the environment perception device to collect the target information required for the task and obtain the initial video file;
[0015] Step 14: Decomposing the initial video file into a plurality of separate image frames through a video processing library;
[0016] Step 15, scaling the image frame to m*m pixels and channels in RGB format by performing image scaling and color channel conversion on the image frame;
[0017] Step 16: normalize each image frame to obtain a plurality of processed image frames as an image data set;
[0018] Step 2: training a preset target detection framework using the image data set to obtain a target detection model; specifically comprising:
[0019] Step 21, dividing the image data set into a training set, a validation set and a test set according to a set ratio;
[0020] Step 22: annotate the image frames in the training set, marking the positions and categories of the objects in the image frames;
[0021] Step 23: input the training set into a preset target detection framework, wherein the target detection framework includes a first YOLOv5s model without a MobileNetV3 module and a second YOLOv5s model with a MobileNetV3 module;
[0022] Step 24, using the position and category of the object in the image frame as features to train the first YOLOv5s model and the second YOLOv5s model respectively, the trained first YOLOv5s model is used as a complete target detection model, and the trained second YOLOv5s model is used as a lightweight target detection model; the complete target detection model and the lightweight target detection model have the ability to identify the target object in the image, realize input of a new image, and output the position and category information of the object in the image;
[0023] Step 3: construct a synaesthesia-computing integrated task requirement model in a network composed of multiple edge devices and edge cloud servers, and use the target detection model to map the synaesthesia-computing integrated task requirement model into an action space selection problem; specifically including:
[0024] Step 31: Acquire external environment information through the task information provided by the client and the task perception module, and establish a task requirement model integrating synaesthesia and computing based on the physical information fusion system between multiple edge devices and multiple detection tasks in the edge scene according to the external environment information;
[0025] Step 32: The task offloading requirements, energy consumption requirements, bandwidth between the edge cloud server and the edge device, computing power of the local computing device, and detection results of each image frame obtained by using the complete target detection model and the lightweight target detection model are used as attributes to form a system state, and the resource scheduling target of the system is obtained;
[0026] Step 33: Perform local computing or computing offloading on computing tasks generated by multiple edge devices according to the resource scheduling target of the system, so as to coordinate task offloading decisions and resource allocation between each edge device;
[0027] Step 34: By combining the time slot requirements, energy consumption requirements and task offloading computing requirements of each edge device in the edge scenario, an optimization problem is proposed with the goal of minimizing the task completion delay under the constraints of the integrated energy consumption and service requirements of the synergy computing, and then the synergy computing integrated task requirement model is mapped into a non-convex, real-time dynamic and discrete action space selection problem;
[0028] Step 35: The edge device and the edge cloud server are connected through a wireless access point AP to form a network;
[0029] The steps 31 to 35 specifically include:
[0030] In the task requirement model of integrated synaesthesia and computing, both edge devices and edge cloud servers have target detection functions; lightweight target detection models are deployed on edge devices in a local computing manner. At this time, all grouping modules All are executed in the local computing device; the edge device and the edge cloud server jointly carry the complete target detection model in the form of computational offloading, that is, the intermediate data samples of the complete target detection model in the local computing device are obtained through block processing, and the intermediate data samples are offloaded to the edge cloud server for the next step of calculation. By determining different grouping modules, part of the grouping modules Calculated on the edge cloud server, the remaining grouping modules will be executed on the local computing device;
[0031] In duration In the time slot system, let the integer is the time slot index and ≥1; for edge device set Any edge device in ,in, Represents the edge device set The upper limit of the number of devices in the time slot When a task is initiated, use represents the task completion time, and the number of time slots is recorded as , Indicates the result is rounded; first execute the task on the local computing device, and assist in meeting the service quality through computing offloading; set Indicates time slot At the initial task execution state, Representing edge devices In time slot The number of data sets that have executed tasks at the time; Is an edge device set A list of action state sets, representing time slots The unloading decision vector, where the elements As the element at the corresponding position in the list, the value is a non-negative integer;
[0032] when =0, it means The edge device does not uninstall, executes the lightweight target detection model on the local computing device, and records the execution status. ;when >0 and the number of target images detected after executing the lightweight target detection model is greater than or equal to the uninstall decision variable , it means that the edge device will uninstall intermediate data samples to the edge cloud server, ;when >0 and the number of target images detected after executing the lightweight target detection model is less than the uninstall decision variable When executing the lightweight target detection model on the local computing device, ; On edge devices When performing lightweight target detection calculations at the edge, a detection result is obtained locally, otherwise the intermediate data samples are sent from the edge device The local cache is offloaded to the edge cloud server to perform complete target detection calculations and generate one or more complete target detection results;
[0033] Consider in the lightweight target detection model and the complete target detection model, let Indicates The number of CPU cycles required for layer calculation, where is the number of CPU cycles budgeted for a floating point, The first The number of output data of each module, represents the number of floating-point operations required to compute one output data element; assuming and Represents edge devices and the CPU frequency of the edge cloud server, let Indicates that the lightweight target detection model is The computational latency of local computation on an edge device is:
[0034]
[0035] in, is the collection of all edge devices;
[0036] For Complete object detection model grouping module for edge devices The local computation delay is:
[0037]
[0038] Edge devices The local computational energy consumption of the lightweight object detection model on If it means:
[0039]
[0040] Similarly, edge devices The local computational energy consumption of the partially complete object detection model on It is expressed as:
[0041]
[0042] in, For edge devices Energy efficiency coefficient; For the complete target detection model, each edge device is assigned a virtual CPU on the edge cloud server, and it is assumed that the computing resources on the edge cloud server are sufficient and the frequency of the virtual CPU allocated to each edge device is constant; Let Indicates the device In time slot During the complete target detection grouping module The calculation delay is:
[0043]
[0044] Among them, , For any time slot, the target detection calculation of the task samples to be processed in each edge device is completed within one time slot;
[0045] make Indicates the data size in the middle-layer module, where Represents the number of floating point digits in the output data. Represents the intermediate layer module of target detection, is the number of data elements output by the middle layer module; considering the edge device and the total radio spectrum bandwidth is The uplink wireless transmission between access points AP adopts orthogonal frequency division multiple access;
[0046] Assumptions Indicates time slot The bandwidth allocation decision vector during the period, express 'dimensional real number set, element Indicates that it is assigned to edge devices The bandwidth ratio is obtained in the time slot During this period, an intermediate data sample is sent from the edge device The local cache is offloaded to the edge cloud server through the access point AP to reduce the transmission delay. express:
[0047]
[0048] in, is a constant and 0< <1*10 -5 , For edge devices The transmission power, For edge devices With access point The constant transmit power gain of the uplink between is the noise power and the bandwidth used is , assuming the constant
[0049] ;
[0050] Ignoring the downlink latency of transmitting the complete inference results back to the edge device, To the contact Unload an intermediate data sample in the time slot The transmission energy loss during this period is recorded as:
[0051]
[0052] Will Defined as time slot The network resource consumption ratio during the period, and it is Continuous decision making in
[0053] Variable, expressed as time slots The upper limit of the ratio of total transmission and edge computing resource usage during the period, namely:
[0054]
[0055] make , indicating the corresponding time slot is an auxiliary binary decision variable set in , where Indicates that at least one intermediate data sample is received from the edge device Uninstall in Indicates that there are no intermediate data samples from edge devices Uninstall in
[0056] make Representing edge devices In time slot The local energy consumption at this time is:
[0057]
[0058] Time slot The total cost is recorded as , which is expressed as the linear weighted sum of the local total energy consumption of all edge devices and the network resource consumption ratio, and the weight is recorded as ,but:
[0059]
[0060] By perceiving the system status, the limited system resources are effectively utilized, and the optimization problem is proposed with the goal of minimizing the task completion delay under the energy consumption constraint of integrated synaesthesia and computing.
[0061] Furthermore, the step 4 specifically includes:
[0062] The chemical reaction optimization algorithm is used to optimize the existing decision variables in a limited action space. and network resource consumption ratio Perform preliminary calculations; the chemical reaction optimization algorithm steps are as follows:
[0063] In the chemical reaction optimization algorithm, three attribute states are defined for the molecule: molecular structure S, molecular potential energy PE and molecular kinetic energy KE. The molecular structure S represents a solution space of the task offloading strategy. The molecular potential energy PE represents the stability of the molecular structure and is defined as the value of the objective function. The molecular kinetic energy KE makes the molecular potential energy tend to a higher state and converts the required The value is defined as the fitness function;
[0064] By using the defined solution form as an operation operator, the basic molecular operations in chemical reactions are simulated. Four basic operation operators are defined, namely, single molecule collision, single molecule decomposition, intermolecular collision and molecular synthesis. Each molecular structure after the problem encoding represents a solution strategy. Through different molecular basic operations, the structure between molecules changes, and the fitness obtained is different.
[0065] By encoding the resource allocation sub-problem, each decision variable is simulated using a molecular structure composed of 0 and 1 sequences. and network resource consumption ratio The combination form, and then according to the operator operation, find the minimum cost corresponding to and ;
[0066] The optimal solution and Substituting into the formula: After that, Convert to ;
[0067] Step 4: Preliminarily simplify the action space selection problem;
[0068] Step 5: Convert the action space selection problem into a partially observable Markov decision process according to the state vector of the edge device;
[0069] Step 6: Based on the environment-aware reinforcement learning algorithm, perform task scheduling processing based on synaesthesia and computing, learn the state vector of Markov decision-making, and obtain the optimal resource allocation strategy for edge devices to meet business needs in different environments;
[0070] Step 7: Execute task offloading according to the optimal strategy, and evaluate the performance of the scheduling offloading strategy according to the offloading result to implement the scheduling of the task.
[0071] Furthermore, the step 5 specifically includes:
[0072] Step 51: normalize the state vector of the edge device and pre-process the observed state using a state normalization algorithm; the state vector includes the number of time slots, the device cache state, the device cumulative confidence level and the device real-time network bandwidth, wherein the device cumulative confidence level is obtained by detecting the image using a lightweight target detection model and a complete target detection model, and then the detection result is processed by a cumulative confidence module to obtain the cumulative confidence of the device as the device cumulative confidence level;
[0073] Step 52: Convert the action space problem into a partially observable Markov decision process according to the state vector of the edge device, and record and update the maximum value between the state vectors in real time.
[0074] Further, the steps 51 to 52 include:
[0075] (1) Definition The state vector of a time slot: ,in Representing edge devices In time slot The number of datasets that executed the lightweight target detection model when For each edge device The cumulative confidence level of is the number of time slots, The real-time available network bandwidth;
[0076] The difference between the maximum and minimum values of each variable recorded under preprocessing is used as the scaling factor: , and ,in is a scaling factor for the number of datasets that implement a lightweight object detection model, Each edge device Cumulative confidence level scaling factor is the time slot scaling factor, Represents the scaling factor of the real-time bandwidth; through division operation, it is realized Normalization of
[0077] (2) Define the system action space: time slot The motion vector ,in represents the entire action space; let Representation and Status The relevant subspace of possible actions, including the state Satisfaction All actions of the constraint, time slot The action should satisfy ;
[0078] Project discrete actions into continuous actions through the action domain to meet the reinforcement learning algorithm's processing requirements for continuous actions;
[0079] (3) Define the system reward function to minimize the total delay violation penalty of all edge devices and minimize the total cost for each time slot. Rewards It is expressed as:
[0080] -
[0081] in, is a positive weight, Yes Equipment In time slot Delayed violation penalty at the end of the Each edge device is currently The task completion penalty between the moment confidence and the final confidence.
[0082] Furthermore, the step 6 specifically includes:
[0083] The reinforcement learning algorithm based on environment perception is a Markov decision process decision module that performs synaesthesia-computing integrated task offloading decision in uncertain network states and detection scenarios; the reinforcement learning algorithm uses the Actor-Critic algorithm as the basic framework of the algorithm, adopts a deep neural network as an approximation of the policy network and the action network, and uses a stochastic gradient algorithm to train the parameters in the policy network and value network model;
[0084] In the reinforcement learning algorithm, a dual neural network model architecture is used for both the strategy function and the value function, including Online and Target, in which the Online Critic needs to be defined. Responsible for updating iterative parameters and calculate the current state-action value, Defining Target Critic Used to approximate the state-action of the next moment Value; defines the Online Actor Responsible for network parameters Iterative update and select action according to the current input state , used to generate new states and rewards with the environment , and Target Actor Based on the experience replay pool constructed The next state sampled in Choose the best action ; At the beginning of training, clear the experience replay pool D and randomly initialize parameters ;
[0085] At the beginning of the reinforcement learning algorithm, from the time slot k At the beginning, the system's agent observes the current state of the environment And according to Greedy strategy, The probability of passing The action to take when getting this status ;for Greedy strategy, The probability of Randomly select an action; for The value is taken from the minimum to 1, as the agent continues to observe, The exploration probability is decreasing, and the attenuation factor ;
[0086] Add some random noise to the actions of the reinforcement learning algorithm ,in The network calculates the current state action and obtains:
[0087]
[0088] in, Indicates the current state of the environment The action below;
[0089] Run the reinforcement learning algorithm to interact with the state and the smart IoT environment. When the edge device starts a new set of target detection tasks, the event starts, and when the confidence of the last edge device meets the threshold requirement, the entire event ends. At the beginning of each event, the state of the reinforcement learning is initialized to ; If all tasks are completed within the specified deadline, that is, the total number of time slots of the event is less than , in which case there is no delay violation penalty; when the total time slot of the event is greater than When there is a delay violation penalty; a binary flag Indicates time slot Is it the last time period of the event? , it means that the event is in the time slot The process ends at the state where the completion signal is generated;
[0090] Then, the system notifies each edge device of the new offloading decision based on the obtained action, in the time slot At the end, the agent calculates the execution action Rewards , and observe the new state , and the new cumulative confidence level is calculated by the cumulative target detection scheme on each edge device Update, new cache status is based on The constraints are updated and the completion signal In time slot A check is performed at the end of the event to determine the termination of the event;
[0091] Then, the new transition segment The experience memory added to the reinforcement learning algorithm and N experiences are sampled from the experience memory, so the estimated value of Target Critic is expressed as:
[0092]
[0093] in is the time slot of the current system, Is the Target Actor Actions during time slots, and They are and The network parameters, is the discount factor;
[0094] Then, based on Online Critic Output and Target Critic The estimated value of gets the loss function:
[0095]
[0096] in Represents the temporal difference, and then updates the parameters according to the minimization loss function, and supervised learning is performed by finding the gradient of the mean square error loss function;
[0097] Finally, the Online Critic network implements the Critic network parameter update according to the gradient rule of the neural network:
[0098] -
[0099] in is the learning rate of the Online Critic network;
[0100] Update the Actor network using the policy gradient method:
[0101]
[0102] Then the parameters of the Online Actor network are updated as follows:
[0103]
[0104] in is the online learning rate;
[0105] For the reinforcement learning algorithm, the Target network parameters are updated once every set number of steps, and a soft update method is used to prevent unstable convergence. The Target network parameter update method is as follows:
[0106]
[0107] The Online Actor network and the Online Critic network are continuously updated until the preset values are reached. At the same time, they converge to the optimal strategy and use the converged strategy function network to obtain the optimal task offloading strategy.
[0108] Furthermore, the step 7 specifically includes:
[0109] Step 71: Execute task unloading according to the optimal strategy, and collect the results after task unloading;
[0110] Step 72: Record the policy execution status through the feedback of the unloading result, evaluate the performance of the scheduling unloading policy, and record it in the case knowledge base to form a performance evaluation module;
[0111] Step 73: Generate an evaluation result according to the performance evaluation module to implement task scheduling.
[0112] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art:
[0113] 1. Based on improving the YOLOv5 model into two categories: lightweight target detection model and complete target detection model, a joint scheduling scheme for image target detection task business needs and network resources is proposed; two categories are selected through the scheduling scheme to perform computational offloading.
[0114] 2. By optimizing the decision variables and network resource consumption ratio based on a chemical reaction optimization algorithm (CRO), when the unloading decision variables are known, under the constraints of the device bandwidth ratio and the allocation resource calculation ratio, a convex problem on the optimization of the total cost is constructed. By optimizing the allocation of each variable, the computational complexity is reduced and the target total cost is minimized.
[0115] 3. Through the study of the joint offloading and resource allocation problem for image target detection tasks, a) the total cost considering network resources and local energy consumption; b) the total delay violation penalty; c) the total task completion penalty are minimized. The problem is formulated as a Markov decision process (MDP), and a reinforcement learning solution is proposed by making the discrete action space continuous and standardized. It overcomes the shortcomings of deep reinforcement learning algorithms such as unstable convergence and failure to converge to the optimal value under dynamic input variables and dynamic bandwidth environments, and can effectively support the task decision-making of edge devices for the computational offloading behavior of tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0116] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0117] Figure 1 It is an execution flow chart of a network state adaptive target detection computing task offloading scheduling method provided by an embodiment of the present invention.
[0118] Figure 2 It is a graphical schematic diagram of the operation operators of the chemical reaction optimization algorithm of the present invention.
[0119] Figure 3 It is a module diagram of a network state adaptive target detection computing task offloading scheduling system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0120] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0121] Under the limitation of computing power and energy in traditional mobile edge computing system, taking into account the real-time bandwidth situation, computing mode of edge devices, bandwidth allocation ratio, detection status of target detection model, and minimizing task computing delay and improving service quality, the system uses environment perception, data augmentation, model training, target detection, task perception, decision training, performance evaluation module, and detection collection feedback to improve task processing efficiency and device maintainability. Based on the heuristic algorithm to optimize the target problem and use the improved reinforcement learning (RL) environment perception strategy, the system solves the computational complexity problem with the reinforcement learning algorithm, which has better convergence speed, faster stability and lower task computing time for task processing.
[0122] See also Figure 1 The present invention provides a method for offloading and scheduling target detection computing tasks in a network state adaptive manner, comprising the following steps:
[0123] Step 1: According to the task in the target detection scenario, the target information required for the task is obtained and preprocessed to obtain an image data set;
[0124] In this embodiment, the step 1 specifically includes:
[0125] Step 11: Determine the task requirements according to the task in the target detection scenario, including the type, range, and accuracy of target information required;
[0126] Step 12: Select the corresponding environmental perception device according to the task requirements, such as: select a camera device to capture different types of environmental data in the breeding area under the marginal livestock scene, such as images, distances, animal species, etc.;
[0127] Step 13: Use the environment sensing device to collect the target information required for the task and obtain the initial video file; the environment sensing device needs to be calibrated before collecting data to ensure its accuracy;
[0128] Step 14: Decompose the initial video file into multiple separate image frames through a video processing library (such as Opencv), each frame can be used as a time point of the video and as an input of the target detection framework; by preprocessing the video file with a large amount of data into individual image frames, the data can be amplified and used as the data set required by the target detection framework;
[0129] Step 15, by performing image scaling and color channel conversion on the image frame, the image frame is scaled to m*m (e.g., 640*640) pixels and the channel is in RGB format; by scaling the pixel value to a specific range (e.g., 0 to 1), normalization processing can be facilitated;
[0130] Step 16: Normalize each image frame to obtain multiple processed image frames as an image data set; normalization helps to reduce noise in the data, make the model easier to process, and optimize the performance of the model.
[0131] Step 2: training a preset target detection framework using the image data set to obtain a target detection model;
[0132] In this embodiment, step 2 specifically includes:
[0133] Step 21, dividing the image data set into a training set, a validation set and a test set according to a set ratio; for example, randomly dividing the large number of images obtained, specifically, into a training set, a validation set and a test set in a ratio of 8:1:1.
[0134] Step 22: Annotate the image frames in the training set, mark the location and category of the objects in the image frames, including the bounding box coordinates and the corresponding category labels, and provide the model with features that need to be learned;
[0135] Step 23: input the training set into a preset target detection framework, wherein the target detection framework includes a first YOLOv5s model without a MobileNetV3 module and a second YOLOv5s model with a MobileNetV3 module;
[0136] Step 24, the position and category of the object in the image frame are used as features to train the first YOLOv5s model and the second YOLOv5s model respectively, the trained first YOLOv5s model is used as a complete target detection model, and the trained second YOLOv5s model is used as a lightweight target detection model; the complete target detection model and the lightweight target detection model have the ability to identify the target object in the image, realize the input of a new image, and output the position and category information of the object in the image. Wherein, for the MobileNetV3 module, it is mounted on the local computing device as a lightweight target detection model. For the YOLOv5s model, by segmenting the model results, the head part is deployed on the local computing device, and the remaining part is mounted on the edge cloud server. The YOLOv5s model mounted on the local computing device and the edge cloud server is defined as a complete target detection model. For the lightweight target detection model, all computing tasks are calculated on the local computing device, while for the complete target detection model, the computing tasks are first preliminarily calculated on the local computing device, and the obtained intermediate data samples are unloaded on the edge cloud server, and the remaining processing is performed by the target detection model mounted on the edge cloud server.
[0137] Step 3: construct a synaesthesia-computing integrated task requirement model in a network consisting of multiple edge devices and an edge cloud server, and use the target detection model to map the synaesthesia-computing integrated task requirement model into an action space selection problem;
[0138] In this embodiment, step 3 specifically includes:
[0139] Step 31: Acquire external environment information through the task information provided by the client and the task perception module, and establish a task requirement model integrating synaesthesia and computing based on the physical information fusion system between multiple edge devices and multiple detection tasks in the edge scene according to the external environment information;
[0140] Step 32: The task offloading requirements, energy consumption requirements, bandwidth between the edge cloud server and the edge device, computing power of the local computing device, and detection results of each image frame obtained by using the complete target detection model and the lightweight target detection model are used as attributes to form a system state, and the resource scheduling target of the system is obtained;
[0141] Step 33: Perform local computing or computing offloading on computing tasks generated by multiple edge devices according to the resource scheduling target of the system, so as to coordinate task offloading decisions and resource allocation between each edge device;
[0142] Step 34: By combining the time slot requirements, energy consumption requirements and task offloading computing requirements of each edge device in the edge scenario, an optimization problem is proposed with the goal of minimizing the task completion delay under the constraints of the integrated energy consumption and service requirements of the synergy computing, and then the synergy computing integrated task requirement model is mapped into a non-convex, real-time dynamic and discrete action space selection problem;
[0143] Step 35: The edge device and the edge cloud server are connected through a wireless access point AP to form a network.
[0144] In the best solution, steps 31 to 35 specifically include:
[0145] In the task requirement model of integrated synaesthesia and computing, both edge devices and edge cloud servers have target detection functions; lightweight target detection models are deployed on edge devices in a local computing manner. At this time, all grouping modules All are executed in the local computing device; the edge device and the edge cloud server jointly carry the complete target detection model in the form of computational offloading, that is, the intermediate data samples of the complete target detection model in the local computing device are obtained through block processing, and the intermediate data samples are offloaded to the edge cloud server for the next step of calculation. By determining different grouping modules, part of the grouping modules Calculated on the edge cloud server, the remaining grouping modules will be executed on the local computing device;
[0146] In duration In the time slot system, let the integer is the time slot index and ≥1; for edge device set Any edge device in ,in, Represents the edge device set The upper limit of the number of devices in the time slot When a task is initiated, use represents the task completion time, and the number of time slots is recorded as , Indicates the result is rounded; for this task, multiple input data samples can be generated in the edge device; the task is first executed on the local computing device, and the service quality is met by computing offloading; suppose Indicates time slot At the initial task execution state, Representing edge devices In time slot The number of data sets that have executed tasks at the time; Is an edge device set A list of action state sets, representing time slots The unloading decision vector, where the elements As the element at the corresponding position in the list, the value is a non-negative integer;
[0147] when =0, it means The edge device does not uninstall, executes the lightweight target detection model on the local computing device, and records the execution status. ;when >0 and the number of target images detected after executing the lightweight target detection model is greater than or equal to the uninstall decision variable , it means that the edge device will uninstall intermediate data samples to the edge cloud server, ;when >0 and the number of target images detected after executing the lightweight target detection model is less than the uninstall decision variable When executing the lightweight target detection model on the local computing device, ; On edge devices When performing lightweight target detection calculations at the edge, a detection result is obtained locally, otherwise the intermediate data samples are sent from the edge device The local cache is offloaded to the edge cloud server to perform complete target detection calculations and generate one or more complete target detection results;
[0148] Consider in the lightweight target detection model and the complete target detection model, let Indicates The number of CPU cycles required for layer calculation, where is the number of CPU cycles budgeted for a floating point, The first The number of output data of each module, represents the number of floating-point operations required to compute one output data element; assuming and Represents edge devices and the CPU frequency of the edge cloud server, let Indicates that the lightweight target detection model is The computational latency of local computation on an edge device is:
[0149]
[0150] in, is the collection of all edge devices;
[0151] For Complete object detection model grouping module for edge devices The local computation delay is:
[0152]
[0153] Edge devices The local computational energy consumption of the lightweight object detection model on If it means:
[0154]
[0155] Similarly, edge devices The local computational energy consumption of the partially complete object detection model on It is expressed as:
[0156]
[0157] in, For edge devices Energy efficiency coefficient; For the complete target detection model, each edge device is assigned a virtual CPU on the edge cloud server, and it is assumed that the computing resources on the edge cloud server are sufficient and the frequency of the virtual CPU allocated to each edge device is constant; Let Indicates the device In time slot During the complete target detection grouping module The calculation delay is:
[0158]
[0159] Among them, , For any time slot, the target detection calculation of the task samples to be processed in each edge device is completed within one time slot;
[0160] make Indicates the data size in the middle layer module (in bits), where Represents the number of floating point digits in the output data. Represents the intermediate layer module of target detection, is the number of data elements output by the middle layer module; considering the edge device and the total radio spectrum bandwidth is The uplink wireless transmission between access points AP adopts Orthogonal Frequency Division Multiple Access (OFDMA);
[0161] Assumptions Indicates time slot The bandwidth allocation decision vector during the period, express 'dimensional real number set, element Indicates that it is assigned to edge devices The bandwidth ratio is obtained in the time slot During this period, an intermediate data sample is sent from the edge device The local cache is offloaded to the edge cloud server through the access point AP
[0162] The transmission delay of express:
[0163]
[0164] in, is a constant and 0< <1*10 -5 , For edge devices The transmission power, For edge devices With access point The constant transmit power gain of the uplink between is the noise power and the bandwidth used is , assuming the constant
[0165] ;
[0166] Since the data volume is small, the downlink latency of transmitting the complete inference results back to the edge device is ignored. To the contact Unload an intermediate data sample in the time slot The transmission energy loss during this period is recorded as:
[0167]
[0168] Will Defined as time slot The network resource consumption ratio during the period, and it is Continuous decision making in
[0169] Variable, expressed as time slots The upper limit of the ratio of total transmission and edge computing resource usage during the period, namely:
[0170]
[0171] make , indicating the corresponding time slot is an auxiliary binary decision variable set in , where Indicates that at least one intermediate data sample is received from the edge device Uninstall in surface
[0172] No intermediate data samples are sent from the edge device Uninstall in
[0173] make Representing edge devices In time slot The local energy consumption at this time is:
[0174]
[0175] Time slot The total cost is recorded as , which is expressed as the linear weighted sum of the local total energy consumption of all edge devices and the network resource consumption ratio, and the weight is recorded as ,but:
[0176]
[0177] By perceiving the system status, the limited system resources are effectively utilized, and the optimization problem is proposed with the goal of minimizing the task completion delay under the energy consumption constraint of integrated synaesthesia and computing.
[0178] Step 4: Preliminarily simplify the action space selection problem;
[0179] In this embodiment, step 4 specifically includes:
[0180] The chemical reaction optimization algorithm is used to optimize the existing decision variables in a limited action space. and network resource consumption ratio Perform preliminary calculations; the chemical reaction optimization algorithm steps are as follows:
[0181] In the chemical reaction optimization algorithm, three property states are defined for the molecule: molecular structure S, molecular potential energy PE and molecular kinetic energy KE. The molecular structure S represents a solution space of the task offloading strategy. The molecular potential energy PE represents the stability of the molecular structure and is defined as the value of the objective function. The molecular kinetic energy KE makes the molecular potential energy tend to a higher state to avoid the objective function value entering local convergence too early. The value is defined as the fitness function;
[0182] By using the defined solution form as an operation operator, the basic molecular operations in chemical reactions are simulated. Four basic operation operators are defined, namely, single molecule collision, single molecule decomposition, intermolecular collision and molecular synthesis. Each molecular structure after the problem encoding represents a solution strategy. Through different molecular basic operations, the molecular structure changes and the fitness obtained is different. Single molecule collision and intermolecular collision have little effect on the original molecular structure, indicating that it is hoped that the solution range can be explored in the adjacent solution space. Single molecule decomposition and molecular synthesis provide a larger solution space to avoid being limited to the local solution space too early and causing local convergence. For specific operator calculations in the example, please refer to Figure 2 .
[0183] By encoding the resource allocation sub-problem, each decision variable is simulated using a molecular structure composed of 0 and 1 sequences. and network resource consumption ratio The combination form, and then according to the operator operation, find the minimum cost corresponding to and ;
[0184] The optimal solution and Substituting into the formula: After that, Convert to .
[0185] By and network resource consumption ratio Solving the problem in advance can reduce the complexity of the problem.
[0186] Step 5: Convert the action space selection problem into a partially observable Markov decision process according to the state vector of the edge device;
[0187] In this embodiment, step 5 specifically includes:
[0188] Step 51, normalize the state vector of the edge device, and use the state normalization algorithm to pre-process the observed state, which can solve the problem of order of magnitude difference of state variables and improve training efficiency. In particular, due to the number of time slots, the cache state changes dynamically. In particular, this example designs an observation module, which will pre-record the maximum value between the observed input vectors in real time for updating, so as to facilitate normalization; the state vector includes the number of time slots, the device cache state, the device cumulative confidence level and the device real-time network bandwidth, wherein the device cumulative confidence level is obtained by detecting the image with a lightweight target detection model and a complete target detection model, and then the detection result is processed by the cumulative confidence module to obtain the cumulative confidence of the device as the device cumulative confidence level;
[0189] Step 52: Convert the action space problem into a partially observable Markov decision process according to the state vector of the edge device, and record and update the maximum value between the state vectors in real time.
[0190] In the best solution, the steps 51 to 52 include:
[0191] (1) Definition The state vector of a time slot: ,in Representing edge devices In time slot The number of datasets that executed the lightweight target detection model when For each edge device The cumulative confidence level of is the number of time slots, The real-time available network bandwidth;
[0192] The difference between the maximum and minimum values of each variable recorded under preprocessing is used as the scaling factor: , and ,in is a scaling factor for the number of datasets that implement a lightweight object detection model, Each edge device Cumulative confidence level scaling factor is the time slot scaling factor, Represents the scaling factor of the real-time bandwidth; through division operation, it is realized Normalization of
[0193] (2) Define the system action space: time slot The motion vector ,in represents the entire action space; let Representation and Status The relevant subspace of possible actions, including the state Satisfaction All actions of the constraint, time slot The action should satisfy ;
[0194] Project discrete actions into continuous actions through the action domain to meet the reinforcement learning algorithm's processing requirements for continuous actions;
[0195] (3) Define the system reward function to minimize the total delay violation penalty of all edge devices and minimize the total cost for each time slot. Rewards It is expressed as:
[0196] -
[0197] in, is a positive weight, is the minimum cost of solving the resource allocation subproblem, Yes Equipment In time slot Delayed violation penalty at the end of the Each edge device is currently The task completion penalty between the moment confidence and the final confidence.
[0198] Step 6: Based on the environment-aware reinforcement learning algorithm, perform integrated task scheduling and learn the state vector of Markov decision making to obtain the optimal resource allocation strategy for edge devices to meet business needs in different environments; the purpose of this step is to train Markov decision making.
[0199] In this embodiment, step 6 specifically includes:
[0200] The reinforcement learning algorithm based on environment perception is a Markov decision process decision module that performs synaesthesia-computing integrated task offloading decision in uncertain network states and detection scenarios; the reinforcement learning algorithm uses the Actor-Critic algorithm as the basic framework of the algorithm, adopts a deep neural network as an approximation of the policy network and the action network, and uses a stochastic gradient algorithm to train the parameters in the policy network and value network model;
[0201] In the reinforcement learning algorithm, a dual neural network model architecture is used for both the strategy function and the value function, including Online and Target, in which the Online Critic needs to be defined. Responsible for updating iterative parameters and calculate the current state-action Value, where Defining Target Critic Used to approximate the state-action of the next moment Value; defines the Online Actor Responsible for network parameters Iterative update, and select the current action according to the current input state , used to generate new states and rewards with the environment , and Target Actor Based on the experience replay pool constructed The next state sampled in Choose the best action ; At the beginning of training, clear the experience replay pool D and randomly initialize parameters ;
[0202] At the beginning of the reinforcement learning algorithm, from the time slot k At the beginning, the system's agent observes the current state of the environment And according to Greedy strategy, The probability of passing The action to take when getting this status ;for Greedy strategy, The probability of Randomly select an action; for The value is taken from the minimum to 1, as the agent continues to observe, The exploration probability is decreasing, and the attenuation factor , a smooth transition from exploration probability to exploitation probability;
[0203] Add some random noise to the actions of the reinforcement learning algorithm , this is to further increase the randomness of learning and increase the coverage of learning; The network calculates the current state action and obtains:
[0204]
[0205] in, Indicates the current state of the environment The action below;
[0206] Run the reinforcement learning algorithm to interact with the state and the smart IoT environment. When the edge device starts a new set of target detection tasks, the event starts, and when the confidence of the last edge device meets the threshold requirement, the entire event ends. At the beginning of each event, the state of the reinforcement learning is initialized to ; If all tasks are completed within the specified deadline, that is, the total number of time slots of the event is less than , in which case there is no delay violation penalty; when the total time slot of the event is greater than When there is a delay violation penalty; a binary flag Indicates time slot Is it the last time period of the event? , it means that the event is in the time slot The process ends at the state where the completion signal is generated;
[0207] Then, the system notifies each edge device of the new offloading decision based on the obtained action, in the time slot At the end, the agent calculates the execution action Rewards , and observe the new state , and the new cumulative confidence level is calculated by the cumulative target detection scheme on each edge device Update, new cache status is based on The constraints are updated and the completion signal In time slot A check is performed at the end of t to determine the termination of the event. The signaling overhead between the reinforcement learning agent and the device is negligible because the data size of the signaling is small compared to the task data size.
[0208] Then, the new transition segment The experience memory added to the reinforcement learning algorithm is used to further calculate the current goal. Value, sample N experiences from the experience memory, so the estimated value of Target Critic is expressed as:
[0209]
[0210] in is the time slot of the current system, Is the Target Actor Actions during time slots, and They are and The network parameters, is the discount factor;
[0211] Then, based on Online Critic Output and Target Critic The estimated value of gets the loss function:
[0212]
[0213] in represents the timing difference error (TD-error), and then updates the parameters according to the minimization loss function, and supervises the learning by taking the gradient of the mean-squared error loss (MES) function;
[0214] Finally, the Online Critic network implements the Critic network parameter update according to the gradient rule of the neural network:
[0215] -
[0216] in is the learning rate of the Online Critic network;
[0217] Update the Actor network using the policy gradient method:
[0218] , then the parameters of the Online Actor network are updated as follows:
[0219]
[0220] in is the online learning rate;
[0221] For the reinforcement learning algorithm, the Target network parameters are updated once every set number of steps, and a soft update method is used to prevent unstable convergence. The Target network parameter update method is as follows:
[0222]
[0223] The Online Actor network and the Online Critic network are continuously updated until the preset values are reached. At the same time, they converge to the optimal strategy and use the converged strategy function network to obtain the optimal task offloading strategy.
[0224] Step 7: Execute task offloading according to the optimal strategy, and evaluate the performance of the scheduling offloading strategy according to the offloading result to implement the scheduling of the task.
[0225] In this embodiment, step 7 specifically includes:
[0226] Step 71: Execute task unloading according to the optimal strategy, and collect the results after task unloading;
[0227] Step 72: Through the feedback of the unloading results, record the execution of the strategy, evaluate the performance of the scheduling unloading strategy, and record it in the case knowledge base to form a performance evaluation module; specifically: by analyzing the execution of the strategy, record whether there are any abnormal conditions in the execution of the strategy, and record the abnormal conditions in the abnormal status storage area of the case knowledge base for easy updating and correction; clarify the specific content and expected goals of the strategy, and formulate specific execution indicators based on the content of the strategy. These indicators can quantify the execution of the strategy and generate corresponding evaluation functions. According to the unloading results and environmental conditions, the case knowledge base automatically calls out the corresponding evaluation function to score the obtained unloading strategy. The environmental conditions include recording various parameters, execution time, and resource usage of the strategy execution; according to the evaluation results, optimize the part with poor performance, and record the entire process in the case knowledge base;
[0228] Step 73: Generate an evaluation result according to the performance evaluation module to implement task scheduling.
[0229] like Figure 3 As shown, based on the same inventive concept, the present invention also proposes a network state adaptive target detection computing task offloading scheduling system, comprising:
[0230] Environmental perception module: Obtain the target information required for the task by using environmental perception devices, such as the need to clarify the specific requirements of the task, including the type, range, and accuracy of the target information to be obtained. According to the requirements of the task, select the appropriate environmental perception device. In this example, select the camera device to capture different types of environmental data in the breeding area under the marginal livestock scene, such as images, distances, animal species, etc. Count and calibrate the environmental perception device, start collecting environmental data, and obtain the initial video file.
[0231] Data augmentation module: The video file is decomposed into individual image frames through a video processing library (such as Opencv). Each frame can be used as a time point in the video and as the input of the target detection algorithm. The image is scaled to 640*640 pixels and the channels are in RGB format by image scaling and color channel conversion. In order to optimize the performance of the model, it is usually necessary to normalize the image data. This can be achieved by scaling the pixel values to a specific range (such as 0 to 1). Normalization helps reduce noise in the data and makes the model easier to process. The large number of images obtained are randomly divided into training sets, validation sets, and detection sets in a ratio of 8:1:1.
[0232] Task perception module: used to perceive various environmental variables required for the task through the needs of the task end, such as using multiple sensors, such as lidar, camera and millimeter wave radar, to collect data on the surrounding environment. Provide input vectors for subsequent decision training modules;
[0233] Decision training module: used to implement training and optimization of specific decision tasks. It usually combines machine learning, deep learning and other technologies to improve the performance and accuracy of the decision system. In this example, it mainly consists of reinforcement learning algorithms;
[0234] Model training module: used to execute the target detection model improved based on the training set training to obtain the trained target detection model.
[0235] Object detection module: used to obtain the image to be detected and input the trained object detection model to output the prediction result.
[0236] Decision training module: used to execute the required reinforcement learning training model, obtain the trained reinforcement learning model, and output the decision of the task. In this example, the target detection module, the task perception module and the decision training module transfer data to each other. The task perception module and the target detection module serve as the environment part of the reinforcement learning in the decision training module, and propose the required input vectors. The decision generated in the decision training module in turn affects the output results in the target detection module.
[0237] Performance evaluation module: The target detection module performs task unloading and generates the detected data according to the optimal strategy. By analyzing the strategy execution, it records whether there are any abnormal conditions in the strategy execution, and records the abnormal conditions in the abnormal state area of the case knowledge base for easy update and correction.
[0238] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A network state adaptive target detection computing task offloading scheduling method, characterized in that: The steps include: Step 1: According to the task in the target detection scenario, the target information required for the task is obtained and preprocessed to obtain an image dataset; specifically, the following steps are included: Step 11: Determine the task requirements based on the tasks in the target detection scenario; Step 12: Select the corresponding environment perception device according to the task requirements; Step 13: Use the environment perception device to collect the target information required for the task and obtain the initial video file; Step 14: Decomposing the initial video file into a plurality of separate image frames through a video processing library; Step 15, by performing image scaling and color channel conversion on the image frame, the image frame is scaled to m*m pixels and the channel is in RGB format; m*m is set to 640*640; Step 16: normalize each image frame to obtain a plurality of processed image frames as an image data set; Step 2: training a preset target detection framework using the image data set to obtain a target detection model; specifically comprising: Step 21, dividing the image data set into a training set, a validation set and a test set according to a set ratio; Step 22: annotate the image frames in the training set, marking the positions and categories of the objects in the image frames; Step 23: input the training set into a preset target detection framework, wherein the target detection framework includes a first YOLOv5s model without a MobileNetV3 module and a second YOLOv5s model with a MobileNetV3 module; Step 24, using the position and category of the object in the image frame as features to train the first YOLOv5s model and the second YOLOv5s model respectively, the trained first YOLOv5s model is used as a complete target detection model, and the trained second YOLOv5s model is used as a lightweight target detection model; the complete target detection model and the lightweight target detection model have the ability to identify the target object in the image, realize input of a new image, and output the position and category information of the object in the image; Step 3: Build a synergy computing system in a network consisting of multiple edge devices and edge cloud servers The target detection model is used to map the task requirement model of the integrated synaesthesia computing into an action space selection problem; specifically, the following steps are involved: Step 31: Acquire external environment information through the task information provided by the client and the task perception module, and establish a task requirement model integrating synaesthesia and computing based on the physical information fusion system between multiple edge devices and multiple detection tasks in the edge scene according to the external environment information; Step 32: The task offloading requirements, energy consumption requirements, bandwidth between the edge cloud server and the edge device, computing power of the local computing device, and detection results of each image frame obtained by using the complete target detection model and the lightweight target detection model are used as attributes to form a system state, and the resource scheduling target of the system is obtained; Step 33: Perform local computing or computing offloading on computing tasks generated by multiple edge devices according to the resource scheduling target of the system, so as to coordinate task offloading decisions and resource allocation between each edge device; Step 34: By combining the time slot requirements, energy consumption requirements and task offloading computing requirements of each edge device in the edge scenario, an optimization problem is proposed with the goal of minimizing the task completion delay under the constraints of the integrated energy consumption and service requirements of the synergy computing, and then the synergy computing integrated task requirement model is mapped into a non-convex, real-time dynamic and discrete action space selection problem; Step 35: The edge device and the edge cloud server are connected through a wireless access point AP to form a network; The steps 31 to 35 specifically include: In the task requirement model of integrated synaesthesia and computing, both edge devices and edge cloud servers have target detection functions; lightweight target detection models are deployed on edge devices in a local computing manner. At this time, all grouping modules All are executed in the local computing device; the edge device and the edge cloud server jointly carry the complete target detection model in the form of computational offloading, that is, the intermediate data samples of the complete target detection model in the local computing device are obtained through block processing, and the intermediate data samples are offloaded to the edge cloud server for the next step of calculation. By determining different grouping modules, part of the grouping modules Calculated on the edge cloud server, the remaining grouping modules will be executed on the local computing device; In duration In the time slot system, let the integer is the time slot index and ≥1; for edge device set Any edge device in ,in, Represents the edge device set The upper limit of the number of devices is set at When a task is initiated, use represents the task completion time, and the number of time slots is recorded as , Indicates the result is rounded; first execute the task on the local computing device, and assist in meeting the service quality through computing offloading; set Indicates During the time slot, the task execution state at the initial time is Representing edge devices In the The number of data sets of tasks that have been executed during the time slot; Is an edge device set The action state set list represents the The unloading decision vector during the time slots, where the elements As the element at the corresponding position in the list, the value is a non-negative integer; when =0, it means The edge device does not uninstall, executes the lightweight target detection model on the local computing device, and records the execution status. ;when >0 and the number of target images detected after executing the lightweight target detection model is greater than or equal to the uninstall decision variable , it means that the edge device will uninstall intermediate data samples to the edge cloud server, ;when >0 and the number of target images detected after executing the lightweight target detection model is less than the uninstall decision variable When executing the lightweight target detection model on the local computing device, ; On edge devices When performing lightweight target detection calculations at the edge, a detection result is obtained locally, otherwise the intermediate data samples are sent from the edge device The local cache is offloaded to the edge cloud server to perform complete target detection calculations and generate one or more complete target detection results; Consider in the lightweight target detection model and the complete target detection model, let Indicates The number of CPU cycles required for layer calculation, where is the number of CPU cycles budgeted for a floating point, The first The number of output data of each module, represents the number of floating-point operations required to compute one output data element; assuming and Represents edge devices and the CPU frequency of the edge cloud server, let Indicates that the lightweight target detection model is The computational latency of local computation on an edge device is: in, is the collection of all edge devices; For Complete object detection model grouping module for edge devices The local computation delay is: Edge Devices The local computational energy consumption of the lightweight object detection model on If it means: Similarly, edge devices The local computational energy consumption of the partially complete object detection model on It is expressed as: in, For edge devices Energy efficiency coefficient; For the complete target detection model, each edge device is assigned a virtual CPU on the edge cloud server, and it is assumed that the computing resources on the edge cloud server are sufficient and the frequency of the virtual CPU allocated to each edge device is constant; Let Indicates the device In the Complete target detection grouping module during each time slot The calculation delay is: Among them, , so that in each edge device, the target detection calculation of the task samples to be processed is completed within one time slot; make Indicates the data size in the middle-layer module, where Represents the number of floating point digits in the output data. Represents the intermediate layer module of target detection, is the number of data elements output by the middle layer module; considering the edge device and the total radio spectrum bandwidth is The uplink wireless transmission between access points AP adopts orthogonal frequency division multiple access; Assumptions Indicates The bandwidth allocation decision vector during the time slot is express 'dimensional real number set, element Indicates that it is assigned to edge devices The bandwidth ratio is obtained in During a time slot, an intermediate data sample is sent from the edge device The local cache is offloaded to the edge cloud server through the access point AP to reduce the transmission delay. express: in, is a constant and 0< <1*10 -5 , For edge devices The transmission power, For edge devices With access point The constant transmit power gain of the uplink between is the noise power and the bandwidth used is , assuming the constant ; Ignoring the downlink latency of transmitting the complete inference results back to the edge device, To the contact Unload an intermediate data sample at The transmission energy loss during a time slot is recorded as: Will Defined as The network resource consumption ratio during the time slot is Continuous decision The policy variable is expressed as The upper limit of the ratio of total transmission and edge computing resource usage during a time slot is: make , indicating the corresponding An auxiliary binary decision variable set during time slots, where Indicates that at least one intermediate data sample is received from the edge device Uninstall in Indicates that there are no intermediate data samples from edge devices Uninstall in make Representing edge devices In the The local energy consumption during the time slot is obtained as follows: The first The total cost during the time slot is recorded as , which is expressed as the linear weighted sum of the local total energy consumption of all edge devices and the network resource consumption ratio, and the weight is recorded as ,but: By perceiving the system status, the limited system resources are effectively utilized, and the optimization problem is proposed with the goal of minimizing the task completion delay under the energy consumption constraint of the integrated sensing and computing. Step 4: Preliminarily simplify the action space selection problem; Step 5: Convert the action space selection problem into a partially observable Markov decision process according to the state vector of the edge device; Step 6: Based on the environment-aware reinforcement learning algorithm, perform task scheduling processing based on synaesthesia and computing, learn the state vector of Markov decision-making, and obtain the optimal resource allocation strategy for edge devices to meet business needs in different environments; Step 7: Execute task offloading according to the optimal strategy, and evaluate the performance of the scheduling offloading strategy according to the offloading result to implement the scheduling of the task.
2. A method for offloading and scheduling target detection computing tasks based on network state self-adaptation according to claim 1, characterized in that: The step 4 specifically includes: The chemical reaction optimization algorithm is used to optimize the existing decision variables in a limited action space. and network resource consumption ratio Perform preliminary calculations; the chemical reaction optimization algorithm steps are as follows: In the chemical reaction optimization algorithm, three attribute states are defined for the molecule: molecular structure S, molecular potential energy PE and molecular kinetic energy KE. The molecular structure S represents a solution space of the task offloading strategy. The molecular potential energy PE represents the stability of the molecular structure and is defined as the value of the objective function. The molecular kinetic energy KE makes the molecular potential energy tend to a higher state and converts the required The value is defined as the fitness function; By using the defined solution form as an operation operator, the basic molecular operations in chemical reactions are simulated. Four basic operation operators are defined, namely, single molecule collision, single molecule decomposition, intermolecular collision and molecular synthesis. Each molecular structure after the problem encoding represents a solution strategy. Through different molecular basic operations, the structure between molecules changes, and the fitness obtained is different. By encoding the resource allocation sub-problem, each decision variable is simulated using a molecular structure composed of 0 and 1 sequences. and network resource consumption ratio The combination form, and then according to the operator operation, find the minimum cost corresponding to and ; The optimal solution and Substituting into the formula: After that, Convert to , is the minimum cost of solving the resource allocation subproblem.
3. A method for offloading and scheduling target detection computing tasks based on network state self-adaptation according to claim 2, characterized in that: The step 5 specifically includes: Step 51: normalize the state vector of the edge device and pre-process the observed state using a state normalization algorithm; the state vector includes the number of time slots, the device cache state, the device cumulative confidence level and the device real-time network bandwidth, wherein the device cumulative confidence level is obtained by detecting the image using a lightweight target detection model and a complete target detection model, and then the detection result is processed by a cumulative confidence module to obtain the cumulative confidence of the device as the device cumulative confidence level; Step 52: Convert the action space problem into a partially observable Markov decision process according to the state vector of the edge device, and record and update the maximum value between the state vectors in real time.
4. A method for offloading and scheduling target detection computing tasks based on network state self-adaptation according to claim 3, characterized in that: The steps 51 to 52 include: (1) Definition The state vector during a time slot: ,in Representing edge devices In the The number of datasets in which the lightweight object detection model was executed during the time slots, For each edge device The cumulative confidence level of The real-time available network bandwidth; The difference between the maximum and minimum values of each variable recorded under preprocessing is used as the scaling factor: , and ,in is a scaling factor for the number of datasets that implement a lightweight object detection model, Each edge device Cumulative confidence level scaling factor is the time slot scaling factor, Represents the scaling factor of the real-time bandwidth; through division operation, it is realized Normalization of (2) Define the system action space: The action vector during the time slot ,in represents the entire action space; let Representation and Status The relevant subspace of possible actions, including the state Satisfaction All actions constrained, The actions during the time slot should satisfy ; Project discrete actions into continuous actions through the action domain to meet the reinforcement learning algorithm's processing requirements for continuous actions; (3) Define the system reward function to minimize the total delay violation penalty of all edge devices while minimizing the total cost. Rewards during time slots It is expressed as: - in, is a positive weight, Yes Equipment In the The penalty for late violation at the end of the time slot period is Each edge device is currently The task completion penalty between the confidence during each time slot and the final confidence.
5. A method for offloading and scheduling target detection computing tasks based on network state self-adaptation according to claim 4, characterized in that: The step 6 specifically includes: The reinforcement learning algorithm based on environment perception is a Markov decision process decision module that performs synaesthesia-computing integrated task offloading decision in uncertain network states and detection scenarios; the reinforcement learning algorithm uses the Actor-Critic algorithm as the basic framework of the algorithm, adopts a deep neural network as an approximation of the policy network and the action network, and uses a stochastic gradient algorithm to train the parameters in the policy network and value network model; In the reinforcement learning algorithm, a dual neural network model architecture is used for both the strategy function and the value function, including Online and Target, in which the Online Critic needs to be defined. Responsible for updating iterative parameters and calculate the current state-action value, Defining Target Critic Used to approximate the state-action of the next moment Value; defines the Online Actor Responsible for network parameters Iterative update and select action according to the current input state , used to generate new states and rewards with the environment , and Target Actor Based on the experience replay pool constructed The next state sampled in Choose the best action ; At the beginning of training, clear the experience replay pool D and randomly initialize parameters ; At the beginning of the reinforcement learning algorithm, At the beginning of each time slot, the system’s intelligent agent observes the current state of the environment. And according to Greedy strategy, The probability of passing The action to take when this status is obtained ;for Greedy strategy, The probability of Randomly select an action; for The value is taken from the minimum to 1, as the agent continues to observe, The exploration probability is decreasing, and the attenuation factor ; Add some random noise to the actions of the reinforcement learning algorithm ,in The network calculates the current state action and obtains: in, Indicates the current environment status The action below; Run the reinforcement learning algorithm to interact with the state and the smart IoT environment. When the edge device starts a new set of target detection tasks, the event starts, and when the confidence of the last edge device meets the threshold requirement, the entire event ends. At the beginning of each event, the state of the reinforcement learning is initialized to ; If all tasks are completed within the specified deadline, that is, the total number of time slots of the event is less than , in which case there is no delay violation penalty; when the total time slot of the event is greater than When there is a delay violation penalty; a binary flag Indicated in Is the time slot the last time slot of the event? , it means that the event is in The time slot period ends and a completion signal is generated in the environment state; Then, the system notifies each edge device of the new offloading decision based on the obtained action. At the end of the time slot, the agent calculates the execution action Rewards , and observe the new state , and the new cumulative confidence level is calculated by the cumulative target detection scheme on each edge device Update, new cache status is based on The constraints are updated and the completion signal In the A check is performed at the end of each time slot period to determine the termination of the event; Then, the new transition segment The experience memory added to the reinforcement learning algorithm and N experiences are sampled from the experience memory, so the estimated value of Target Critic is expressed as: in, The Target Actor is The actions during the time slots, and They are and The network parameters, is the discount factor; Then, based on Online Critic Output and Target Critic The estimated value of gets the loss function: in Represents the temporal difference, and then updates the parameters according to the minimization loss function, and supervised learning is performed by finding the gradient of the mean square error loss function; Finally, the Online Critic network implements the Critic network parameter update according to the gradient rule of the neural network: - in is the learning rate of the Online Critic network; Update the Actor network using the policy gradient method: Then the parameters of the Online Actor network are updated as follows: in is the online learning rate; For the reinforcement learning algorithm, the Target network parameters are updated once every set number of steps, and a soft update method is used to prevent unstable convergence. The Target network parameter update method is as follows: The Online Actor network and the Online Critic network are continuously updated until the preset values are reached. At the same time, they converge to the optimal strategy and use the converged strategy function network to obtain the optimal task offloading strategy.
6. A method for offloading and scheduling target detection computing tasks based on network state self-adaptation according to claim 1, characterized in that: The step 7 specifically includes: Step 71: Execute task unloading according to the optimal strategy, and collect the results after task unloading; Step 72: Record the policy execution status through the feedback of the unloading result, evaluate the performance of the scheduling unloading policy, and record it in the case knowledge base to form a performance evaluation module; Step 73: Generate an evaluation result according to the performance evaluation module to implement task scheduling.
Citation Information
Patent Citations
Task scheduling method based on multi-agent auxiliary edge cloud server
CN116974751A
Resource scheduling method for optimizing edge energy consumption and load based on reinforcement learning
CN117194057A
