A smart warehousing task offloading method based on mobile edge computing
Through the Markov decision-making method of the multi-pointer attention model, intelligent prioritization and resource allocation solve the priority and resource heterogeneity problems in the task offloading strategy in the intelligent warehousing system, achieving efficient processing of computing tasks and resource allocation. Balanced, reducing delays and waste.
Patent Information
- Application Number
- CN202410808906.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-06-21
AI Technical Summary
In intelligent warehousing systems, existing task offloading strategies fail to fully consider task priorities and resource heterogeneity, resulting in computing task delays and resource waste, and fail to effectively handle dependencies between tasks, affecting edge servers and cloud Server computing resource balancing.
Using the Markov decision-making method based on the multi-pointer attention model, through task selection agents and offloading decision-making agents, real-time prioritization and resource allocation, edge server computing resources are dynamically scheduled, and appropriate computing nodes (edge servers or clouds) are selected. server) to reduce task timeouts.
It achieves efficient offloading of computing tasks, reduces task timeouts, improves system efficiency, balances the use of computing resources between edge servers and cloud servers, and ensures priority processing of important and urgent tasks.
Smart Images

Figure CN118377556B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent warehousing technology, and in particular to an intelligent warehousing task unloading method based on mobile edge computing. Background Art
[0002] Smart logistics is a key link between product manufacturing terminals and customers, involving warehousing, transportation, distribution and other links. The intelligent warehousing system is one of the important components of smart logistics. The "goods to person" picking system with mobile robots as the core provides a new solution for traditional warehousing. Since its concept was proposed, it has been the focus of attention in the industry and academia. Terminal devices are deployed along the assembly line to perceive the surrounding environment and use the edge and cloud to assist in making real-time response decisions on production processes or facilities. Setting a reasonable task scheduling strategy for terminal devices can give full play to the execution capabilities of each terminal device and improve system efficiency. Especially in warehousing scenarios, the task volume is usually large, and the timeliness of computing tasks is usually required to be high. Therefore, task scheduling is particularly important.
[0003] As a typical example of intelligent IoT system, intelligent warehousing system has a large number of terminal devices. Therefore, IoT technology has driven the possibility of eliminating the need for manpower in the entire logistics process from warehouse to transportation of products, making the entire logistics process more and more efficient and intelligent. Traditional cloud computing systems are managed in a centralized manner and require a large amount of computing resources to bear the computing tasks of thousands of terminal devices in intelligent warehousing. Therefore, the tasks may have a high latency. Mobile edge computing environment has been widely used due to its advantages such as low latency, distribution, and location awareness. However, compared with cloud computing, edge computing does not always meet the large computing requirements of resource-intensive tasks. The core goal of placing edge nodes in the intelligent warehousing system is to make quick decisions and execute quickly, expand the computing power of the central cloud to the "last mile", and effectively realize the processing and decision-making of information by the intelligent warehousing system under the overall architecture of "cloud-edge-end".
[0004] Multiple terminal devices have different computing tasks, forming a task flow, such as Figure 2As shown in the figure, the tasks of smart warehousing have different urgency and different resource requirements under the deadline constraints. It is necessary to consider specifying computing priorities for tasks and selecting appropriate computing nodes according to task characteristics. In the edge computing environment, the offloading of smart warehousing tasks not only improves efficiency and capabilities, but also faces a series of problems and challenges. Although the application of this computing model in smart warehousing has brought many advantages, such as reducing latency and improving data processing capabilities, some contradictions and problems have also emerged. Among them, the different priorities of processing computing tasks of smart terminal devices and the heterogeneity of resource requirements have made the balance of computing resources between edge servers and cloud servers an important topic of current research. First, existing methods often do not fully consider the priority issues between smart warehousing tasks. Even in the Internet of Things environment, different tasks have different priorities due to their differences in importance and urgency. This requires us to fully consider the priorities of these tasks in the process of task offloading to ensure that important and urgent tasks can be processed first. Secondly, there is obvious heterogeneity in the demand for resources in smart warehousing tasks. Different tasks may have very different requirements in terms of processing power, storage space, network bandwidth, etc. However, current task offloading strategies often fail to take this heterogeneity into account, which may lead to a waste of resources or the inability to effectively execute certain tasks. Finally, there may be significant dependencies between smart warehousing tasks. In other words, the execution of some tasks may depend on the results of other tasks. This requires us to take this dependency into account when formulating task offloading strategies to avoid delays or failures of dependent tasks that affect the execution of other dependent tasks, leading to an imbalance in computing resources between edge servers and cloud servers. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide an intelligent warehousing task unloading method based on mobile edge computing, to achieve a balance between the computing resources of the edge server itself and the computing resources in the cloud server, to divide the computing tasks into different priorities, to make task selection and unloading decisions, and thus to dynamically schedule the computing resources of the edge server itself to reduce task timeouts.
[0006] The technical solution of the present invention is:
[0007] A method for intelligent warehousing task unloading based on mobile edge computing specifically includes the following steps:
[0008] S1, initialization of edge server and cloud server;
[0009] S2, different logistics zones of the smart storage center have different terminal devices, each of which generates computing tasks and sends unloading requests to the nearest edge server;
[0010] S3, the edge server receives the offloading request, extracts the computing tasks in the offloading request, sends the computing tasks to the edge server in the form of task streams, the task selection agent sorts the computing tasks in real time according to the task characteristics, obtains the computing task queues with different priorities, and then selects the computing tasks with the highest priority, and the offloading decision agent selects the edge server or cloud server as the computing node according to the heterogeneous requirements of the computing tasks for computing resources and the status of the computing resources of the edge server and the cloud server; wherein, both the task selection agent and the offloading decision agent perform Markov decision making based on the multi-pointer attention model;
[0011] S4. According to the calculation results of the offloading decision agent, the computing task is chosen to be offloaded on the edge server or the cloud server. When the computing task is chosen to be offloaded on the edge server, the computing result is directly returned to the terminal device after the edge server completes the computing task. When the computing task is chosen to be offloaded on the cloud server, the edge server sends the computing task to the cloud server, and the cloud server returns the computing result to the terminal device after completing the computing task.
[0012] The initialization of the edge server and the cloud server is specifically as follows:
[0013] S11. Edge Servers are regarded as edge nodes with different computing capabilities, which are distributed in different logistics partitions of the smart warehouse center; each edge server consists of a four-dimensional vector To express, Indicates the CPU computing power of the edge server. Represents the edge server Occupancy rate, represents the bandwidth of the edge server, represents the storage capacity of the edge server;
[0014] S12, the cloud server consists of a four-dimensional vector To express, Represents the parallel computing capability of the cloud server, Represents the cloud server Occupancy rate, Indicates the bandwidth of the cloud server. Indicates the storage capacity of the cloud server.
[0015] The computing task of the terminal device is a five-dimensional vector , Indicates the amount of CPU power required to perform computing tasks. Indicates the deadline for executing the computing task. Indicates the number of Occupancy rate, represents the bandwidth required to perform computing tasks, Represents the storage capacity required to perform computing tasks.
[0016] The specific steps of Markov decision making by the task selection agent and the unloading decision agent are based on the multi-pointer attention model:
[0017] S31, extract relevant information features of each task from the task flow as the state of the Markov decision model;
[0018] State sequence of the task selection agent is the task selection agent at time step The local state at time is defined as formula (1):
[0019] (1);
[0020] In formula (1), Represents a computing task The earliest estimated completion time of the completed computing task is is the actual completion time; Indicates that at time step When computing tasks The remaining time under the deadline constraint; Is a binary identifier used to represent a computational task Has the time step been arranged? ;
[0021] State sequence of unloading decision agent is the unloading decision agent at time step The local state at time is defined as formula (2):
[0022] (2);
[0023] In formula (2), Represents a computing task The earliest start time for execution on the edge server, Represents a computing task The computation time performed on the edge server; Represents a computing task The earliest start time for execution on the cloud server, Represents a computing task The computation time performed on the cloud server;
[0024] S32. For the task selection agent, the action space is defined as , represents the task selection agent at time step The action of time, is the task selection agent at time step is the set of actions taken when ; for the unloading decision agent, the action space is defined as , represents the unloading decision agent at time step The action of time, or 1, when When , the action of the offloading decision agent is to select the edge server as the computing node. When , the action of the offloading decision agent is to select the cloud server as the computing node. represents the unloading decision agent at time step The collection of actions performed when
[0025] S33. Rewards : Reward is expressed as , It is a computational task At time step The task completion time is ;
[0026] S34, the task selection agent and the unloading decision agent both use a multi-pointer attention model to update and iterate the agent. The multi-pointer attention model includes an encoder and a decoder. Specifically, the state sequence or As the input of the encoder, the state sequence is encoded through a multi-layer attention mechanism; the decoder calculates the context vector of the state sequence based on the output of the encoder, and then calculates the probability of the action based on the output of the encoder. The pointer network selects the member with the highest probability as the output of the input sequence, generates step-by-step action output, changes the state of the environment, and thus updates the state of the agent.
[0027] The input of the encoder of the task selection agent is , the input of the encoder of the offloading decision agent is , Represents the status of the edge server. Represents the status of the cloud server;
[0028] S341, task selection agent whose encoder first uses a fully connected layer to obtain the input embedding layer , see the following formula (3) for details:
[0029] (3);
[0030] In formula (3), is the weight matrix, is the bias vector;
[0031] Then the multi-head attention layer is encoded, and the multi-head attention layer, i.e. Layer Duplicate times to get the output , see the following formula (4) for details:
[0032] (4);
[0033] In formula (4), represent The number of layer cycles;
[0034] S342, task selection agent whose decoder is based on the output of the encoder Calculate the context vector , see the following formula (5) for details:
[0035] (5);
[0036] Then the context vector and the encoder output Embedded into a fully connected layer, get the pointer vector and matching vector , see the following formulas (6) and (7):
[0037] (6);
[0038] (7);
[0039] In formula (6) and formula (7), is the dimension of the context vector; is the output dimension of the encoder;
[0040] Then according to the pointer vector and matching vector Calculating the probability of an action , see the following formula (8) for details:
[0041] (8);
[0042] In formula (8), yes Activation function, and use hyperparameters To trim Activation function Result; The calculation formulas are shown in the following equations (9) and (10);
[0043] For the decoder of the task selection agent, is defined as:
[0044] When computing tasks Not selected, (9);
[0045] When computing tasks Be chosen, (10);
[0046] For the decoder that offloads the decision agent, It is calculated by formula (9).
[0047] The The processing that runs once per layer, i.e. The processing process is:
[0048] a. Multiply the output of the input embedding layer by the query weight matrix to get the query vector ;
[0049] b. Multiply the output of the input embedding layer by the key weight matrix to get the key vector ;
[0050] c. Multiply the output of the input embedding layer by the value weight matrix to get the value vector ;
[0051] d. Node and iteration nodes Calculating attention weights , see the following formula (11) for details:
[0052] (11);
[0053] In formula (11), the node Represents the input node at the current time or current position, iterative node Represents the iterative process in the attention mechanism. In the process of calculating the attention weight, each node is calculated as a query vector and a key vector. is the query vector The transposed vector of is the query vector The dimension of It is an iteration node The key vector of
[0054] e. The output is shown in the following formula (12):
[0055] (12);
[0056] In formula (12), represents the number of heads in the multi-head attention layer, represents a learnable scaling parameter, , , , , represents the learnable weights, express Activation function, Indicated in Batch normalization is performed before the activation function. exist The input data for the hidden layer is represented in the processing.
[0057] The task selection agent and the unloading decision agent are both based on The algorithm is trained. During training, the parameters are first used and For random strategies and Parameterize, and They represent the probability distribution of the task selection agent and the unloading decision agent, respectively. The loss functions for the task selection agent and the unloading decision agent training are and , is the expectation, used to measure the training effect of the task selection agent and the offloading decision agent. represents the global reward value obtained by the joint action of the task selection agent and the unloading decision agent, is the state of the task selection agent, is the task selection agent strategy Parameterization of is the state of the uninstall decision agent, is the offloading decision agent strategy Parameterization of
[0058] The update of the training loss function of the task selection agent and the offloading decision agent is shown in the following equations (13) and (14);
[0059] (13);
[0060] (14);
[0061] In formulas (13) and (14), , represents the estimate of the global reward value, which is used to measure the difference between the model prediction value and the actual reward, thereby guiding the optimization of the model parameters; Represents the gradient descent method for Make updates; Represents the gradient descent method for to update.
[0062] The objective function of the task selection agent and the unloading decision agent is shown in the following formula (15):
[0063] (15);
[0064] Formula (15) represents the total delay time of minimizing task offloading; when , computing tasks The calculation is done on the edge server, that is, the computing task is offloaded to the edge server, then the objective function is ;when , computing tasks Then the calculation is offloaded to the cloud server, and the objective function is ;
[0065] The construction of the objective function is based on the constraints of the following equations (16)-(21):
[0066] (16);
[0067] (17);
[0068] (18);
[0069] (19);
[0070] (20);
[0071] (twenty one);
[0072] Formula (16) is used to constrain a computing task Only one core in an edge server or cloud server Medium processing;
[0073] Formula (17) is used to constrain the calculation task Must be on deadline Before completion, Indicates the time when the edge server executes the computing task. Indicates the time when the cloud server executes the computing task. Indicates the start time of the cloud server executing the computing task;
[0074] Equations (18) and (19) are used to constrain each core in the cloud server Can only process one computational task at a time or , express The minimum value of
[0075] Formula (20) represents the computational task The start time of offloading computing tasks to the cloud server The upload time of the calculated task constraint;
[0076] Formula (21) is used to constrain decision variables , and When computing tasks In the cloud server Nuclear execution, If it is 1, it is executed on the edge server. is 0; similarly, when the calculation task In the cloud server Nuclear execution, If it is 1, it is executed on the edge server. Then it is 0; calculation task In computing tasks Before execution, then ,otherwise .
[0077] The time for the edge server to perform computing tasks The calculation formula is shown in the following formula (22):
[0078] (twenty two);
[0079] In formula (22), Indicates the amount of CPU power required to perform computing tasks. Indicates the number of CPU cycles required to process 1 bit of data. Indicates the number of CPU cycles required to perform a computational task. Represents edge server CPU computing power;
[0080] The time for the cloud server to perform computing tasks The calculation formula is shown in the following formula (23):
[0081] (twenty three);
[0082] In formula (23), Indicates the CPU computing power of the cloud server;
[0083] The computational task Upload time The calculation formula is shown in the following formula (24):
[0084] (twenty four);
[0085] In formula (24), Represents edge server The data communication rate between the cloud server and the server is calculated by the following formula (25):
[0086] (25);
[0087] In formula (25), It is an edge server Communication bandwidth with the cloud server, It is an edge server The transmission power, It is an edge server Channel gain to the cloud server, is the variance of the Gaussian channel noise, , is the path loss exponent, Represents edge server The distance to the cloud server.
[0088] Advantages of the present invention:
[0089] (1) The present invention first sends the computing task of each terminal device to the nearest edge server, and then the task selection agent and the offloading decision agent of the edge server perform Markov decision based on the multi-pointer attention model, so that the task selection agent selects the computing task with the highest priority from the task pair, and the offloading decision agent chooses to offload the computing task to the edge server or cloud server, that is, first selects the computing task with the highest priority, and makes an offloading decision for the selected computing task, considering the characteristics of the tasks in the computing task offloading problem, that is, the priority of the task and the heterogeneous demand for computing resources, balancing the computing resources in the edge server and the cloud server, thereby reducing the execution processing delay of the computing task and improving the offloading efficiency.
[0090] (2) The present invention models the intelligent warehousing task unloading decision process as a multi-agent Markov decision process. The architecture constructs a multi-pointer attention model to encode and decode the state sequence and action sequence in the Markov decision process to achieve modeling and solving of sequential decision problems.
[0091] (3) The multi-pointer attention model of the present invention uses The multi-head attention mechanism is added to the architecture. The multi-head attention mechanism can capture the contextual relationship between different positions in the state sequence, so as to better understand the dependencies and contextual information between states. It helps the multi-pointer attention model to consider previous states and actions in the decision-making process to make better decisions. By using multiple attention heads, features of different scales can be captured, thereby more comprehensively understanding the information in the state sequence. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] Figure 1 It is a scenario diagram for the application of intelligent warehousing system.
[0093] Figure 2 It is a structural diagram of the composition of the intelligent warehousing system.
[0094] Figure 3 It is a flow chart of Markov decision making by the task selection agent and the unloading decision agent of the present invention based on the multi-pointer attention model.
[0095] Figure 4 It is a flow chart of the multi-pointer attention model of the present invention.
[0096] Figure 5 This is a comparison chart of the total response time of the present invention and other four algorithms under different numbers of computing tasks in the experiment of the embodiment of the present invention.
[0097] Figure 6 This is a comparison chart of the total response time of the present invention and other four algorithms under different computing task data amounts in the experiment of the embodiment of the present invention.
[0098] Figure 7 This is a comparison chart of the total response time of the present invention and other four algorithms under the cloud server parallel computing of different numbers of computing tasks in the experiment of the embodiment of the present invention.
[0099] Figure 8 This is a comparison chart of the task deadline timeout rates of the present invention and other four algorithms under different numbers of computing tasks in the experiment of the embodiment of the present invention.
[0100] Figure numerals: 1-supplier's truck, 2-warehouse, 3-picking area, 4-transmission equipment, 5-sensor, 6-labeling machine, 7-shipping truck, 8-terminal device, 9-edge server, 10-cloud server. DETAILED DESCRIPTION
[0101] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0102] See Figure 1 In the smart warehouse center, the supplier's truck 1 is responsible for transporting the goods to the receiving area. Then, the robot uploads and migrates the goods to the warehouse to accurately verify the quantity of goods from each supplier. Then the robot classifies the goods and moves them to the shelves of a large warehouse 2. In this process, both the spatial inventory data of the smart warehouse system (collected by sensors) and the computing tasks such as robot path planning are real-time and need to be processed in real time. When the smart warehouse system receives a customer order, the robot picks up the required goods from the shelves of warehouse 2 and transfers them to the picking area 3. Each robot can intelligently plan the best path while avoiding collisions with other robots. When receiving a task to pick a product, the robot provides the required goods to the robot arm of the workstation. Then, the robot arm takes out the product and places it on the conveyor 4. The goods are then moved along the conveyor 4 to the packaging area. When the goods pass through certain machines (sensors 5, marking machines 6, etc.) on the conveyor 4, they will be marked and the number of goods to be shipped will be confirmed. Finally, after the goods are classified according to the customer's order, they will be sent to the shipping area, and the robot will move the goods to the shipping truck 7, and then the shipping truck 7 will deliver the goods to the customer. In the whole process, the computing tasks are diverse, such as robot path planning and navigation, real-time data analysis decision support, picking optimization, etc. Due to the heterogeneous requirements of computing resources for various computing tasks, such as path planning and navigation are computing-intensive, and order processing is latency-critical, so it is particularly important to efficiently balance the computing resources in edge servers and cloud servers.
[0103] See Figure 2,The intelligent warehousing system is divided into three levels: the terminal device layer, the edge server layer, and the cloud server layer. At the terminal device layer, the terminal device 8 generates different computing tasks and sends the computing tasks to the nearest edge server 9. The key to achieving real-time management of distributed intelligent warehousing is the ability to effectively process these computing tasks generated by the terminal device 8. Among them, the computing tasks have different urgency and resource requirements. Each edge server 9 of the edge server layer is located close to the terminal device 8 and can be responsible for processing more real-time and urgent tasks. Secondly, the edge server 9 sorts the computing tasks according to the task characteristics and obtains computing task queues of different priorities. Finally, the edge server 9 decides whether to offload the computing tasks to the edge server 9 or the cloud server 10 for subsequent computing according to the heterogeneous requirements of the computing tasks for computing resources and the status of the computing resources of the edge server 9 itself and the cloud server 10; at the cloud server layer, firstly, the cloud server 10 provides a computing model that can access the Internet anytime and anywhere, and undertakes the tasks of data storage and large-scale computing. Secondly, the computing resources of the real-time cloud server 10 are sent to the edge server layer for the edge server 9 to make real-time task offloading decisions.
[0104] A method for intelligent warehousing task unloading based on mobile edge computing specifically includes the following steps:
[0105] S1. Initialization of edge server and cloud server, specifically:
[0106] S11. Edge Servers are regarded as edge nodes with different computing capabilities, which are distributed in different logistics partitions of the smart warehouse center; each edge server consists of a four-dimensional vector To express, Indicates the CPU computing power of the edge server. Represents the edge server Occupancy rate, represents the bandwidth of the edge server, represents the storage capacity of the edge server;
[0107] S12, the cloud server consists of a four-dimensional vector To express, Represents the parallel computing capability of the cloud server, Represents the cloud server Occupancy rate, Indicates the bandwidth of the cloud server. Indicates the storage capacity of the cloud server;
[0108] S2, different logistics zones of the smart storage center have different terminal devices, each of which generates computing tasks and sends unloading requests to the nearest edge server;
[0109] The computing task of the terminal device is a five-dimensional vector , Indicates the amount of CPU power required to perform computing tasks. Indicates the deadline for executing the computing task. Indicates the number of Occupancy rate, represents the bandwidth required to perform computing tasks, Represents the storage capacity required to perform computing tasks;
[0110] S3, the edge server receives the offloading request, extracts the computing tasks in the offloading request, sends the computing tasks to the edge server in the form of a task stream, and the task selection agent sorts the computing tasks in real time according to the task characteristics, obtains a queue of computing tasks with different priorities, and then selects the computing task with the highest priority. The offloading decision agent selects the edge server or cloud server as the computing node according to the heterogeneous requirements of the computing tasks for computing resources and the status of the computing resources of the edge server and the cloud server;
[0111] See Figure 3 and Figure 4 , both the task selection agent and the unloading decision agent perform Markov decision making based on the multi-pointer attention model. The specific steps are:
[0112] S31, extract relevant information features of each task from the task flow as the state of the Markov decision model;
[0113] State sequence of the task selection agent is the task selection agent at time step The local state at time is defined as formula (1):
[0114] (1);
[0115] In formula (1), Represents a computing task The earliest estimated completion time of the completed computing task is is the actual completion time; Indicates that at time step When computing tasks The remaining time under the deadline constraint; Is a binary identifier used to represent a computational task Has the time step been arranged? ;
[0116] State sequence of unloading decision agent is the unloading decision agent at time step The local state at time is defined as formula (2):
[0117] (2);
[0118] In formula (2), Represents a computing task The earliest start time for execution on the edge server, Represents a computing task The computation time performed on the edge server; Represents a computing task The earliest start time for execution on the cloud server, Represents a computing task The computation time performed on the cloud server;
[0119] S32. For the task selection agent, the action space is defined as , represents the task selection agent at time step The action of time, is the task selection agent at time step is the set of actions taken when ; for the unloading decision agent, the action space is defined as , represents the unloading decision agent at time step The action of time, or 1, when When , the action of the offloading decision agent is to select the edge server as the computing node. When , the action of the offloading decision agent is to select the cloud server as the computing node. represents the unloading decision agent at time step The collection of actions performed when
[0120] S33. Rewards : Reward is expressed as , It is a computational task At time step The task completion time is ;
[0121] S34, the task selection agent and the unloading decision agent both use a multi-pointer attention model to update and iterate the agent. The multi-pointer attention model includes an encoder and a decoder. Specifically, the state sequence or As the input of the encoder, the state sequence is encoded through a multi-layer attention mechanism; the decoder calculates the context vector of the state sequence based on the output of the encoder, and then calculates the probability of the action combined with the output of the encoder. Select the member with the highest probability as the output of the input sequence, generate step-by-step action output, and change the environment The state of the agent is updated;
[0122] Among them, the input of the encoder of the task selection agent is , the input of the encoder of the offloading decision agent is , Represents the status of the edge server. Represents the status of the cloud server;
[0123] S341, the task selection agent, its encoder first uses a fully connected layer To get the input embedding layer , see the following formula (3) for details:
[0124] (3);
[0125] In formula (3), is the weight matrix, is the bias vector;
[0126] Then the multi-head attention layer Encoding, the multi-head attention layer, i.e. Layer Duplicate times to get the output , see the following formula (4) for details:
[0127] (4);
[0128] In formula (4), represent The number of layer cycles; The processing that runs once per layer, i.e. The processing process is:
[0129] a. Multiply the output of the input embedding layer by the query weight matrix to get the query vector , the size of the query weight matrix is (embedding dimension, query dimension), where the embedding dimension is the same as the dimension of the input embedding layer output, and the query dimension is determined by the specific requirements of the problem;
[0130] b. Multiply the output of the input embedding layer by the key weight matrix to get the key vector , the size of the key weight matrix is (embedding dimension, key dimension), where the embedding dimension is the same as the dimension of the input embedding layer output, and the key dimension is determined by the specific requirements of the problem;
[0131] c. Multiply the output of the input embedding layer by the value weight matrix to get the value vector , the size of the value weight matrix is (embedding dimension, value dimension), where the embedding dimension is the same as the dimension of the input embedding layer output, and the value dimension is determined by the specific requirements of the problem;
[0132] d. Node and iteration nodes Calculating attention weights , see the following formula (11) for details:
[0133] (11);
[0134] In formula (11), the node Represents the input node at the current time or current position, iterative node Represents the iterative process in the attention mechanism. In the process of calculating the attention weight, each node is calculated as a query vector and a key vector. is the query vector The transposed vector of is the query vector The dimension of It is an iteration node The key vector of
[0135] e. The output is shown in the following formula (12):
[0136] (12);
[0137] In formula (12), represents the number of heads in the multi-head attention layer, represents a learnable scaling parameter, , , , , represents the learnable weights, express Activation function, Indicated in Batch normalization is performed before the activation function , exist The input data representing the hidden layer during processing;
[0138] S342, task selection agent whose decoder is based on the output of the encoder Calculate the context vector , see the following formula (5) for details:
[0139] (5);
[0140] Then the context vector and the encoder output Embedded into a fully connected layer , get the pointer vector and matching vector , see the following formulas (6) and (7):
[0141] (6);
[0142] (7);
[0143] In formula (6) and formula (7), is the dimension of the context vector; is the output dimension of the encoder;
[0144] Then according to the pointer vector and matching vector Calculating the probability of an action , see the following formula (8) for details:
[0145] (8);
[0146] In formula (8), yes Activation function, and use hyperparameters To trim Activation function Result; The calculation formulas are shown in the following equations (9) and (10);
[0147] For the decoder of the task selection agent, is defined as:
[0148] When computing tasks Not selected, (9);
[0149] When computing tasks Be chosen, (10);
[0150] For the decoder that offloads the decision agent, Calculated by formula (9);
[0151] S4. According to the calculation results of the offloading decision agent, the computing task is chosen to be offloaded on the edge server or the cloud server. When the computing task is chosen to be offloaded on the edge server, the computing result is directly returned to the terminal device after the edge server completes the computing task. When the computing task is chosen to be offloaded on the cloud server, the edge server sends the computing task to the cloud server, and the cloud server returns the computing result to the terminal device after completing the computing task.
[0152] Both the task selection agent and the unloading decision agent adopt The algorithm is trained. During training, the parameters are first used and For random strategies and Parameterize, and They represent the probability distribution of the task selection agent and the unloading decision agent, respectively. The loss functions for the task selection agent and the unloading decision agent training are and , is the expectation, used to measure the training effect of the task selection agent and the offloading decision agent. represents the global reward value obtained by the joint action of the task selection agent and the unloading decision agent, is the state of the task selection agent, is the task selection agent strategy Parameterization of is the state of the uninstall decision agent, is the offloading decision agent strategy Parameterization of
[0153] The update of the training loss function of the task selection agent and the offloading decision agent is shown in the following equations (13) and (14);
[0154] (13);
[0155] (14);
[0156] In formulas (13) and (14), , represents the estimate of the global reward value, which is used to measure the difference between the model prediction value and the actual reward, thereby guiding the optimization of the model parameters; Represents the gradient descent method for Make updates; Represents the gradient descent method for to update.
[0157] The joint objective function of the task selection agent and the unloading decision agent is shown in the following formula (15):
[0158] (15);
[0159] Formula (15) represents the total delay time of minimizing task offloading; when , computing tasks The calculation is done on the edge server, that is, the computing task is offloaded to the edge server, then the objective function is ;when , computing tasks Then the calculation is offloaded to the cloud server, and the objective function is ;
[0160] The construction of the objective function is based on the constraints of the following equations (16)-(21):
[0161] (16);
[0162] (17);
[0163] (18);
[0164] (19);
[0165] (20);
[0166] (twenty one);
[0167] Formula (16) is used to constrain a computing task Only one core in an edge server or cloud server Medium processing;
[0168] Formula (17) is used to constrain the calculation task Must be on deadline Before completion, Indicates the time when the edge server executes the computing task. Indicates the time when the cloud server executes the computing task. Indicates the start time of the cloud server executing the computing task;
[0169] Equations (18) and (19) are used to constrain each core in the cloud server Can only process one computational task at a time or , express The minimum value of
[0170] Formula (20) represents the computational task The start time of offloading computing tasks to the cloud server The upload time of the calculated task constraint;
[0171] Formula (21) is used to constrain decision variables , and When computing tasks In the cloud server Nuclear execution, If it is 1, it is executed on the edge server. is 0; similarly, when the calculation task In the cloud server Nuclear execution, If it is 1, it is executed on the edge server. Then it is 0; calculation task In computing tasks Before execution, then ,otherwise .
[0172] The time it takes for edge servers to perform computing tasks The calculation formula is shown in the following formula (22):
[0173] (twenty two);
[0174] In formula (22), Indicates the amount of CPU power required to perform computing tasks. Indicates the number of CPU cycles required to process 1 bit of data. Indicates the number of CPU cycles required to perform a computational task. Represents edge server CPU computing power;
[0175] The time it takes for the cloud server to execute computing tasks The calculation formula is shown in the following formula (23):
[0176] (twenty three);
[0177] In formula (23), Indicates the CPU computing power of the cloud server;
[0178] Computational tasks Upload time The calculation formula is shown in the following formula (24):
[0179] (twenty four);
[0180] In formula (24), Represents edge server The data communication rate between the cloud server and the server is calculated by the following formula (25):
[0181] (25);
[0182] In formula (25), It is an edge server Communication bandwidth with the cloud server, It is an edge server The transmission power, It is an edge server Channel gain to the cloud server, is the variance of the Gaussian channel noise, , is the path loss exponent, Represents edge server The distance to the cloud server.
[0183] This embodiment provides an experiment on computing task offloading to verify the performance of the present invention.
[0184] 1. Hyperparameter setting:
[0185] The experiment was performed on samples of 100 different computing tasks. Initially, the experiment determined the Markov decision model based on the multi-pointer attention model of the present invention. The most suitable learning rate. The learning rate will make The loss function of the model converges to a lower level faster than other learning rates. It is also found that when the embedding dimension is set to 128 or 256, The model eventually converges to a lower loss value. However, when 256 dimensions are selected, the training memory required is significantly increased compared to 128 dimensions. Based on this, 128 dimensions are selected as the dimension of node embedding. At the same time, when the number of heads in the multi-head attention layer is 8, the convergence of the training loss is the most stable. Therefore, eight attention heads are selected as the optimal configuration.
[0186] This experiment will The model is compared and analyzed with four other algorithms (DROO algorithm, BPSO algorithm, EF algorithm and CF algorithm):
[0187] DROO algorithm: a dynamic offloading algorithm for mobile edge computing based on deep reinforcement learning;
[0188] BPSO algorithm: hybrid discrete binary particle swarm algorithm;
[0189] EF algorithm: Edge priority algorithm, that is, computing tasks are processed first on edge servers. Unless the computing resources of the edge server cannot meet the task requirements, it will be offloaded to the cloud server to process the computing tasks;
[0190] CF algorithm: Cloud priority algorithm, that is, computing tasks are offloaded to cloud servers first for computing. Computing tasks that have been waiting for too long and cannot meet the task requirements will be reserved for edge servers for computing.
[0191] 2. Impact of the number of tasks:
[0192] Considering that factors such as a surge in corporate orders or expansion of production lines may lead to an increase in the number of computing tasks that need to be arranged, the performance of the present invention under different task scales is evaluated. The experiment covers various scenarios where the number of computing tasks is set to 50, 80, 100, 200 and 300, and a total of 24 instances are used in the experiment. The average value of the solutions of the 24 instances is used to verify the performance of different algorithms, such as Figure 5 shown. Figure 5 Describes the results of examples with different numbers of tasks, with the horizontal axis being the number of computational tasks. , the vertical axis is the total response time of the task . Generally, as the number of computing tasks accumulates, the total computing time also increases. When the number of computing tasks is small, The performance of the model is comparable to that of the DROO algorithm, however, The running time of the model is shorter than that of the DROO algorithm. As a reasonable heuristic algorithm, the BPSO algorithm produces a reasonable solution in a shorter time than the EF algorithm and the CF algorithm. However, the slow execution speed of the BPSO algorithm makes it unsuitable for real-time optimization applications. As the number of computing tasks increases, the total response time of the CF algorithm increases compared with the EF algorithm. The reason for this phenomenon is that as the number of computing tasks increases, the computing power of the cloud server remains unchanged. Therefore, more tasks need to be processed on the edge server.
[0193] 3. Impact of task data size:
[0194] The data volume of a computing task is an intrinsic property that represents the total number of CPU cycles required to complete the computing task. At the same time, it is also one of the key factors that determine the choice of computing task offloading. In the actual production process, the data volume of the computing task may change due to the upgrade of the data collection equipment, which directly affects the decision-making process of task offloading. The data volume of different computing tasks also varies. Similarly, the solution of 24 instances is used as experimental data to compare the performance of several algorithms. Figure 6It shows that as the data size of the computing task (the date size of tasks on the horizontal axis) increases, the total task response time (the vertical axis) also increases. The running time of the model is 30% shorter than that of the other four algorithms, mainly because the amount of data in the computing task increases. The model can select the most suitable unloading node for the computing task and consider the priority of the task, which improves the efficiency of unloading. The other four algorithms do not consider the priority of the task, resulting in some computing tasks waiting too long or failing to be executed.
[0195] 4. The impact of cloud computing power:
[0196] Considering the continuous advancement of cloud computing technology, the latest cloud computing solutions can be integrated into intelligent warehousing systems. Therefore, it is increasingly necessary to explore the impact of different cloud server computing resource levels on the task allocation of distributed intelligent warehousing systems. The computing resources of cloud servers are the key factor in determining computing latency. The number of parallel computing tasks in a cloud server is taken as the computing power of the cloud server, and experiments are designed to examine the performance with 8, 10, 12, 14, and 16 parallel instances. In order to quantify the practical utility of these algorithms, 24 different instances are also tested. Figure 7 The average performance of 24 examples solved using different methods is revealed.
[0197] Figure 7 In the figure, the horizontal axis is the number of parallel computing tasks of the cloud server. , the vertical axis is the total response time of the task . Figure 7 It shows that as the number of parallel computing tasks increases, the total task response time decreases, except for the EF algorithm. This shows that increasing cloud computing resources is an effective way to reduce the total task response time. The algorithm can effectively balance the computing resources of edge servers and cloud servers, allowing more computing tasks to be offloaded to cloud servers for processing. Compared with other algorithms, the total task response time is reduced.
[0198] 5. Comparison of timeout rate:
[0199] The overtime rate, i.e. the percentage of tasks that miss their deadlines, is a very important factor in real-time systems. Figure 8 As shown in the figure, the timeout rate experimental results of five algorithms are compared. The horizontal axis is the number of computing tasks. , the vertical axis is the timeout rate When the number of computing tasks increases, Except for the proposed model, the timeout rates of the other four algorithms increased significantly. The deadline omission rate of the model is the most stable and lowest in any case of the number of computing tasks. When the number of computing tasks is 50, The timeout rate of the model is 67.44% and 54.89% lower than that of the BPSO algorithm and the DROO algorithm, respectively. When the number of computing tasks increases to 300, The timeout rate of the model is 70.80% and 69.70% lower than that of the BPSO algorithm and the DROO algorithm, respectively. This is because The model not only considers the deadline constraints of computing tasks, but also handles the priorities and heterogeneous resource requirements of computing tasks.
[0200] Compared with existing algorithms, The model shows better performance in solving task offloading problems and reducing total response time. The model can effectively cope with various challenges encountered by enterprises in actual operations, including the increase in order quantity, the extension of production lines, the changes in task types and data volume, and the fluctuation of cloud computing capabilities. For a model, once it is trained on an instance of a certain type, it can quickly solve other instances of that type with just a single execution. In contrast, heuristic algorithms such as genetic algorithms (GA) or particle swarm optimization (PSO) often require multiple runs, especially on large-scale problems, which greatly increases the time to obtain a satisfactory solution. Most existing exact algorithms also require a lot of computational time to obtain a feasible solution.
[0201] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A smart warehousing task offloading method based on mobile edge computing, Features: The specific steps include: S1, initialization of edge server and cloud server; S2, different logistics zones of the smart storage center have different terminal devices, each of which generates computing tasks and sends unloading requests to the nearest edge server; S3, the edge server receives the offloading request, extracts the computing tasks in the offloading request, sends the computing tasks to the edge server in the form of task streams, and the task selection agent sorts the computing tasks in real time according to the task characteristics, obtains the computing task queues with different priorities, and then selects the computing task with the highest priority. The offloading decision agent selects the edge server or cloud server as the computing node according to the heterogeneous requirements of the computing tasks for computing resources and the status of the computing resources of the edge server and the cloud server; wherein, the task selection agent and the offloading decision agent both make Markov decisions based on the multi-pointer attention model, and the specific steps are as follows: S31, extract relevant information features of each task from the task flow as the state of the Markov decision model; State sequence of the task selection agent is the task selection agent at time step The local state at time is defined as formula (1): (1); In formula (1), Represents a computing task The earliest estimated completion time of the completed computing task is is the actual completion time; Indicates that at time step When computing tasks The remaining time under the deadline constraint; Is a binary identifier used to represent a computational task Has the time step been arranged? ; State sequence of unloading decision agent is the unloading decision agent at time step The local state at time is defined as formula (2): (2); In formula (2), Represents a computing task The earliest start time for execution on the edge server, Represents a computing task The computation time performed on the edge server; Represents a computing task The earliest start time for execution on the cloud server, Represents a computing task The computation time performed on the cloud server; S32. For the task selection agent, the action space is defined as , represents the task selection agent at time step The action of time, is the task selection agent at time step is the set of actions taken when ; for the unloading decision agent, the action space is defined as , represents the unloading decision agent at time step The action of time, ,when When , the action of the offloading decision agent is to select the edge server as the computing node. When , the action of the offloading decision agent is to select the cloud server as the computing node. represents the unloading decision agent at time step The collection of actions performed when S33. Rewards : Reward is expressed as , It is a computational task At time step The task completion time is ; S34, the task selection agent and the unloading decision agent both use a multi-pointer attention model to update and iterate the agent. The multi-pointer attention model includes an encoder and a decoder. Specifically, the state sequence or As the input of the encoder, the state sequence is encoded through a multi-layer attention mechanism; the decoder calculates the context vector of the state sequence based on the output of the encoder, and then calculates the probability of the action based on the output of the encoder. The pointer network selects the member with the highest probability as the output of the input sequence, generates step-by-step action output, changes the state of the environment, and thus updates the state of the agent; S4. According to the calculation results of the offloading decision agent, the computing task is chosen to be offloaded on the edge server or the cloud server. When the computing task is chosen to be offloaded on the edge server, the computing result is directly returned to the terminal device after the edge server completes the computing task. When the computing task is chosen to be offloaded on the cloud server, the edge server sends the computing task to the cloud server, and the cloud server returns the computing result to the terminal device after completing the computing task.
2. According to claim 1, a method for intelligent warehousing task unloading based on mobile edge computing, Features: The initialization of the edge server and the cloud server is specifically as follows: S11. Edge Servers are regarded as edge nodes with different computing capabilities, which are distributed in different logistics partitions of the smart warehouse center; each edge server consists of a four-dimensional vector To express, Indicates the CPU computing power of the edge server. Represents the edge server Occupancy rate, represents the bandwidth of the edge server, represents the storage capacity of the edge server; S12, the cloud server consists of a four-dimensional vector To express, Represents the parallel computing capability of the cloud server, Represents the cloud server Occupancy rate, Indicates the bandwidth of the cloud server. Indicates the storage capacity of the cloud server.
3. According to claim 2, a method for intelligent warehousing task unloading based on mobile edge computing, Features: The computing task of the terminal device is a five-dimensional vector , Indicates the number of cells required to perform a computational task. The amount of consumption capacity, Indicates the deadline for executing the computing task. Indicates the number of Occupancy rate, represents the bandwidth required to perform computing tasks, Represents the storage capacity required to perform computing tasks.
4. According to claim 3, a method for intelligent warehousing task unloading based on mobile edge computing, Features: The input of the encoder of the task selection agent is , the input of the encoder of the offloading decision agent is , Represents the status of the edge server. Represents the status of the cloud server; S341, task selection agent whose encoder first uses a fully connected layer to obtain the input embedding layer , see the following formula (3) for details: (3); In formula (3), is the weight matrix, is the bias vector; Then the multi-head attention layer is encoded, and the multi-head attention layer, i.e. Layer Repeat times to get the output , see the following formula (4) for details: (4); In formula (4), represent The number of layer cycles; S342, task selection agent whose decoder is based on the output of the encoder Calculate the context vector , see the following formula (5) for details: (5); Then the context vector and the encoder output Embedded into a fully connected layer, get the pointer vector and matching vector , see the following formulas (6) and (7) for details: (6); (7); In formula (6) and formula (7), is the dimension of the context vector; is the output dimension of the encoder; Then according to the pointer vector and matching vector Calculating the probability of an action , see the following formula (8) for details: (8); In formula (8), yes Activation function, and use hyperparameters To trim Activation function Result; The calculation formulas are shown in the following equations (9) and (10); For the decoder of the task selection agent, is defined as: When computing tasks Not selected, (9); When computing tasks Be chosen, (10); For the decoder that offloads the decision agent, It is calculated by formula (9).
5. According to claim 4, a method for intelligent warehousing task unloading based on mobile edge computing, Features: The The processing that runs once per layer, i.e. The processing process is: a. Multiply the output of the input embedding layer by the query weight matrix to get the query vector ; b. Multiply the output of the input embedding layer by the key weight matrix to get the key vector ; c. Multiply the output of the input embedding layer by the value weight matrix to get the value vector ; d. Node and iteration nodes Calculating attention weights , see the following formula (11) for details: (11); In formula (11), the node Represents the input node at the current time or current position, iterative node Represents the iterative process in the attention mechanism. In the process of calculating the attention weight, each node is calculated as a query vector and a key vector. is the query vector The transposed vector of is the query vector The dimension of It is an iteration node The key vector of e. The output is shown in the following formula (12): (12); In formula (12), represents the number of heads in the multi-head attention layer, represents a learnable scaling parameter, , , , , represents the learnable weights, express Activation function, Indicated in Batch normalization is performed before the activation function. Represents the input data of the hidden layer in the BN process.
6. According to claim 4, a method for intelligent warehousing task unloading based on mobile edge computing, Features: The task selection agent and the unloading decision agent are both based on The algorithm is trained. During training, the parameters are first used and For random strategies and Parameterize, and They represent the probability distribution of the task selection agent and the unloading decision agent, respectively. The loss functions for the task selection agent and the unloading decision agent training are and , is the expectation, used to measure the training effect of the task selection agent and the offloading decision agent. represents the global reward value obtained by the joint action of the task selection agent and the unloading decision agent, is the state of the task selection agent, is the task selection agent strategy Parameterization of is the state of the uninstall decision agent, is the offloading decision agent strategy Parameterization of The update of the training loss function of the task selection agent and the offloading decision agent is shown in the following equations (13) and (14); (13); (14); In formulas (13) and (14), , represents the estimate of the global reward value, which is used to measure the difference between the model prediction value and the actual reward, thereby guiding the optimization of the model parameters; Represents the gradient descent method for Make updates; Represents the gradient descent method for to update.
7. According to claim 4, a method for unloading intelligent warehousing tasks based on mobile edge computing, Features: The objective function of the task selection agent and the unloading decision agent is shown in the following formula (15): (15); Formula (15) represents the total delay time of minimizing task offloading; when , computing tasks The calculation is done on the edge server, that is, the computing task is offloaded to the edge server, then the objective function is ;when , computing tasks Then the calculation is offloaded to the cloud server, and the objective function is ; The construction of the objective function is based on the constraints of the following equations (16)-(21): (16); (17); (18); (19); (20); (21); Formula (16) is used to constrain a computing task Only one core in an edge server or cloud server Medium processing; Formula (17) is used to constrain the calculation task Must be on deadline Before completion, Indicates the time when the edge server executes the computing task. Indicates the time for the cloud server to execute computing tasks. Indicates the start time of the cloud server executing the computing task; Equations (18) and (19) are used to constrain each core in the cloud server Can only process one computational task at a time or , express The minimum value of Formula (20) represents the computational task The start time of offloading computing tasks to the cloud server The upload time of the calculated task constraint; Formula (21) is used to constrain decision variables , and When computing tasks In the cloud server Nuclear execution, If it is 1, it is executed on the edge server. is 0; similarly, when the calculation task In the cloud server Nuclear execution, If it is 1, it is executed on the edge server. Then it is 0; calculation task In computing tasks Before execution, then ,otherwise .
8. According to claim 7, a method for intelligent warehousing task unloading based on mobile edge computing, Features: The time for the edge server to perform computing tasks The calculation formula is shown in the following formula (22): (22); In formula (22), Indicates the number of cells required to perform a computational task. The amount of consumption capacity, Indicates processing 1 Data required The number of cycles, Indicates the number of The number of cycles, Represents edge server of Computational capacity; The time for the cloud server to perform computing tasks The calculation formula is shown in the following formula (23): (23); In formula (23), Indicates the CPU computing power of the cloud server; The computational task Upload time The calculation formula is shown in the following formula (24): (24); In formula (24), Represents edge server The data communication rate between the cloud server and the server is calculated by the following formula (25): (25); In formula (25), It is an edge server Communication bandwidth with the cloud server, It is an edge server The transmission power, It is an edge server Channel gain to the cloud server, is the variance of the Gaussian channel noise, , is the path loss exponent, Represents edge server The distance to the cloud server.
