A method for detecting and locating abnormal behavior of edge nodes suitable for task offloading scenarios
By combining the Raft protocol and the reputation mechanism, dynamic grouping and leader election of edge nodes are achieved. Combined with the replication mechanism and economic incentives, the problem of inaccurate reputation verification in multi-edge node task offloading is solved, thereby improving the security and efficiency of the system.
Patent Information
- Application Number
- CN202411925513.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-12-25
AI Technical Summary
In the prior art, in multi-edge node task offloading systems, the reputation verification of edge nodes is not accurate enough, and the abnormal behavior of malicious nodes cannot be effectively identified and prevented, resulting in system failures and erroneous data.
A method for detecting and locating abnormal behavior of edge nodes based on the Raft protocol and reputation mechanism (RRaft) is adopted. Through the registration, grouping, leader election and reputation management of edge nodes, combined with a replication mechanism and economic incentive mechanism, the accuracy of task results and system security are ensured.
It significantly improves node supervision efficiency and communication collaboration capabilities, quickly identifies and locates dishonest edge nodes, prevents collusion attacks, improves system security and reliability, reduces resource overhead, and optimizes task offloading processes.
Smart Images

Figure CN119696915B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computing technology, and in particular to a network service scenario in which edge computing tasks are offloaded, and specifically to a method for detecting and locating abnormal behavior of edge nodes suitable for task offloading scenarios. Background Art
[0002] In the new era of the Internet of Everything (IoE), the proliferation of smart mobile devices and IoT devices poses significant challenges to network bandwidth and service quality. Task offloading, as a core strategy in edge computing, demonstrates broad and profound application potential. Within the edge layer, comprised of multiple edge nodes, the collaborative operation of these nodes (i.e., edge-edge collaboration) is key to the technology's effectiveness. For example, in connected vehicles (IoV) applications, this technology enables vehicles to offload computationally intensive tasks such as high-definition map rendering and road condition analysis to edge nodes for collaborative processing. This reduces the onboard computing burden, reduces processing latency, and improves driving safety and efficiency. Furthermore, within computing networks, task offloading strategies intelligently allocate computing tasks to the most appropriate computing nodes, improving resource utilization, reducing costs, and enabling rapid response and efficient processing. Furthermore, task offloading is widely used in fields such as telemedicine, intelligent manufacturing, smart cities, and virtual reality (VR) and augmented reality (AR). Thus, task offloading not only addresses data challenges but also, through the collaborative operation of edge nodes, supports the development of the IoV, computing networks, and numerous emerging fields.
[0003] For end users, the computing tasks they face are becoming increasingly complex, often limited by their own computing and storage capabilities. To address this issue, task offloading is a viable solution in edge computing. This means that the end users send their computing tasks and raw data to the edge layer for processing, and then use the results returned from the edge layer to continue subsequent work.
[0004] Edge systems are typically built by one party (such as the cloud), which acts as a management center for task allocation and billing. On the one hand, the edge layer consists of edge infrastructure provided by different types of third parties, devices equipped with third-party software and hardware, and personal devices. On the other hand, nodes are typically heterogeneous and widely deployed in different geographical locations to provide close-range services to end users. This allows managers to more efficiently monitor, configure, and maintain nodes within the same area. Because edge nodes need to collaborate to meet complex computing tasks, geographically grouped nodes make communication and collaboration between nodes easier, thereby improving the overall efficiency of the service. In addition, edge nodes have limited resources, which means their processing power is also limited. Therefore, the services provided by edge nodes may be incorrect, that is, the output results of computing tasks may be tampered with, which will generate erroneous data and cause system failures.
[0005] The involvement of third-party edge nodes poses a security challenge to multi-edge node task offloading. This is because malicious edge nodes, due to self-interest or vulnerability, could provide incorrect computational results during service, preventing subsequent tasks from executing on the terminal. Existing methods assess edge node reputation based on their historical service quality, but edge nodes are not necessarily honest. Furthermore, methods have been proposed to leverage reputation to verify results. Specifically, if a party actively responds to outsourced requests from another party and provides correct results, it will receive a higher reputation, resulting in its requests being prioritized. However, this approach suffers from a serious flaw: it fails to consider the dependencies between tasks processed by different edge nodes, i.e., the collaborative nature of edge nodes. Furthermore, edge nodes with high reputations may also harbor malicious intent or be under attack, and may not necessarily output correct results in the future. Summary of the Invention
[0006] The present invention aims to solve the technical problem of inaccurate credibility verification of edge nodes in multi-edge node task offloading, and provides a method for detecting and locating abnormal behavior of edge nodes applicable to task offloading scenarios.
[0007] The present invention is implemented by adopting the following technical solution: a method for detecting and locating abnormal behavior of edge nodes applicable to task offloading scenarios, comprising the following steps:
[0008] 1) Each edge node entering a system with task offloading requirements is required to register its real identity with the cloud and pay an honesty deposit; the system includes smart terminals and the cloud;
[0009] 2) Edge nodes entering the system are grouped according to their geographic location. A leader is elected within each group. After the leader receives a task offloaded from a terminal to the edge layer, which consists of multiple edge nodes, and issues the task to the edge nodes within its group, the edge nodes within the group collaborate to complete the task. When completing a task, each edge node is required to be responsible for the correctness of the intermediate results it provides when sharing them with other edge nodes. That is, before its subsequent edge nodes use the intermediate results, they must first verify the accuracy of the intermediate results and send the verification results to the cloud.
[0010] 3) When each edge node collaborates with other edge nodes to complete a task, it also verifies the accuracy of the tasks completed by other edge nodes. This means that after offloading the original data and computing tasks to one edge node using a replication mechanism, the same original data and computing tasks will be offloaded to another edge node using the replication mechanism. The replication mechanism will merge the test data into the original data of each task. By comparing the results of the tasks completed by one edge node with those of another edge node, the accuracy of the task completed by the edge node is verified and the verification results are sent to the cloud.
[0011] 4) The cloud integrates the verification results from steps 2) and 3) to decide whether to pay the edge nodes that participated in the collaborative task or to penalize them by withholding their honesty deposits. If an edge node is found to have an error in its task result, its honesty deposit is awarded to the edge node that discovered the error.
[0012] 5) The latest verification result in step 4) is used to update the reputation value of the corresponding edge node; the reputation value refers to the accuracy of an edge node after completing previous tasks, and is determined by the verification result. The higher the reputation value, the more accurate the number of times the edge node has completed tasks;
[0013] 6) After an offloading task is completed, all edge nodes entering the system are divided into good and bad groups according to their reputation values. A new leader is selected for the good group, and the next offloading task is completed according to steps 2) to 5). If the number of tasks is too large and the bad group is also offloaded, then the bad group will also select a leader after completing its tasks according to steps 2) to 5).
[0014] Furthermore, in step 2), each group selects its leader randomly in the first round of elections; subsequent leader elections are conducted using the RRaft mechanism.
[0015] The first round of group elections for leaders:
[0016] Edge nodes have three states: leader, follower, and candidate. During the first round of leader election, all edge nodes are initially in the follower state.
[0017] Each edge node has an election timeout timer, and each edge node has a different timer (randomly generated by the algorithm or customized according to your needs and environmental conditions). This timer is started when the Raft algorithm starts, or when the follower cannot receive heartbeats from the leader (the leader is down).
[0018] Follower transitions to candidate: When a follower's election timeout expires, if it has not received a heartbeat from the leader, it will consider itself the only edge node that can become the leader and transition its status to candidate. The candidate increases its term number by 1 and broadcasts a voting request.
[0019] Candidate Request Vote: A candidate sends a request vote to all other edge nodes entering the system, requesting them to vote for themselves. The edge node that receives the request vote decides whether to vote for the candidate that issued the request based on the following rules:
[0020] (1) If the term number of the candidate making the request is greater than or equal to the term number of the edge node receiving the request;
[0021] (2) Each edge node can only vote for one candidate during the same term;
[0022] The RRaft mechanism election is as follows:
[0023] Including the initial election, each group has only one leader, and the rest are followers. When the leader fails (leader crashes) or the group cluster starts, the leaderless followers become candidates and initiate an election. Candidates send voting requests to other edge nodes in the group. Each edge node can only cast one vote per term for the candidate with the largest term number and the greatest reputation. The candidate that receives more than half of the votes becomes the new leader. If no candidate receives more than half of the votes, the election times out and the candidate becomes a follower, increments the term number, and restarts the election. The term is used to identify the leader's reign, and the term number is incremented with each new leader election. A timeout occurs when a candidate does not receive a voting response from a majority of nodes within a certain period of time after initiating a voting request. After the timeout, the candidate abandons the current election and returns to the follower state.
[0024] After the leader is successfully elected, it will send a broadcast message to the followers and assign tasks to maintain its leadership position. When the follower receives the leader's message, it will reset the timer, indicating the beginning of a term, and remain in the follower state and listen for instructions. If the follower does not receive a leader's message within the set time, the leader is considered invalid, the follower increases the term number and becomes a candidate. While waiting for the voting results, the candidate may receive broadcasts from other edge nodes. If the term number in the broadcast is higher than or equal to its own and the reputation is not less than its own, the legitimacy of the edge node leader is recognized, the candidate gives up the candidate state and becomes a follower. If the term number received is lower than its own or no broadcast is received, it continues to maintain the candidate state and broadcasts the election request.
[0025] Furthermore, the RRaft mechanism election also includes: followers vote on a "first-come, first-served" basis to ensure that at most one candidate is elected leader per term: when a follower receives voting request messages from multiple candidates, it decides who to vote for based on the order in which the messages arrive. The follower will vote for the first request that arrives and has a higher reputation than its own, while subsequent requests will be rejected (the candidate's voting request message is broadcast to all other nodes in the cluster); that is, the one with the highest reputation within the same term becomes the new leader; the new leader announces its leadership position through broadcasting, blocks the new election process, and then begins to perform its duties and accept tasks, and sends the tasks to followers for collaborative processing.
[0026] Furthermore, in step 2), during the initial grouping, edge nodes are divided by geographic location (according to their distance from the task); when subsequently dividing into good and bad groups (i.e., after the first task), the good and bad groups are divided according to the reputation value of each edge node. That is, the top 50% of the reputation value is divided into the good group, and the bottom 50% is divided into the bad group.
[0027] Furthermore, in step 5), the reputation value of a certain edge node is associated with its replication frequency, that is, the higher the reputation value, the lower the frequency of the edge node being verified by other edge nodes.
[0028] Technical effect of the present invention: The method for detecting and locating abnormal behaviors of multiple edge nodes based on the Raft protocol and reputation (RRaft) proposed in the present invention significantly improves the supervision efficiency and communication collaboration capabilities of nodes in the same area by introducing a dynamic grouping strategy for edge nodes. This invention not only implements a dual grouping mechanism based on geographic location and reputation value, and optimizes the task offloading process, but also quickly identifies and locates dishonest edge nodes through strict reputation management and economic incentive mechanisms, effectively preventing malicious behaviors such as collusion attacks, improving the security and reliability of the system, and providing a strong guarantee for the safe operation of the edge computing environment. In addition, the invention uses the strategy of reducing verification overhead based on the credibility of edge nodes, further reducing the overhead of system resources and improving overall operating efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 Flowchart for locating abnormal nodes during task offloading with the collaboration of multiple edge nodes within a group.
[0030] Figure 2 Schematic diagram of the replication mechanism in the task offloading scenario. DETAILED DESCRIPTION
[0031] This paper proposes an innovative solution that integrates the Raft protocol with the Reputation-Raft (RRaft) mechanism. This solution aims to improve node maintenance efficiency within a region, facilitate inter-node communication and collaboration, and accurately identify potential malicious behavior through an efficient node management strategy. First, the present invention employs a dynamic grouping strategy for edge nodes to optimize node management. In the initial grouping phase, edge nodes are divided based on geographic location. Each group elects a leader using the Raft algorithm, responsible for receiving and distributing tasks from terminals to followers within the group. This strategy ensures efficient task allocation and geographic proximity, helping to reduce communication latency. Subsequently, after node reputation values are updated, the present invention introduces a dynamic reputation-based grouping mechanism. Specifically, edge nodes are divided into a "good" group (the top 50%) and a "bad" group (the bottom 50%) based on their reputation values. A new round of leader elections then proceeds using the RRaft mechanism. This mechanism not only strengthens competition and cooperation among nodes but also encourages honest behavior through the incentives and penalties of reputation.
[0032] During task offloading, this invention adheres to the principle of proximity in the first round and prioritizes groups with high reputation scores in the second round, thereby improving the reliability and efficiency of task execution. Furthermore, considering task dependencies, this invention requires edge nodes to be responsible for the correctness of shared intermediate results and ensures the accuracy of these results through a verification mechanism. Once dishonest behavior is detected, the node in question will be immediately penalized and its reputation will be reduced. Furthermore, to prevent dishonest nodes from compromising the system through attacks such as collusion, this invention incorporates an economic incentive mechanism. New edge nodes joining the system are required to register their real identities with the management center and pay an honesty deposit (referred to as the deposit) upon initial access. This measure not only strengthens node accountability but also reduces the financial burden on edge nodes through dynamic management of the deposit. Finally, to reduce verification overhead, this invention proposes a strategy that leverages edge node reputation to reduce the number of verifications. By combining test data with a replication mechanism for joint verification, this ensures result accuracy while improving verification efficiency.
[0033] The process of the present invention is divided into two parts. The specific implementation methods of the present invention are further described in detail below with reference to the accompanying drawings.
[0034] 1. First, the RRAft mechanism is explained.
[0035] In the RRaft mechanism, nodes typically belong to one of three states: leader, follower, and candidate. Under normal circumstances, there is only one leader, and the rest are followers. When the leader fails (i.e., the leader crashes or a task fails) or the cluster starts, the leaderless followers become candidates and initiate an election. Candidates send voting requests to other nodes in the cluster. Each node can only cast one vote per term for the candidate with the highest term number and the greatest reputation. The candidate who receives more than half of the votes becomes the new leader. If no candidate receives more than half of the votes, the election times out, the candidate becomes a follower, the term number is increased, and the election is restarted.
[0036] After a successful leader election, a broadcast message is sent to followers, assigning them tasks to maintain leadership. Upon receiving a message from the leader, a follower resets its timer, remains in follower mode, and listens for commands. If a follower does not receive a message from the leader within the set time, it deems the leader invalid, increments its term number, and becomes a candidate. While awaiting the voting results, a candidate may receive broadcasts from other nodes. If the term number in the broadcast is higher than or equal to its own and its reputation is not lower than its own, the candidate recognizes the leader's legitimacy, relinquishes its candidate status, and becomes a follower. If the received term number is lower than its own or no broadcast is received, the candidate remains in candidate mode and broadcasts an election request.
[0037] Followers vote on a first-come, first-served basis, ensuring that at most one candidate is elected leader per term. To prevent infinite election cycles, the candidate with the highest reputation during a term becomes the new leader. The new leader announces its leadership through a broadcast, halting the new election process. The new leader then begins performing its duties, accepting tasks, and dispatching them to followers for collaborative processing.
[0038] The leader election process of the RRaft mechanism is shown in Algorithm 1.
[0039] Algorithm 1 Leader election process of RRaft mechanism
[0040] Input: edge node information
[0041] Output: Leader
[0042] 1. Elect the initial leader based on timer and reputation;
[0043] 2. FOR followers receive leader broadcasts and subtasks;
[0044] 3. If the follower does not receive the broadcast message from the leader within the timer (i.e., the leader is down or the task fails);
[0045] 4. The follower enters the candidate state and requests to elect a new leader;
[0046] 5. If there are multiple candidates sending requests in the same term
[0047] 6. The candidate with the highest reputation is elected as the new leader;
[0048] 7. END IF
[0049] 8. END IF
[0050] 9. The follower's timer is reset;
[0051] 10.END FOR.
[0052] 2. As attached Figure 1 As shown, in the task offloading under the cooperation of multiple edge nodes in each group, the present invention locates the abnormal node as follows:
[0053] 1) Each edge node (EN) entering the system is required to register its real identity with the cloud and pay an honesty deposit.
[0054] 2) After the leader receives the task offloaded from the terminal to the edge layer and distributes it to its followers within the group, the edge nodes within the group collaborate to complete the task. When sharing intermediate results with other edge nodes, an edge node is responsible for the correctness of the results it provides. That is, before its subsequent edge nodes use the intermediate results, they must verify their accuracy.
[0055] 3) EN1 offloads its raw data and computing tasks to other edge nodes such as EN2 (at least to two ENs) using a replication mechanism.
[0056] 4) The replication mechanism merges the test data into the original data of each task and determines the replication frequency based on the personalized verification strategy related to the reputation value. As shown in Figure 2, EN1 offloads the computing tasks to EN2 and EN3.
[0057] 5) EN1 confirms the received results and submits the performance evaluation of EN2 in the service instance to the cloud.
[0058] 6) It is then the cloud's turn to perform its actions. Based on the evaluation it receives, the cloud decides whether to pay EN2 for its services or penalize it by withholding its security deposit. If EN2 is found to be anomalous, its security deposit is awarded to EN3, the discoverer.
[0059] 7) At the same time, the latest evaluation is used to update EN2’s reputation. EN2’s updated reputation will help other ENs calculate the replication frequency when they offload tasks to EN2.
[0060] In the present invention, the computing tasks generated by the terminal will be offloaded to the edge nodes near it. After the tasks are completed by the edge layer composed of multiple edge nodes, the present invention can efficiently detect whether the edge nodes are reliable, that is, whether the computing tasks of the terminal are correctly processed according to the computing task requirements. When it is found that the calculation result is wrong, the present invention can promptly locate the edge node that provides the wrong result to ensure that the edge system maintains credibility and stability in the presence of untrusted edge nodes.
Claims
1. A method for detecting and locating abnormal behavior of edge nodes suitable for task offloading scenarios, characterized in that: The steps include: 1) Each edge node entering a system with task offloading requirements is required to register its real identity with the cloud and pay an honesty deposit; the system includes smart terminals and the cloud; 2) Edge nodes entering the system are grouped according to their geographic location. A leader is elected within each group. After the leader receives a task offloaded from a terminal to the edge layer, which consists of multiple edge nodes, and issues the task to the edge nodes within its group, the edge nodes within the group collaborate to complete the task. When completing a task, each edge node is required to be responsible for the correctness of the intermediate results it provides when sharing them with other edge nodes. That is, before its subsequent edge nodes use the intermediate results, they must first verify the accuracy of the intermediate results and send the verification results to the cloud. 3) When each edge node collaborates with other edge nodes to complete a task, it also verifies the accuracy of the tasks completed by other edge nodes. This means that after offloading the original data and computing tasks to one edge node using a replication mechanism, the same original data and computing tasks will be offloaded to another edge node using the replication mechanism. The replication mechanism will merge the test data into the original data of each task. By comparing the results of the tasks completed by one edge node with those of another edge node, the accuracy of the task completed by the edge node is verified and the verification results are sent to the cloud. 4) The cloud integrates the verification results in steps 2) and 3) to decide whether to pay service rewards to the edge nodes that participated in the collaborative task or to punish them by withholding their honesty deposits; If an error is found in the task result of an edge node, the honesty deposit will be rewarded to the edge node that discovered the error. 5) The latest verification result in step 4) is used to update the reputation value of the corresponding edge node; the reputation value refers to the accuracy of an edge node after completing previous tasks, and is determined by the verification result. The higher the reputation value, the more accurate the number of times the edge node has completed tasks; 6) After an offloading task is completed, all edge nodes entering the system are regrouped according to their reputation values, dividing them into good and bad groups. A new leader is selected for the good group, and the next offloading task is completed according to steps 2) to 5). If the number of tasks is too large and the bad group is also offloaded, then the bad group will also select a leader after completing its tasks according to steps 2) to 5).
2. The method for detecting and locating abnormal behavior of edge nodes applicable to task offloading scenarios according to claim 1, characterized in that: In step 2), each group selects a leader randomly in the first round of elections; subsequent leader elections use the RRaft mechanism. The first round of group elections for leaders: Edge nodes have three states: leader, follower, and candidate. During the first round of leader election, all edge nodes are initially in the follower state. Each edge node has an election timeout timer, and the timer for each edge node is different; this timer is started at the beginning of the Raft algorithm or when the follower cannot receive a heartbeat from the leader; Follower transitions to candidate: When a follower's election timeout expires, if it has not received a heartbeat from the leader, it will consider itself the only edge node that can become the leader and transition its status to candidate. The candidate increases its term number by 1 and broadcasts a voting request. Candidate Request Vote: A candidate sends a request vote to all other edge nodes entering the system, requesting them to vote for themselves. The edge node that receives the request vote decides whether to vote for the candidate that issued the request based on the following rules: (1) If the term number of the candidate making the request is greater than or equal to the term number of the edge node receiving the request; (2) Each edge node can only vote for one candidate during the same term; The RRaft mechanism election is as follows: Including the initial election, each group has only one leader, and the rest are followers. When the leader fails or the group cluster is started, the leaderless followers become candidates and initiate elections. The candidate sends a voting request to other edge nodes in the group. Each edge node can only cast one vote per term for the candidate with the largest term number and the greatest reputation; The candidate that receives more than half of the votes becomes the new leader. If no candidate receives more than half of the votes, the election times out and the candidate becomes a follower, increments the term number, and restarts the election. The term is used to identify the leader's reign, and the term number is incremented with each new leader election. A timeout occurs when a candidate does not receive a vote response from a majority of nodes within a certain period of time after initiating a vote request. After the timeout, the candidate abandons the current election and returns to the follower state. After the leader is successfully elected, it will send a broadcast message to the followers and assign tasks to maintain its leadership position. When the follower receives the leader's message, it will reset the timer, indicating the beginning of a term, and remain in the follower state and listen for instructions. If the follower does not receive a leader's message within the set time, the leader is considered invalid, the follower increases the term number and becomes a candidate. While waiting for the voting results, the candidate may receive broadcasts from other edge nodes. If the term number in the broadcast is higher than or equal to its own and the reputation is not less than its own, the legitimacy of the edge node leader is recognized, the candidate gives up the candidate state and becomes a follower. If the term number received is lower than its own or no broadcast is received, it continues to maintain the candidate state and broadcasts the election request.
3. The method for detecting and locating abnormal behavior of edge nodes applicable to task offloading scenarios according to claim 2, characterized in that: The RRaft election mechanism also includes: followers vote on a first-come, first-served basis to ensure that at most one candidate is elected leader per term: when a follower receives voting requests from multiple candidates, it decides who to vote for based on the order in which the messages arrive. If the request that arrives first has a higher reputation than its own, the follower will vote, while subsequent requests will be rejected; that is, the one with the highest reputation within the same term becomes the new leader; the new leader announces its leadership position through broadcasting, preventing the new election process, and then begins to perform its duties and accept tasks, and distributes the tasks to followers for collaborative processing.
4. The method for detecting and locating abnormal behavior of edge nodes applicable to task offloading scenarios according to claim 2, characterized in that: When subsequently dividing the good group and the bad group, the division is based on the reputation value of each edge node, that is, the top 50% of the reputation value is divided into the good group, and the bottom 50% is divided into the bad group.
5. The method for detecting and locating abnormal behavior of edge nodes applicable to task offloading scenarios according to any one of claims 1 to 4, characterized in that: In step 5), the reputation value of an edge node is associated with its replication frequency, that is, the higher the reputation value, the lower the frequency of the edge node being verified by other edge nodes.
Citation Information
Patent Citations
Fog network unloading decision and resource allocation method based on block chain technology
CN111770073A
Multi-maneuvering edge node resource collaborative scheduling management system and method in high dynamic environment
CN116939038A