A load balancing method of an industrial software component distributed edge node
Patent Information
- Application Number
- CN202311038118.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-16
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-08-16
AI Technical Summary
[0003]现有技术中,在将任务部署到边缘节点的过程中,由于每个节点都有不同的运行时环境和库来支持任务,且边缘节点的计算资源和通信资源也是异构的,所以将任务部署到边缘节点上的方式各异,从而导致部署效率降低,整体的时延长
[0051]实施本发明实施例包括以下有益效果:本实施例中的一种工业软件组件分布式边缘节点的负载均衡方法,包括:获取终端的服务请求,根据所述服务请求选择任务;获取边缘节点的队列信息和任务容量;构建MDP模型,将所述队列信息和任务容量输入所述MDP模型,所述MDP模型包括状态空间和动作空间;基于所述状态空间确定接收所述任务的所述边缘节点,基于所述动作空间确定选择动作并选择所述边缘节点;根据所述选择动作和预设的奖励规则确定选择奖励;构建目标函数,根据所述目标函数和所述选择奖励计算卸载任务的平均时延;构建DQN算法模型,基于所述DQN算法模型求解所述选择动作的最大动作价值;基于所述最大动作价值确定所述平均时延的最小值;基于所述平均时延的最小值确定卸载边缘节点,将所述任务卸载值至所述卸载边缘节点。通过MDP模型、目标函数和DQN算法模型处理后将任务卸载到最合适的边缘节点,得到平均时延的最小值,更好地降低任务的处理延迟,提高部署效率。
Smart Images

Figure CN117061523B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of edge deployment technology, and in particular to a load balancing method for distributed edge nodes of industrial software components. Background Technology
[0002] Currently, industrial software systems in industrial and urban internet environments are characterized by their large scale, complex and heterogeneous software components and equipment entities, cross-platform compatibility, cross-operating system compatibility, and cross-programming language compatibility. Therefore, under normal circumstances, the deployment of industrial software components is carried out in edge computing, where latency is relatively lower and computing resources are relatively abundant.
[0003] In the existing technology, during the process of deploying tasks to edge nodes, each node has a different runtime environment and library to support the task, and the computing and communication resources of the edge nodes are also heterogeneous. Therefore, the methods of deploying tasks to edge nodes vary, resulting in reduced deployment efficiency and increased overall time. Summary of the Invention
[0004] In view of this, the purpose of this embodiment of the invention is to provide a load balancing method for distributed edge nodes of industrial software components, which can improve the efficiency of edge node task deployment and reduce overall latency.
[0005] In a first aspect, embodiments of the present invention provide a load balancing method for distributed edge nodes of industrial software components, comprising:
[0006] Obtain the service request from the terminal, and select a task based on the service request;
[0007] Obtain queue information and task capacity of edge nodes;
[0008] Construct an MDP model by inputting the queue information and task capacity into the MDP model, which includes a state space and an action space.
[0009] The edge node receiving the task is determined based on the state space, and the selection action is determined based on the action space, and the edge node is selected.
[0010] The reward is determined based on the selected action and the preset reward rules;
[0011] Construct an objective function, and calculate the average latency of the unloading task based on the objective function and the selected reward;
[0012] Construct a DQN algorithm model, and solve the maximum action value of the selected action based on the DQN algorithm model;
[0013] The minimum value of the average delay is determined based on the maximum action value;
[0014] The unloading edge node is determined based on the minimum value of the average latency, and the task is unloaded to the unloading edge node.
[0015] Optionally, the construction of the MDP model specifically includes:
[0016] Construct the state space of the MDP model, which includes the service requests allocated per unit time, the edge nodes that have completed the service requests, and the remaining unprocessed tasks in the edge nodes;
[0017] Construct the action space of the MDP model, the action space including the selection action, the selection action selecting the edge node that receives the task;
[0018] The state transition probability is determined based on the selected action;
[0019] Construct the reward rules for the selected action.
[0020] Optionally, determining the edge node receiving the task based on the state space specifically includes:
[0021] The edge state space is obtained based on the queue information, the task capacity, and the state space;
[0022] The edge node that receives the task is obtained from the edge state space.
[0023] Optionally, determining the selection action and selecting the edge node based on the action space specifically includes:
[0024] The edge action space is obtained based on the queue information, the task capacity, and the action space;
[0025] The selection action is determined based on the edge action space and the decision agent, and the edge node is selected through the selection action.
[0026] Optionally, determining the selection reward based on the selection action and preset reward rules specifically includes:
[0027] Obtain the immediate benefits, immediate latency, and overload probability corresponding to the selected action;
[0028] The selection reward is determined based on the immediate benefit, the immediate delay, and the overload probability.
[0029] Optionally, calculating the average latency of the unloading task based on the objective function and the selected reward specifically includes:
[0030] The total delay for uninstalling a single task is obtained based on the selected reward.
[0031] The average latency is determined based on the total latency of unloading a single task and the number of tasks unloaded, where the number of tasks unloaded represents the number of tasks unloaded.
[0032] Optionally, the method further includes:
[0033] Deploy the Docker engine on the edge node;
[0034] This enables Docker to package the task, the task's dependencies, and the operating system into a Docker image, and then upload the Docker image to Docker's repository;
[0035] This enables the edge node to retrieve the Docker image from the Docker repository.
[0036] Secondly, embodiments of the present invention provide a load balancing system for distributed edge nodes of industrial software components, comprising:
[0037] The first module is used to obtain service requests from the terminal and select tasks based on the service requests.
[0038] The second module is used to obtain queue information and task capacity of edge nodes;
[0039] The third module is used to construct the MDP model. The queue information and task capacity are input into the MDP model, which includes a state space and an action space.
[0040] The fourth module is used to determine the edge node that receives the task based on the state space, and to determine the selection action and select the edge node based on the action space.
[0041] The fifth module is used to determine the selection reward based on the selection action and the preset reward rules;
[0042] The sixth module is used to construct an objective function and calculate the average latency of the unloading task based on the objective function and the selected reward.
[0043] The seventh module is used to construct the DQN algorithm model and solve for the maximum action value of the selected action based on the DQN algorithm model.
[0044] The eighth module is used to determine the minimum value of the average delay based on the maximum action value;
[0045] The ninth module is used to determine the unloading edge node based on the minimum value of the average latency, and to unload the task value to the unloading edge node.
[0046] Thirdly, embodiments of the present invention provide a load balancing device for distributed edge nodes of industrial software components, comprising:
[0047] At least one processor;
[0048] At least one memory for storing at least one program;
[0049] When the at least one program is executed by the at least one processor, the at least one processor performs the method as described above.
[0050] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a processor-executable program, characterized in that the processor-executable program, when executed by a processor, is used to perform the method described above.
[0051] Implementing this embodiment of the invention provides the following beneficial effects: A load balancing method for distributed edge nodes of industrial software components in this embodiment includes: obtaining service requests from terminals and selecting tasks based on the service requests; obtaining queue information and task capacity of edge nodes; constructing an MDP model, inputting the queue information and task capacity into the MDP model, the MDP model including a state space and an action space; determining the edge node receiving the task based on the state space, determining a selection action based on the action space and selecting the edge node; determining a selection reward based on the selection action and a preset reward rule; constructing an objective function, calculating the average latency of unloading the task based on the objective function and the selection reward; constructing a DQN algorithm model, solving for the maximum action value of the selected action based on the DQN algorithm model; determining the minimum average latency based on the maximum action value; determining the unloading edge node based on the minimum average latency, and unloading the task to the unloading edge node. By processing the task using the MDP model, objective function, and DQN algorithm model, the task is unloaded to the most suitable edge node, obtaining the minimum average latency, thus better reducing task processing latency and improving deployment efficiency. Attached Figure Description
[0052] Figure 1 This is a flowchart illustrating the steps of a load balancing method for distributed edge nodes of industrial software components provided in an embodiment of the present invention.
[0053] Figure 2 This is a schematic flowchart of a system processing method provided in an embodiment of the present invention;
[0054] Figure 3 This is a schematic diagram of the edge node queue provided in an embodiment of the present invention;
[0055] Figure 4This is a structural block diagram of a load balancing system for distributed edge nodes of industrial software components provided in an embodiment of the present invention;
[0056] Figure 5 This is a structural block diagram of a load balancing device for distributed edge nodes of industrial software components provided in an embodiment of the present invention. Detailed Implementation
[0057] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adapted according to the understanding of those skilled in the art.
[0058] like Figure 1 As shown in the figure, this embodiment of the invention provides a load balancing method for distributed edge nodes of industrial software components, which includes the following steps.
[0059] S100: Obtain the service request from the terminal and select a task based on the service request.
[0060] The terminals include mobile phones, computers, smartwatches, etc. The specific terminals are determined based on the actual application and are not limited here.
[0061] In one specific embodiment, refer to Figure 2 The terminal receives a service request, and the terminal's IoT application then divides the service request into multiple tasks. The tasks are sent to the load balancer for decision-making, and the tasks are then distributed to edge nodes for processing, thereby completing the service request.
[0062] S200: Obtain queue information and task capacity of edge nodes.
[0063] In one specific embodiment, refer to Figure 3 The load balancer obtains the queue information of the edge nodes from the edge nodes, and then constructs a network mapping based on the queue information. The queue information of the edge nodes can then be obtained through the network mapping. The task capacity is the number of tasks that the edge nodes can handle. Based on the task capacity and queue information, the task requirements of the edge nodes can be determined. Based on the task requirements, the number of tasks in the current queue of the edge node, and resource characteristics, the task is selected to be offloaded to the edge node with the lowest latency.
[0064] S300. Construct an MDP model by inputting the queue information and task capacity into the MDP model, which includes a state space and an action space.
[0065] Specifically, the load balancing (LB) problem can be formulated as a Markov decision process (MDP). MDP involves a decision agent that, for each generated workload, repeatedly observes the current state *s* of the controlled system and takes a choice action *a*, thus creating a transition to a new state *s'*. This process also generates a reward *r* that influences subsequent decisions. In this system, the load balancer selects an action based on the current state, considering both the state and the rewards obtained from all edge nodes.
[0066] Optionally, the construction of the MDP model specifically includes:
[0067] S310. Construct the state space of the MDP model, the state space including the service requests allocated per unit time, the edge nodes that have completed the service requests, and the remaining unprocessed tasks in the edge nodes;
[0068] S320. Construct the action space of the MDP model, the action space including the selection action, the selection action selecting the edge node that receives the task;
[0069] S330. Determine the state transition probability based on the selected action;
[0070] S340. Construct the reward rule for the selected action.
[0071] Specifically, the MDP model is a four-tuple model.<S,A,P,R> , where S = {s = (n l The state space is {n, ω, Q}. l ∈(1≤n l ω ≤ N) are the nodes to which service requests can be sent, where N represents the upper limit of the number of nodes, and ω ∈ (1 ≤ ω ≤ W). max W represents the number of service requests allocated per unit of time. max This represents the upper limit of the number of service requests allocated per unit of time, Q = {Q1, Q2, LQ} N |Q i ∈{0,1,LQ max}} represents the remaining unprocessed tasks in the node queue, Q N Q represents the remaining unprocessed tasks in the node queue of edge node N. max This indicates the maximum number of tasks remaining to be processed in the node queue.
[0072] A = {a = (n l ,ω l )} represents the action space, where ω l ∈(1≤ω l ≤W max) indicates that the load needs to be unloaded to the edge node n. l The number of service requests. A(s) is a set of actions that can be taken in state s. A(s) is defined as the load balancer only being able to distribute loads to nodes n. l The node with the fewest pending tasks in the queue unloads the service request. Based on the action 'a' chosen by the decision agent, node n... l The queue space determines the number of service requests to be processed.
[0073] P:S×A×S→[0,1] is the probability P of moving from state s to the new state s' after taking action a. a (s,s').
[0074] R: S × A → r is the reward r when the system is in state s and takes action a. First, the agent observes the current state and reward from the environment. To minimize waiting latency, the immediate reward is defined by increasing or decreasing the number of tasks queued in the node queue. Define the immediate reward function given action a in state s.
[0075] R(s,a) = U(s,a) - (D(s,a) + O(s,a)), where U(s,a) represents the immediate benefit of choosing action a given state s, D(s,a) represents the immediate delay of choosing action a given state s, and O(s,a) represents the overload probability of choosing action a given state s. This yields the MDP model.<S,A,P,R> .
[0076] S400: Determine the edge node that receives the task based on the state space, determine the selection action based on the action space, and select the edge node.
[0077] Specifically, based on the established MDP model and the obtained queue information and task capacity of the edge nodes, n is obtained. l ∈(1≤n l ≤N) nodes, that is, edge nodes that can receive tasks; based on the action space of the MDP model, the queue information of the obtained edge nodes and the task capacity, determine the action selection and select the edge node.
[0078] Optionally, determining the selection action and selecting the edge node based on the action space specifically includes:
[0079] S410. Obtain the edge action space based on the queue information, the task capacity, and the action space;
[0080] S420. Determine the selection action based on the edge action space and the decision agent, and select the edge node through the selection action.
[0081] Specifically, the acquired queue information and task capacity are input into the established action space to obtain the edge action space corresponding to the existing edge nodes. After the decision agent makes a decision in the edge action space, it determines the action to be selected and performs the action to unload the corresponding task to the corresponding edge node.
[0082] S500: Determine the selected reward based on the selected action and the preset reward rules.
[0083] Specifically, after selecting an action, a corresponding reward is obtained. Based on the reward, the selected action can be adjusted in a timely manner to minimize delay.
[0084] Optionally, determining the selection reward based on the selection action and preset reward rules specifically includes:
[0085] S510. Obtain the immediate benefit, immediate delay, and overload probability corresponding to the selected action;
[0086] S520. Determine the selection reward based on the immediate benefit, the immediate delay, and the overload probability.
[0087] Specifically, the immediate benefit U(s,a):
[0088] U(s,a)=r u log(1+ω l )
[0089] Where, r u It's a performance-based reward.
[0090] Instantaneous delay D(s,a):
[0091]
[0092] Where, φ d It is a delayed weight.
[0093] Specifically, t ω It is an edge node n l Average waiting time in the queue:
[0094]
[0095] Where, μ l It is an edge node n l The computing service rate, where I is the number of instructions per task, and Q is the computational service rate. l 'Represents edge node n l In state s, the estimated queue state is used to perform the selection action a.
[0096] t c This refers to the communication time when the service requests to be unloaded.
[0097]
[0098] Where AD is the average data volume of a single task, r LBR,l The transmission service rate from the load balancer to the edge node.
[0099] It is the execution time of the load balancer's service offloading request.
[0100]
[0101] Where I is the number of instructions per task, CPI is the CPU (Central Processing Unit) cycle per instruction, and f LBR It is the CPU speed of the load balancer.
[0102] Overload probability O(s,a):
[0103]
[0104]
[0105]
[0106] Where, φ o Indicates overload weight; λ l Indicates reaching node n l The task arrival rate can be simulated using a Poisson process; Q' l Represents edge node n l In state s, perform the next estimated queue state for selection action a; Represents edge node n l Average computing service rate; P overload,l Represents edge node n l Overload; Q l,max Represents edge node n l In state s, the maximum estimated queue state for the selection action a is executed; max() represents taking the maximum value, and min() represents taking the minimum value.
[0107] S600. Construct a target function, and calculate the average latency of the unloading task based on the target function and the selected reward.
[0108] Specifically, the objective of this application is to optimize the algorithm used by the load balancer in the edge environment by using the resource capacity (task capacity) of the edge nodes as a constraint, thereby shortening the time for selecting the best processing node for service requests and reducing the processing latency of service requests sent by applications throughout the system. The service latency of an IoT node is the time required for a service request, i.e., the time interval between the IoT node sending the service request and receiving the response. The average latency for the load balancer to offload service requests to edge nodes is calculated by constructing an objective function; that is, the latency for offloading the task corresponding to the service request to the edge nodes.
[0109] Optionally, calculating the average latency of the unloading task based on the objective function and the selected reward specifically includes:
[0110] S610. Obtain the total delay for uninstalling a single task based on the selected reward;
[0111] S620. Determine the average latency based on the total latency of unloading a single task and the number of tasks unloaded, wherein the number of tasks unloaded represents the number of tasks unloaded.
[0112] Specifically, the objective function can be defined as:
[0113]
[0114] Where T is the average time delay, t q It is the total latency for unloading a single task, t q Defined as follows;
[0115]
[0116] During this process, the number of tasks to be offloaded by the load balancer cannot exceed the task capacity of the corresponding edge node. This is a constraint on the internal algorithm of the load balancer, as shown in the following formula:
[0117]
[0118] Where, ω q Indicates the task that the load balancer wants to offload, C j This represents the task capacity of the edge node. The average latency for unloading tasks is calculated using the formula above.
[0119] In one specific embodiment, the overall latency also includes the latency of the application sending data to the load balancer: if the application is in an IoT cluster, the interaction between the IoT cluster and the edge environment is through a single link l. The load balancer can be viewed as a special edge node n. LBR It also exists in the edge environment, so from IoT application i to load balancer n LBRDelay The sending delay of application i and propagation delay in the link The composition is shown in the following formula:
[0120]
[0121] in, It is the transmission delay, which is only related to the size of the data and the bandwidth. It is the propagation delay, which is only related to the transmission distance, that is, the length of link l.
[0122] edge node n l Execution latency of medium-duration tasks:
[0123] Execution latency consists of two parts: queuing time t. ω and processing time t p The waiting time (t) has already been given. ω Therefore, the processing latency of tasks on edge nodes is modeled, where task processing latency = task complexity / computing power of edge nodes.
[0124] First, we model the complexity C of the task:
[0125]
[0126] Where AD is the average data volume of the task, CD is the computational density required by the task, which refers to the ratio of the amount of computation required to process the data volume when processing the task, usually expressed in Flops / Byte (floating-point operations per byte) or Flops / Bit (floating-point operations per bit), O represents the number of operations of the task, and P represents the processing capacity of the edge node.
[0127] By introducing abstract features of hardware and resources, edge node n can be... l The processing capacity P is described as follows:
[0128]
[0129] Computing power can be measured by metrics such as the frequency, number of cores, and instruction set of a device's CPU / GPU, typically measured in Flops (floating-point operations per second). Storage capacity can be measured by the device's memory capacity and storage speed, typically measured in GB or MB / s (data transfer rate per second). Network bandwidth can be measured by the network connection speed and bandwidth between the device and the cloud or other devices, typically measured in Mbps or Gbps (data transfer rate per second). Therefore, each metric can be further subdivided as follows:
[0130] calculate:{f CPU ,f GPU ,cores,instruction set}
[0131] storage:{memory capacity,memory bandwidth}
[0132] network:{internet speed,network bandwidth}
[0133] Among them, f CPU f represents the CPU processor frequency. GPU The parameters are as follows: GPU processor frequency (usually in GHz); cores (usually an integer); instruction set (usually the processor's instruction set, which can be described by information such as instruction set type and version number); memory capacity (usually in GB); memory bandwidth (usually in GB / s); internet speed (usually in Mbps and Gbps); and network bandwidth (usually in GB / s).
[0134] Therefore, considering both computing and network resources, the task processing latency t p It can be described by the following formula.
[0135]
[0136] Task execution delay for
[0137]
[0138] The latency for edge nodes to send processing results back to the application:
[0139] When the service request is completed, edge node n l The processing result is sent back to the IoT application i. The latency in this process consists of two parts: transmission latency and propagation latency, as shown in the following formula.
[0140]
[0141] in, Represents edge node n l The latency of sending the processing result back to IoT application i Indicates the transmission delay. Indicates the propagation delay.
[0142] Therefore, the time required to complete a service request in the entire system consists of four parts. See the following formula:
[0143]
[0144] Among them, t all Indicates the time required for the service request to complete.
[0145] S800, Determine the minimum value of the average delay based on the maximum action value.
[0146] Specifically, to minimize the objective function T, i.e., to maximize the expected sum of future rewards, the DRL (Deep Reinforcement Learning) agent, given a policy π(s) t Select an action while maximizing the action value function Q. π (s t ,a t This is also known as the Q-function. Therefore, under policy π, choosing action a in state s... t The value of the following is:
[0147] Q π (s t ,a t )=E(R t |s i =s,a i =a)
[0148] Where R t Defined as selecting action a in state s t The expected sum of future rewards; E() represents the expected sum of the maximum future rewards; s i Indicates the state of future rewards, a i The action of choosing future rewards.
[0149] An optimal strategy is to choose the action with the highest value in each state, such as:
[0150]
[0151] Where a' is the set of all possible choices, and arg() represents the complex argument function; Q(s) represents the highest value selected from set a'. t (a′) represents the set of actions a′ to be selected in state s. t The value of what is below.
[0152] Q-Learning is a classic model-free algorithm commonly used to find the optimal state-policy relationship for any MDP without an underlying policy. It updates the Q-function estimate for state s and the chosen action a, as shown in the following equation:
[0153]
[0154] Here, α is the learning rate (0 < α < 1), which is used to balance the weights of already learned content and the weights of new observations.
[0155] The simplest action selection rule is to choose the action with the highest estimated value, such as greedily selecting action 'a'. t =argmax a Q t (a) Greedy action selection always utilizes the current content to maximize immediate reward. A key method in Q-Learning is the ε-greedy algorithm, which is greedy in most cases, but in the case of a small probability ε, it randomly and independently selects actions from the action set with equal probability. Reinforcement learning refers to the high-probability actions in the ε-greedy algorithm as the exploitation policy and the low-probability actions as the exploration policy. The exploitation policy is the correct action that maximizes the expected reward at each step, while the exploration policy may produce greater rewards in the long run. In summary, the advantage of the ε-greedy algorithm is that, with an increasing number of iterations, each action will be selected an infinite number of times, thus guaranteeing that Q(s,a) converges to the optimal value.
[0156] S900. Determine the unloading edge node based on the minimum value of the average delay, and unload the task value to the unloading edge node.
[0157] Specifically, once Q(s,a) converges to its optimal value, the unloading edge node can be determined, and the task can be unloaded to the unloading edge node to complete load balancing and minimize the overall latency.
[0158] Optionally, the method further includes:
[0159] S910. Deploy the Docker engine on the edge node;
[0160] S920, To enable Docker to package the task, the task's dependencies, and the operating system into a Docker image, and to upload the Docker image to Docker's repository;
[0161] S930, so that the edge node obtains the Docker image from the Docker repository.
[0162] Specifically, the task deployment process is optimized using container technology. First, a Docker engine is deployed on the edge nodes. Docker packages different tasks, their dependencies, and operating systems into Docker images and uploads them to the Docker repository. In this case, any edge node with a Docker engine can obtain a Docker image from the Docker repository and run the task locally. Furthermore, the introduction of hardware and resource abstraction homogenizes edge devices, reducing computational complexity and improving scalability.
[0163] Implementing this embodiment of the invention provides the following beneficial effects: A load balancing method for distributed edge nodes of industrial software components in this embodiment includes: obtaining service requests from terminals and selecting tasks based on the service requests; obtaining queue information and task capacity of edge nodes; constructing an MDP model, inputting the queue information and task capacity into the MDP model, the MDP model including a state space and an action space; determining the edge node receiving the task based on the state space, determining a selection action based on the action space and selecting the edge node; determining a selection reward based on the selection action and a preset reward rule; constructing an objective function, calculating the average latency of unloading the task based on the objective function and the selection reward; constructing a DQN algorithm model, solving for the maximum action value of the selected action based on the DQN algorithm model; determining the minimum average latency based on the maximum action value; determining the unloading edge node based on the minimum average latency, and unloading the task to the unloading edge node. By processing the task using the MDP model, objective function, and DQN algorithm model, the task is unloaded to the most suitable edge node, obtaining the minimum average latency, thus better reducing task processing latency and improving deployment efficiency.
[0164] like Figure 4 As shown, this embodiment of the invention also provides a load balancing system for distributed edge nodes of industrial software components, including:
[0165] The first module is used to obtain service requests from the terminal and select tasks based on the service requests.
[0166] The second module is used to obtain queue information and task capacity of edge nodes;
[0167] The third module is used to construct the MDP model. The queue information and task capacity are input into the MDP model, which includes a state space and an action space.
[0168] The fourth module is used to determine the edge node that receives the task based on the state space, and to determine the selection action and select the edge node based on the action space.
[0169] The fifth module is used to determine the selection reward based on the selection action and the preset reward rules;
[0170] The sixth module is used to construct an objective function and calculate the average latency of the unloading task based on the objective function and the selected reward.
[0171] The seventh module is used to construct the DQN algorithm model and solve for the maximum action value of the selected action based on the DQN algorithm model.
[0172] The eighth module is used to determine the minimum value of the average delay based on the maximum action value;
[0173] The ninth module is used to determine the unloading edge node based on the minimum value of the average latency, and to unload the task value to the unloading edge node.
[0174] It is evident that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0175] like Figure 5 As shown, this embodiment of the invention also provides a load balancing device for distributed edge nodes of industrial software components, comprising:
[0176] At least one processor;
[0177] At least one memory for storing at least one program;
[0178] When the at least one program is executed by the at least one processor, the at least one processor performs the method steps described in the above method embodiments.
[0179] It is evident that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented in this device embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0180] Furthermore, this application also discloses a computer program product or computer program stored in a computer-readable storage medium. A processor of a computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, causing the computer device to perform the described method. Similarly, the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0181] It is understood that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0182] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A load balancing method for distributed edge nodes of industrial software components, characterized in that, include: Obtain the service request from the terminal, and select a task based on the service request; Obtain queue information and task capacity of edge nodes; Construct an MDP model by inputting the queue information and task capacity into the MDP model, which includes a state space and an action space. The edge node receiving the task is determined based on the state space, and the selection action is determined based on the action space, and the edge node is selected. The reward is determined based on the selected action and the preset reward rules; Construct an objective function, and calculate the average latency for unloading the task based on the objective function and the selected reward; Construct a DQN algorithm model, and solve the maximum action value of the selected action based on the DQN algorithm model; The minimum value of the average delay is determined based on the maximum action value; The unloading edge node is determined based on the minimum value of the average latency, and the task is unloaded to the unloading edge node; The construction of the MDP model specifically includes: constructing the state space of the MDP model, wherein the state space includes the service requests allocated per unit time, the edge nodes that have completed the service requests, and the remaining unprocessed tasks in the edge nodes; Construct the action space of the MDP model, the action space including the selection action, the selection action selecting the edge node to receive the task; determine the state transition probability based on the selection action; construct the reward rule for the selection action.
2. The method according to claim 1, characterized in that, The step of determining the edge node receiving the task based on the state space specifically includes: The edge state space is obtained based on the queue information, the task capacity, and the state space; The edge node that receives the task is obtained from the edge state space.
3. The method according to claim 1, characterized in that, The step of determining the selection action and selecting the edge node based on the action space specifically includes: The edge action space is obtained based on the queue information, the task capacity, and the action space; The selection action is determined based on the edge action space and the decision agent, and the edge node is selected through the selection action.
4. The method according to claim 1, characterized in that, The step of determining the selection reward based on the selected action and preset reward rules specifically includes: Obtain the immediate benefits, immediate latency, and overload probability corresponding to the selected action; The selection reward is determined based on the immediate benefit, the immediate delay, and the overload probability.
5. The method according to claim 1, characterized in that, The step of calculating the average latency of the unloading task based on the objective function and the selected reward specifically includes: The total delay for uninstalling a single task is obtained based on the selected reward. The average latency is determined based on the total latency of unloading a single task and the number of tasks unloaded, where the number of tasks unloaded represents the number of tasks unloaded.
6. The method according to claim 1, characterized in that, The method further includes: Deploy the Docker engine on the edge node; This enables Docker to package the task, the task's dependencies, and the operating system into a Docker image, and then upload the Docker image to Docker's repository; This enables the edge node to retrieve the Docker image from the Docker repository.
7. A load balancing system for distributed edge nodes of industrial software components, characterized in that, include: The first module is used to obtain service requests from the terminal and select tasks based on the service requests. The second module is used to obtain queue information and task capacity of edge nodes; The third module is used to construct the MDP model. The queue information and task capacity are input into the MDP model, which includes a state space and an action space. The construction of the MDP model specifically includes: constructing the state space of the MDP model, the state space including the service requests allocated per unit time, the edge nodes that complete the service requests, and the remaining pending tasks in the edge nodes; constructing the action space of the MDP model, the action space including selection actions, the selection actions selecting the edge nodes that receive the tasks; determining the state transition probability based on the selection actions; and constructing the reward rules for the selection actions. The fourth module is used to determine the edge node that receives the task based on the state space, and to determine the selection action and select the edge node based on the action space. The fifth module is used to determine the selection reward based on the selection action and the preset reward rules; The sixth module is used to construct an objective function and calculate the average latency of the unloading task based on the objective function and the selected reward. The seventh module is used to construct the DQN algorithm model and solve for the maximum action value of the selected action based on the DQN algorithm model. The eighth module is used to determine the minimum value of the average delay based on the maximum action value; The ninth module is used to determine the unloading edge node based on the minimum value of the average latency, and to unload the task value to the unloading edge node.
8. A load balancing device for distributed edge nodes of industrial software components, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method as described in any one of claims 1-6.
9. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to perform the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Service migration method and system of edge server and edge server equipment
CN115334076A
Joint optimization method for computing task unloading of Internet of Vehicles
CN116360883A