Edge computing task allocation method, device and system, storage medium and product
By introducing audit nodes and leadership nodes into edge clusters, the fairness and consistency of edge computing task allocation in dynamic and unreliable network environments are solved, and the accuracy and efficiency of tasks are achieved.
Patent Information
- Application Number
- CN202411693783.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-02-28
AI Technical Summary
Existing edge computing task allocation schemes cannot ensure fairness and consistency of task allocation in dynamic and unreliable network environments.
By introducing audit nodes and leadership nodes into the edge cluster, the audit node is responsible for registration and log supervision of edge nodes. The leadership node splits the task into subtasks and assigns it to multiple edge nodes for processing, and checksums and integrates the subtask results.
It realizes fairness and consistency in task allocation in dynamic and unreliable network environments, ensures task accuracy and efficiency, and prevents malicious nodes from damaging the availability of edge clusters.
Smart Images

Figure CN119537024A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet of Things technology, and in particular to an edge computing task allocation method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] Edge computing (EC) can use wireless access networks to provide users with the services and cloud computing functions they need nearby, thereby creating a service environment with high performance, low latency and high bandwidth, accelerating the rapid download of various content, services and applications in the network, allowing consumers to enjoy an uninterrupted high-quality network experience.
[0003] With the rapid development of edge computing in IoT applications, more and more terminal devices are joining the edge computing model. Compared with remote cloud computing devices, edge devices have limited computing resources and are often unable to handle computing-intensive tasks independently. Therefore, edge devices need to work together to complete complex computing tasks.
[0004] However, current edge computing task allocation schemes cannot guarantee the fairness and consistency of task allocation in dynamic and unreliable network environments. Summary of the invention
[0005] Based on this, it is necessary to provide an edge computing task allocation method, device, computer equipment, computer-readable storage medium and computer program product that can ensure fairness and consistency in a dynamic and unreliable network environment in response to the above-mentioned technical problems.
[0006] In a first aspect, the present application provides an edge computing task allocation method, which is applied in an edge cluster, wherein the edge cluster includes: an audit node, a leader node, and multiple edge nodes, and the method includes:
[0007] The audit node obtains registration information sent by each edge node;
[0008] The audit node registers all edge nodes joining the edge cluster according to the registration information;
[0009] The leader node splits the task into multiple subtasks, and assigns the subtasks to at least two edge nodes that have completed registration;
[0010] The leader node verifies the correctness of the execution results of the subtasks, and integrates the subtasks whose verification results are correct to obtain the integrated task results;
[0011] The leader node sends the integrated task results to the user end.
[0012] In one embodiment, the audit node obtains registration information sent by each edge node, including:
[0013] When joining the edge cluster, the edge node sends registration information to the audit node, where the registration information includes: the geographical location of the edge node itself, computing resources, and the type of computing resources;
[0014] The audit node receives the registration information.
[0015] In one embodiment, the leader node splits the task into multiple subtasks and assigns the subtasks to at least two edge nodes that have completed the registration, including:
[0016] The leader node splits the task initiated by the user end into multiple subtasks;
[0017] The leader node distributes the subtask to at least two edge nodes that have completed registration, wherein the same subtask is distributed to at least two edge nodes for processing.
[0018] In one embodiment, the method further comprises:
[0019] The audit node obtains the hash value of the log of the leader node within a preset time period;
[0020] If the hash value of the log changes, the leader node will be re-elected and the original leader node will be penalized.
[0021] In one embodiment, the method further comprises:
[0022] The audit node receives a leader node election request initiated by the edge node;
[0023] The audit node determines whether the re-election condition is met according to the leader node election request;
[0024] If the re-election conditions are met, the election of the leader node is allowed;
[0025] If the re-election conditions are not met, the edge node that initiated the leader node election request will be penalized and deducted points; wherein the re-election conditions include:
[0026] The audit node has lost contact with the original leader node, and / or
[0027] The audit node is not disconnected from the original leader node, and more than 1 / 3 of the edge nodes initiate the leader node election request.
[0028] In one embodiment, if the audit node allows the election of a leader node, the method further includes:
[0029] The points of the edge node are determined according to the positive scores and penalty points of each edge node; the positive scores include: user scores and scores between nodes; the user scores include: when the edge node is used as an execution node, the user's score of the execution node's task execution accuracy and the score of the task execution time; the scores between nodes include: when the edge node is used as a leader node, the execution node's score of the leader node, the efficiency score of the task execution when the edge node is used as an execution node, and the accuracy score of the task execution;
[0030] Each edge node sends its own points to other edge nodes in a broadcast manner, and the audit node supervises the points broadcast by each edge node;
[0031] Each edge node votes according to the points received and feeds back the voting results to the audit node;
[0032] The audit node obtains the voting results of all edge nodes, and performs weighted processing on the voting results according to the weights corresponding to the edge nodes to obtain weighted voting results; wherein, the edge nodes with higher scores have higher corresponding weights;
[0033] The audit node determines the edge node with the highest number of votes as the new leader node according to the weighted voting result;
[0034] If the number of edge nodes with the highest number of votes is greater than 1, one of the edge nodes is randomly selected as the new leader node.
[0035] In a second aspect, the present application further provides an edge computing task allocation device, which is applied in an edge cluster, and the device includes:
[0036] The acquisition module is used to obtain the registration information sent by each edge node;
[0037] A registration module, used to register all edge nodes joining the edge cluster according to the registration information;
[0038] A task allocation module, used for splitting a task into multiple subtasks, and allocating the subtasks to at least two edge nodes that have completed registration;
[0039] The verification module is used to verify the correctness of the execution results of the subtasks, and integrate the subtasks with correct verification results to obtain the integrated task results;
[0040] The sending module is used to send the integrated task results to the user end.
[0041] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0042] Get the registration information sent by each edge node;
[0043] Register all edge nodes joining the edge cluster according to the registration information;
[0044] Splitting the task into multiple subtasks, and assigning the subtasks to at least two edge nodes that have completed registration;
[0045] Verify the correctness of the execution results of the subtasks, and integrate the subtasks with correct verification results to obtain the integrated task results;
[0046] The integrated task results are sent to the user end.
[0047] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0048] Get the registration information sent by each edge node;
[0049] Register all edge nodes joining the edge cluster according to the registration information;
[0050] Splitting the task into multiple subtasks, and assigning the subtasks to at least two edge nodes that have completed registration;
[0051] Verify the correctness of the execution results of the subtasks, and integrate the subtasks with correct verification results to obtain the integrated task results;
[0052] The integrated task results are sent to the user end.
[0053] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0054] Get the registration information sent by each edge node;
[0055] Register all edge nodes joining the edge cluster according to the registration information;
[0056] Splitting the task into multiple subtasks, and assigning the subtasks to at least two edge nodes that have completed registration;
[0057] Verify the correctness of the execution results of the subtasks, and integrate the subtasks with correct verification results to obtain the integrated task results;
[0058] The integrated task results are sent to the user end.
[0059] The above-mentioned edge computing task allocation method, device, system, storage medium and product are applied in an edge cluster, wherein the edge cluster includes: an audit node, a leader node, and multiple edge nodes, and the audit node obtains the registration information sent by each edge node; the audit node registers all edge nodes joining the edge cluster according to the registration information; thus, the audit node can register the information of each edge node, which is convenient for cluster management. The leader node splits the task into multiple subtasks and assigns the subtasks to at least two edge nodes that have completed the registration; thus, the task can be split, the task execution can be refined, and the computing resources of each edge node can be fully utilized. The leader node verifies the correctness of the execution results of the subtasks, and integrates the subtasks with correct verification results to obtain the integrated task results; the leader node sends the integrated task results to the user end. Thus, multiple edge nodes can work as a collaborative whole, so that the edge cluster can adapt to dynamic node changes, and whether the edge node exits or joins, it can quickly reach a consensus, ensuring the fairness and consistency of task allocation in a dynamic and unreliable network environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0061] Figure 1 An application environment diagram of an edge computing task allocation method in one embodiment;
[0062] Figure 2 A schematic diagram of a process flow of an edge computing task allocation method in one embodiment;
[0063] Figure 3 A flowchart of an edge computing task allocation method in another embodiment;
[0064] Figure 4A flowchart of an edge computing task allocation method in another embodiment;
[0065] Figure 5 for Figure 4 A schematic diagram of the process of step 408 in the embodiment;
[0066] Figure 6 It is a structural block diagram of an edge computing task allocation device in one embodiment;
[0067] Figure 7 It is a structural block diagram of an edge computing task allocation device in another embodiment;
[0068] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0070] The edge computing task allocation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the user terminal 101 communicates with the edge cluster 102 through the network. The edge cluster 102 includes multiple edge nodes (i.e., edge computing devices). According to the function, a leader node can be elected from these edge nodes, and an audit node is set to supervise the leader node and edge nodes. Exemplarily, the audit node obtains the registration information sent by each edge node; the audit node registers all edge nodes joining the edge cluster according to the registration information; the leader node splits the task into multiple subtasks and assigns the subtasks to at least two edge nodes that have completed the registration; the leader node verifies the correctness of the execution results of the subtasks, and integrates the subtasks with correct verification results to obtain the integrated task results; the leader node sends the integrated task results to the user terminal. Among them, the edge nodes in the edge cluster 102 can be, but are not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head mounted device may be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc.
[0071] In an exemplary embodiment, Figure 2 As shown, a method for allocating edge computing tasks is provided, which is applied to Figure 1 Taking the edge cluster in FIG. 1 as an example, the method includes the following steps 201 to 205. Among them:
[0072] Step 201: The audit node obtains registration information sent by each edge node.
[0073] The audit node may be a device with computing capabilities, which can supervise the edge nodes in the edge cluster. Optionally, at least one edge node may be selected from the original edge cluster to serve as an audit node.
[0074] For example, in an area, there may be a large number of edge devices, such as edge cameras and sensors, which work together to complete complex tasks such as environmental detection and data processing. Assuming that there are multiple edge nodes in an edge cluster, the edge node set can be expressed as N = {n1, n2, ..., n k}, the total number of edge nodes in this edge cluster is k, n i is the i-th edge node in the set of edge nodes.
[0075] In this embodiment, in order to effectively allocate tasks, coordinate cooperation between devices and verify calculation results, the Raft consensus protocol can be introduced. Among them, the consistency algorithm of the Raft consensus protocol allows multiple nodes to work together as a whole, and when some edge nodes in the cluster join or exit, the entire cluster can quickly reach a consensus and continue to provide services.
[0076] Exemplarily, when joining the edge cluster, the edge node sends registration information to the audit node, the registration information including: the geographical location of the edge node itself, computing resources, and the type of computing resources; the audit node receives the registration information.
[0077] Step 202: The audit node registers all edge nodes that join the edge cluster according to the registration information.
[0078] In this embodiment, the audit node registers and registers all edge nodes, so as to facilitate the subsequent node management and supervision within the cluster. When the edge node is used as a leader node, the audit node inspects the leadership behavior of the leader node.
[0079] Step 203: The leader node splits the task into multiple subtasks and assigns the subtasks to at least two edge nodes that have completed registration.
[0080] Exemplarily, the leading node splits the task initiated by the user terminal into multiple subtasks; the leading node assigns the subtasks to at least two edge nodes that have completed registration, wherein the same subtask is assigned to at least two edge nodes for processing.
[0081] In this embodiment, a redundancy mechanism is used to distribute one subtask to multiple subtasks for execution, and finally the results are compared, so that the correctness of each subtask result can be guaranteed.
[0082] Step 204: The leader node verifies the correctness of the execution results of the subtasks, and integrates the subtasks with correct verification results to obtain integrated task results.
[0083] In this embodiment, the leading node also performs a correctness check on the execution results of each subtask. For example, when two or more execution nodes execute the same subtask and the execution results fed back are the same, it is generally considered that the execution result is correct. If two or more execution nodes execute the same subtask and the execution results fed back are different, it is considered that there is an error in the execution node. Furthermore, the execution results corresponding to the split subtasks are integrated and processed to obtain the execution results corresponding to the original complete task.
[0084] Step 205: The leader node sends the integrated task results to the user end.
[0085] In this embodiment, the leader node sends the final integrated task result to the user terminal that initiated the task.
[0086] In this embodiment, by assigning tasks through leader acceptance of orders and verifying the execution results, the rationality and accuracy of task assignment can be ensured, and malicious nodes can be prevented from destroying the availability of the edge cluster.
[0087] The above-mentioned edge computing task allocation method is applied in an edge cluster, and the edge cluster includes: an audit node, a leader node, and multiple edge nodes. The audit node obtains the registration information sent by each edge node; the audit node registers all edge nodes joining the edge cluster according to the registration information; thus, the audit node can register the information of each edge node, which is convenient for cluster management. The leader node splits the task into multiple subtasks and assigns the subtasks to at least two edge nodes that have completed the registration; thus, the task can be split, the task execution can be refined, and the computing resources of each edge node can be fully utilized. The leader node verifies the correctness of the execution results of the subtasks, and integrates the subtasks with correct verification results to obtain the integrated task results; the leader node sends the integrated task results to the user end. Thus, multiple edge nodes can work as a collaborative whole, so that the edge cluster can adapt to dynamic node changes, whether the edge node exits or joins, it can quickly reach a consensus, and ensure the fairness and consistency of task allocation in a dynamic and unreliable network environment.
[0088] In another exemplary embodiment, Figure 3 As shown, a method for allocating edge computing tasks is provided, which is applied to Figure 1 The edge cluster in FIG. 1 is taken as an example to illustrate, including the following steps 301 to 307. Among them:
[0089] Step 301: The audit node obtains registration information sent by each edge node.
[0090] Step 302: The audit node registers all edge nodes that join the edge cluster according to the registration information.
[0091] Step 303: The leader node splits the task into multiple subtasks and assigns the subtasks to at least two edge nodes that have completed registration.
[0092] Step 304: The leader node verifies the correctness of the execution results of the subtasks, and integrates the subtasks with correct verification results to obtain integrated task results.
[0093] Step 305: The leader node sends the integrated task results to the user end.
[0094] In this embodiment, the specific implementation process and technical effects of steps 301 to 305 are shown in Figure 2 The descriptions of steps 201 to 205 in the illustrated method embodiment are not repeated here.
[0095] Step 306: The audit node obtains the hash value of the leader node's log within a preset time period.
[0096] In this embodiment, in order to prevent malicious nodes from modifying logs, the audit node needs to patrol and supervise the leader node; the audit node records the hash value of the log and randomly checks the hash value of the leader node's log for a period of time.
[0097] Step 307: If the hash value of the log changes, a new leader node is elected and the original leader node is penalized.
[0098] In this embodiment, if the hash value changes, the leader node can be re-elected and the original leader node can be penalized and deducted, so that the original leader node forms a penalty and deduction record.
[0099] In this embodiment, the audit node regularly inspects and supervises the behavior of the leader node, and if the hash value of the leader node log is found to have changed, a re-election of the leader node is initiated, thereby ensuring the fairness of the leader node task allocation.
[0100] In yet another exemplary embodiment, Figure 4 As shown, a method for allocating edge computing tasks is provided, which is applied to Figure 1 Taking the edge cluster in FIG. 1 as an example, the method includes the following steps 401 to 409. Among them:
[0101] Step 401: The audit node obtains registration information sent by each edge node.
[0102] Step 402: The audit node registers all edge nodes that join the edge cluster according to the registration information.
[0103] Step 403: The leader node splits the task into multiple subtasks and assigns the subtasks to at least two edge nodes that have completed registration.
[0104] Step 404: The leader node verifies the correctness of the execution results of the subtasks, and integrates the subtasks with correct verification results to obtain integrated task results.
[0105] Step 405: The leader node sends the integrated task results to the user end.
[0106] In this embodiment, the specific implementation process and technical effects of steps 401 to 405 are shown in Figure 2 The descriptions of steps 201 to 205 in the illustrated method embodiment are not repeated here.
[0107] Step 406: The audit node receives a leader node election request initiated by the edge node.
[0108] In this embodiment, in order to prevent the edge node from maliciously initiating an election, the audit node will check each leader node selection request initiated by the edge node. Exemplarily, the audit log of the edge node that initiated the leader node selection can be checked.
[0109] Step 407, the audit node determines whether the re-election conditions are met based on the leader node election request, and if so, executes step 408, if not, executes step 409.
[0110] In this embodiment, the re-election conditions include:
[0111] The audit node has lost connection with the original leader node, and / or the audit node has not lost connection with the original leader node, and more than 1 / 3 of the edge nodes initiate the leader node election request.
[0112] For example, if the audit node is disconnected from the original leader node, it agrees to re-elect the leader node. If the audit node is not disconnected from the previous leader, and less than 1 / 3 of the nodes have initiated a re-election, the node that re-initiates the election will be penalized. If the audit node is not disconnected from the original leader node, but more than 1 / 3 of the nodes have initiated a re-election, the leader node election will be re-performed.
[0113] Step 408, allowing the election of a leader node to proceed.
[0114] For example, the specific implementation process of step 408 is as follows: Figure 5 As shown, the following steps may be included:
[0115] Step 4081, determine the score of the edge node according to the positive score and penalty points of each edge node.
[0116] Among them, the positive rating includes: user rating and rating between nodes; the user rating includes: when the edge node acts as an execution node, the user's rating of the task execution accuracy of the execution node and the rating of the task execution time; the rating between nodes includes: when the edge node acts as a leader node, the execution node's rating of the leader node, when the edge node acts as an execution node, the efficiency rating of task execution and the accuracy rating of task execution.
[0117] In this embodiment, combined with Figure 2 In the description of the embodiment shown, when the Raft consensus protocol is introduced, in order to ensure fairness, a suitable leader needs to be selected when voting for the leader node. Therefore, this embodiment introduces point-weighted voting. This method can prevent malicious leaders from tampering with task logs.
[0118] For example, the positive rating of each node consists of two dimensions: one is the user's rating, and the other is the rating between nodes. When a user submits a task to the edge cluster, a task will be divided into multiple subtasks, and each subtask is assigned to a different edge node for execution. The user's rating of a task in the edge cluster is actually the rating of the leading node that dominates the task from allocation, execution, to integration. The rating mainly reflects the user's satisfaction and is affected by the overall task allocation, execution efficiency, execution accuracy, etc. For task J submitted by the user to the edge cluster for execution, G is used. i Represents the user's i Ratings, in is the user's satisfaction with the accuracy of task J execution, is the user's satisfaction with the execution time of task J.
[0119] Exemplarily, the scoring between nodes can be divided into two types: one is the evaluation of the task allocation of the leader node by other execution nodes when the node acts as a leader node; the other is the efficiency and accuracy of task execution when the node acts as an execution node.
[0120] In this embodiment, the evaluation of the leader node by the execution node consists of several aspects: on the one hand, the rationality of the subtask allocation, the tasks are divided into computing-intensive, IO-intensive, and data-intensive, and whether the assigned subtask type matches the node computing type; on the other hand, the network status of the leader node itself and whether the leader node forcibly synchronizes the unconsensus log behavior status; all execution nodes in edge computing evaluate the leader node n i The score is expressed as Where P is the score of the node given by the executing node m, and k is the total number of nodes in the edge cluster.
[0121] In this embodiment, for node n i For example, the accuracy of task execution is Where R i is node n i All the execution tasks assigned to R T i is node n i The number of correct task execution results; the efficiency of a node in executing tasks is obtained by a comprehensive comparison with the average execution time of other nodes; the lower the proportion of the time a node spends executing subtasks in the average execution time, the faster the execution speed; node n i The subtask assigned to execution is J, then node n i The execution efficiency is Where T J i is node n i The time to execute task J, is the average execution time of all nodes assigned to the task.
[0122] For example, node n i When acting as an execution node, the efficiency and accuracy of task execution are scored as Where β is the node n i The accuracy factor.
[0123] For example, in addition to scoring, nodes also include penalty points. The penalty points consist of two aspects: one is to monitor the leader node log situation, and the other is to monitor the re-election situation in the cluster. In the daily work of the audit node, each node's performance behavior is deducted according to the above situation. The audit node deducts points from the node n. i The penalty point record is D p i .
[0124] In this embodiment, node n i The final election score is composed of positive scores and penalty points: δ is the positive impact factor, γ is the penalty impact factor, is the user impact factor; where G i Represents the user's i Rating, L i is node n i When it is a leader node, the execution node evaluates it, E i is node n i When acting as an execution node, the efficiency and accuracy of task execution are scored, D p i is the audit node for node n i Penalty points deduction.
[0125] In step 4082, each edge node broadcasts its own points to other edge nodes, and the audit node supervises the points broadcast by each edge node.
[0126] In this embodiment, an audit node is introduced to supervise the election of leader nodes, which can prevent some nodes from initiating malicious or unnecessary leader elections.
[0127] In step 4083, each edge node votes according to the points received and feeds back the voting results to the audit node.
[0128] In this embodiment, the edge node may also directly perform weighted processing on the votes according to its own weight, and then directly feed back the weighted voting results to the audit node.
[0129] In step 4084, the audit node obtains the voting results of all edge nodes, and performs weighted processing on the voting results according to the weights corresponding to the edge nodes to obtain the weighted voting results.
[0130] Among them, the edge node with higher score has higher corresponding weight.
[0131] Step 4085: The audit node determines the edge node with the highest number of votes as the new leader node based on the weighted voting results.
[0132] Exemplarily, if the number of edge nodes with the highest number of votes is greater than 1, one of the edge nodes is randomly selected as the new leader node.
[0133] In this embodiment, the node casts votes for one or more high-score candidate nodes, and determines the object of support based on the number of weighted votes; at the same time, a minimum score threshold is set, and only nodes that reach this score are eligible to become candidates. The audit node collects the voting results of all nodes and counts the weighted votes; the node with a high score and the support of the majority of weighted votes becomes the leader.
[0134] Step 409: Penalize and deduct points from the edge node that initiated the leader node election request.
[0135] In this embodiment, if the leader node election request initiated by the edge node does not meet the re-election conditions, these edge nodes are considered malicious and are penalized and deducted. The penalty and deduction will affect the points of the corresponding edge node, thus forming a closed-loop constraint.
[0136] This embodiment introduces point-weighted voting to ensure that the Raft algorithm selects a suitable leader when voting for a leader node. The election is supervised by the audit node to prevent some nodes from initiating malicious or unnecessary leadership elections, thereby ensuring the rationality of the election and achieving effective allocation and execution of edge computing tasks.
[0137] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0138] Based on the same inventive concept, the embodiment of the present application also provides an edge computing task allocation device for implementing the edge computing task allocation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more edge computing task allocation devices provided below can refer to the limitations of the edge computing task allocation method above, and will not be repeated here.
[0139] In an exemplary embodiment, Figure 6 As shown, an edge computing task allocation device is provided, including: an acquisition module 601, a registration module 602, a task allocation module 603, a verification module 604 and a sending module 605, wherein:
[0140] The acquisition module 601 is used to acquire the registration information sent by each edge node;
[0141] A registration module 602 is used to register all edge nodes joining the edge cluster according to the registration information;
[0142] A task assignment module 603 is used to split a task into multiple subtasks and assign the subtasks to at least two edge nodes that have completed registration;
[0143] Verification module 604, used to verify the correctness of the execution results of the subtasks, and integrate the subtasks with correct verification results to obtain integrated task results;
[0144] The sending module 605 is used to send the integrated task result to the user end.
[0145] Exemplarily, the acquisition module 601 is specifically used to: when the edge node joins the edge cluster, send registration information to the audit node, the registration information includes: the edge node's own geographical location, computing resources, and type of computing resources; the audit node receives the registration information.
[0146] Exemplarily, the task assignment module 603 is specifically used to: split the task initiated by the user terminal through the leading node to obtain multiple subtasks; assign the subtasks to at least two edge nodes that have completed registration, wherein the same subtask is assigned to at least two edge nodes for processing.
[0147] Exemplarily, the acquisition module 601 is further used to: obtain the hash value of the log of the leader node within a preset time period; if the hash value of the log changes, re-elect the leader node and punish the original leader node.
[0148] In another exemplary embodiment, Figure 7 As shown, an edge computing task allocation device is provided. Figure 6 On the basis of the device shown, the device in this embodiment may further include:
[0149] The election request determination module 606 is used to receive the leader node election request initiated by the edge node; determine whether the re-election condition is met according to the leader node election request; if the re-election condition is met, the leader node election is allowed; if the re-election condition is not met, the edge node that initiated the leader node election request is penalized; wherein the re-election condition includes:
[0150] The audit node has lost contact with the original leader node, and / or
[0151] The audit node is not disconnected from the original leader node, and more than 1 / 3 of the edge nodes initiate the leader node election request.
[0152] Exemplarily, it may also include: an election module 607, which is used to determine the points of the edge node according to the positive score and penalty points of each edge node; the positive score includes: user score and score between nodes; the user score includes: when the edge node is an execution node, the user's score of the execution node's task execution accuracy and the score of the task execution time; the score between nodes includes: when the edge node is a leader node, the execution node's score of the leader node, when the edge node is an execution node, the efficiency score of the task execution and the accuracy score of the task execution; each edge node sends its points to other edge nodes in a broadcast manner. point, and the audit node supervises the points broadcast by each edge node; each edge node votes according to the received points and feeds back the voting results to the audit node; the audit node obtains the voting results of all edge nodes, and weights the voting results according to the weights corresponding to the edge nodes to obtain weighted voting results; wherein, the higher the points of the edge nodes, the higher the corresponding weights; the audit node determines the edge node with the highest number of votes as the new leader node according to the weighted voting results; if the number of edge nodes with the highest number of votes is greater than 1, one of the edge nodes is randomly selected as the new leader node.
[0153] Each module in the above-mentioned edge computing task allocation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0154] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for allocating edge computing tasks is implemented.
[0155] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0156] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0157] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0158] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0159] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0160] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0161] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0162] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for allocating edge computing tasks, characterized in that: Applied in an edge cluster, the edge cluster includes: an audit node, a leader node, and multiple edge nodes, the method includes: The audit node obtains registration information sent by each edge node; The audit node registers all edge nodes joining the edge cluster according to the registration information; The leader node splits the task into multiple subtasks, and assigns the subtasks to at least two edge nodes that have completed registration; The leader node verifies the correctness of the execution results of the subtasks, and integrates the subtasks whose verification results are correct to obtain the integrated task results; The leader node sends the integrated task results to the user end.
2. The method according to claim 1, characterized in that The audit node obtains registration information sent by each edge node, including: When joining the edge cluster, the edge node sends registration information to the audit node, where the registration information includes: the geographical location of the edge node itself, computing resources, and the type of computing resources; The audit node receives the registration information.
3. The method according to claim 1, characterized in that The leader node splits the task into multiple subtasks and assigns the subtasks to at least two edge nodes that have completed the registration, including: The leader node splits the task initiated by the user terminal to obtain multiple subtasks; The leader node distributes the subtask to at least two edge nodes that have completed registration, wherein the same subtask is distributed to at least two edge nodes for processing.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: The audit node obtains the hash value of the log of the leader node within a preset time period; If the hash value of the log changes, the leader node will be re-elected and the original leader node will be penalized.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: The audit node receives a leader node election request initiated by the edge node; The audit node determines whether the re-election condition is met according to the leader node election request; If the re-election conditions are met, the election of the leader node is allowed; If the re-election conditions are not met, the edge node that initiated the leader node election request will be penalized and deducted points; wherein the re-election conditions include: The audit node has lost contact with the original leader node, and / or The audit node is not disconnected from the original leader node, and more than 1 / 3 of the edge nodes initiate the leader node election request.
6. The method according to claim 5, characterized in that If the audit node allows the election of a leader node, the method further includes: The points of the edge node are determined according to the positive scores and penalty points of each edge node; the positive scores include: user scores and scores between nodes; the user scores include: when the edge node is used as an execution node, the user's score of the execution node's task execution accuracy and the score of the task execution time; the scores between nodes include: when the edge node is used as a leader node, the execution node's score of the leader node, the efficiency score of the task execution when the edge node is used as an execution node, and the accuracy score of the task execution; Each edge node sends its own points to other edge nodes in a broadcast manner, and the audit node supervises the points broadcast by each edge node; Each edge node votes according to the points received and feeds back the voting results to the audit node; The audit node obtains the voting results of all edge nodes, and performs weighted processing on the voting results according to the weights corresponding to the edge nodes to obtain weighted voting results; wherein, the edge nodes with higher scores have higher corresponding weights; The audit node determines the edge node with the highest number of votes as the new leader node according to the weighted voting result; If the number of edge nodes with the highest number of votes is greater than 1, one of the edge nodes is randomly selected as the new leader node.
7. An edge computing task allocation device, characterized in that: Applied in an edge cluster, the device includes: The acquisition module is used to obtain the registration information sent by each edge node; A registration module, used to register all edge nodes joining the edge cluster according to the registration information; A task allocation module, used for splitting a task into multiple subtasks, and allocating the subtasks to at least two edge nodes that have completed registration; The verification module is used to verify the correctness of the execution results of the subtasks, and integrate the subtasks with correct verification results to obtain the integrated task results; The sending module is used to send the integrated task results to the user end.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Dynamic task allocation method and device based on order dispatching and order grabbing
CN120297704A