Node identification method and device, equipment, storage medium and program product
Identifying abnormal nodes in the mobile ad hoc network through dynamic weighted aggregation calculation, solving the problem of inaccurate identification results in the prior art, and improving identification accuracy and network security.
Patent Information
- Application Number
- CN202411190908.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-11-29
AI Technical Summary
The existing node identification method has inaccurate identification results in mobile ad hoc networks, and it is impossible to effectively identify abnormal nodes, making it difficult to prevent network attacks.
By obtaining the first trust value and the second trust value between the current node and the neighbor node, weighted aggregation calculation is performed based on the dynamic weight coefficient, and whether the third trust value is less than the preset threshold value. If it is less than, it is identified as an abnormal node and updated Trust level matrix.
It improves the accuracy of node identification, can dynamically adapt to node changes, identify abnormal nodes, prevent network attacks, and enhance network security.
Smart Images

Figure CN119052797A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a node identification method, device, equipment, storage medium and program product. Background Art
[0002] Mobile Ad Hoc Network (MANET) is a wireless self-organizing network formed by mobile nodes through independent wireless temporary interconnection. In a mobile ad hoc network, due to the limited communication range of each node, each node needs to cooperate with other intermediate nodes when transmitting data, and use a multi-hop communication method to pass data packets from the source node to the target node. Among them, each node can act as a relay node to help forward data packets. After receiving a data packet, if the node is not the target node, the node will forward the data packet to all its neighboring nodes until the data packet reaches the target node or reaches the edge of the network and is discarded.
[0003] At present, abnormal nodes (such as malicious nodes) usually take advantage of the data propagation characteristics in mobile ad hoc networks (that is, the characteristics that nodes can cooperate with neighboring nodes to propagate data packets) and cooperate with normal nodes (i.e. benign nodes) to attack other nodes in the network, thereby launching different types of attacks on mobile ad hoc networks, such as message tampering, wormhole attacks, and malicious packet loss attacks, thereby destroying the operation of mobile ad hoc networks and reducing network efficiency. Based on this, how to identify abnormal nodes in mobile ad hoc networks and prevent attacks from abnormal nodes has become a technical problem that needs to be solved urgently.
[0004] In the related art, a static node trust policy can be set to identify nodes in a mobile ad hoc network. However, the identification results of the existing node identification methods are inaccurate. Summary of the invention
[0005] The embodiments of the present application provide a node identification method, apparatus, device, storage medium and program product to solve the technical problem of inaccurate identification results of existing node identification methods.
[0006] In a first aspect, an embodiment of the present application provides a node identification method, including: if it is determined that the current node is not a source node, obtaining a first trust value and a second trust value between the current node and the neighboring node of the current node; performing a weighted aggregation calculation based on the first trust value and a first weight coefficient of the first trust value, the second trust value and the second weight coefficient of the second trust value to obtain a third trust value between the current node and the neighboring node; the first weight coefficient is dynamically determined based on the number of times the current node monitors the neighboring node, and the second weight coefficient is dynamically determined based on the first weight coefficient; judging whether the third trust value is less than a first preset threshold; if the third trust value is less than the first preset threshold, identifying the neighboring node as an abnormal node.
[0007] In one embodiment, a first trust value and a second trust value are obtained between a current node and a neighboring node of the current node, including: obtaining a packet forwarding ratio, a link transmission probability and a historical trust value between the current node and the neighboring node of the current node; performing a weighted aggregation calculation based on the packet forwarding ratio, the link transmission probability and the historical trust value to obtain a first trust value; determining the number of next-hop nodes in the transmission path between the current node and the target node; the next-hop node is a node with a hop count of 1 between the current node and the node; determining the second trust value based on the number and a fourth trust value of the current node; the fourth trust value is determined based on the trust value of each next-hop node and the current node.
[0008] In one embodiment, after a neighbor node is identified as an abnormal node, the method further includes: determining whether the neighbor node has an upstream node; if it is determined that the neighbor node has an upstream node, sending the abnormal node identification result to the upstream node; based on a third trust value, determining the trust level of the current node for the neighbor node; based on the trust level, updating the trust level matrix; the trust level matrix is used to store the trust levels between all nodes in the network.
[0009] In one embodiment, after determining whether the third trust value is less than the first preset threshold, it also includes: if the third trust value is greater than or equal to the first preset threshold, identifying the neighbor node as a normal node; based on the third trust value, determining the trust level of the current node to the neighbor node; based on the trust level, updating the trust level matrix; the trust level matrix is used to store the trust levels between all nodes in the network.
[0010] In one embodiment, if it is determined that the current node is not a source node, before obtaining the first trust value and the second trust value between the current node and the neighboring nodes of the current node, it also includes: when the current node receives a data packet, determining whether the current node is a source node; if it is determined that the current node is a source node, finding the data packet transmission path between the current node and the target node; predicting the first probability and the second probability between every two adjacent nodes in the data packet transmission path; the first probability is the probability of cooperative forwarding of data packets between the two adjacent nodes, and the second probability is the probability of non-cooperative forwarding of data packets between the two adjacent nodes; based on all the first probabilities and the second probabilities, identifying all nodes in the data packet transmission path to obtain node identification results.
[0011] In one embodiment, based on all the first probabilities and the second probabilities, all nodes in the data packet transmission path are identified. After obtaining the node identification result, it also includes: if it is determined based on the node identification result that there are abnormal nodes in the data packet transmission path, then stop forwarding the data packet, delete the abnormal nodes in the data packet transmission path, and return to the step of finding the data packet transmission path between the current node and the target node until the data packet is forwarded to the target node; if it is determined based on the node identification result that there are no abnormal nodes in the data packet transmission path, then forward the data packet to the target node.
[0012] In a second aspect, an embodiment of the present application provides a node identification device, including: a first calculation module, for obtaining a first trust value and a second trust value between the current node and the neighboring node of the current node if it is determined that the current node is not a source node; a second calculation module, for performing weighted aggregation calculation based on the first trust value and the first weight coefficient of the first trust value, the second trust value and the second weight coefficient of the second trust value, to obtain a third trust value between the current node and the neighboring node; the first weight coefficient is dynamically determined based on the number of times the current node monitors the neighboring node, and the second weight coefficient is dynamically determined based on the first weight coefficient; a judgment module, for judging whether the third trust value is less than a first preset threshold; an identification module, for identifying the neighboring node as an abnormal node if the third trust value is less than the first preset threshold.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any of the above-mentioned node identification methods is implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned node identification methods.
[0015] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements any of the above-mentioned node identification methods when executed by a processor.
[0016] The node identification method, apparatus, equipment, storage medium and program product provided in the embodiments of the present application dynamically determine a first weight coefficient based on the number of times the current node monitors the neighboring node, dynamically determine a second weight coefficient based on the first weight coefficient, and then dynamically determine a third trust value between the current node and the neighboring node based on the first trust value and the first weight coefficient, the second trust value and the second weight coefficient, and perform node identification through the third trust value. In the process of node identification, a dynamic method is used to determine the weight coefficients corresponding to different trust values. Compared with a static node trust strategy that directly uses a fixed weight coefficient, this method has higher flexibility and is easier to adapt to dynamic changes of nodes, reflecting the importance of direct observation and monitoring between nodes and improving the accuracy of node identification results. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 This is one of the flow charts of the node identification method provided in the embodiment of the present application.
[0019] Figure 2 This is the second flow chart of the node identification method provided in the embodiment of the present application.
[0020] Figure 3 It is a structural diagram of a node identification device provided in an embodiment of the present application.
[0021] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] See also Figure 1 , Figure 1 This is one of the flow charts of the node identification method provided in the embodiment of the present application. In the embodiment of the present application, the node identification method is applied to a mobile ad hoc network, and the node identification method includes steps S110 to S140, and each step is as follows: S110: If it is determined that the current node is not the source node, a first trust value and a second trust value between the current node and a neighboring node of the current node are obtained.
[0024] See also Figure 2 , Figure 2 This is the second flow chart of the node identification method provided in the embodiment of the present application.
[0025] like Figure 2 As shown, when the current node receives a data packet, that is, when it is detected that the current node receives a data packet forwarding request message from other nodes in the mobile ad hoc network, it is first determined whether the current node is a source node.
[0026] If it is determined that the current node is not the source node, a first trust value (ie, a direct trust value) and a second trust value (ie, an indirect trust value) between the current node and a neighboring node of the current node are obtained.
[0027] S120: Perform weighted aggregation calculation based on the first trust value and the first weight coefficient of the first trust value, the second trust value and the second weight coefficient of the second trust value to obtain a third trust value between the current node and the neighboring node.
[0028] Among them, the first weight coefficient (ie, the direct dynamic weight coefficient) is dynamically determined based on the number of times the current node monitors the neighboring node, and the second weight coefficient (ie, the indirect dynamic weight coefficient) is dynamically determined based on the first weight coefficient.
[0029] like Figure 2 As shown, based on the direct trust value and the direct dynamic weight coefficient corresponding to the direct trust value, the indirect trust value and the indirect dynamic weight coefficient corresponding to the indirect trust value, the third trust value (i.e., the combined trust value) between the current node and the neighboring node is calculated by weighted summation.
[0030] Among them, the first weight coefficient The calculation formula of (i.e. direct dynamic weight coefficient) is as follows: ; The second weight coefficient The calculation formula of (i.e. indirect dynamic weight coefficient) is as follows: ; in, represents the maximum weight of the direct trust value defined in the range of (0, 1]; n represents the number of times the current node monitors the neighboring node (that is, when the neighboring node receives a data packet sent by other nodes, the current node monitors the neighboring node to confirm whether the neighboring node forwards the data packet); It is a parameter used to characterize whether the current node has monitored the neighboring nodes a sufficient number of times.
[0031] From the above formula, we can see that the first weight coefficient (i.e., the direct dynamic weight coefficient) will increase as the number of times the current node monitors the neighboring nodes increases; when n=0, =0; when n is greater than hour, Close to or equal to .
[0032] At the same time, when the first weight coefficient (i.e., the direct dynamic weight coefficient) changes, the second weight coefficient (i.e. the indirect dynamic weight coefficient) will also change accordingly.
[0033] Compared with the static node trust strategy that directly uses fixed weight coefficients, the method of dynamically allocating direct dynamic weight coefficients and indirect dynamic weight coefficients can, on the one hand, dynamically allocate weights according to the number of times the current node monitors neighbor nodes, thereby reflecting the importance of direct observation and monitoring between nodes, making the setting of weight coefficients more flexible and easier to adapt to the dynamic changes of nodes; on the other hand, since it is difficult to directly determine the credibility of neighbor nodes without monitoring and observing neighbor nodes, the above method can give greater weight to indirect trust values, which helps to improve the accuracy of neighbor node identification results.
[0034] Preferably, if Figure 2 As shown, after obtaining the third trust value (i.e., combined trust value) between the current node and the neighboring node, the third trust value (i.e., combined trust value) between the current node and the neighboring node can be pushed to other nodes in the network (i.e., mobile ad hoc network), and the trust value matrix can be updated according to the third trust value (i.e., combined trust value).
[0035] The trust value matrix is used for the third trust value (ie, the combined trust value) between nodes in the network, and the third trust value in the trust value matrix can be shared among other nodes in the network.
[0036] By sharing the third trust value between nodes among other nodes, other nodes only accept trust information from normal nodes, thereby preventing attackers from interfering with data packet transmission by modifying the trust value of a node and sharing wrong trust information.
[0037] S130: Determine whether the third trust value is less than the first preset threshold.
[0038] Specifically, it is determined whether the third trust value (ie, the combined trust value) is less than the first preset threshold.
[0039] S140: If the third trust value is less than the first preset threshold, the neighbor node is identified as an abnormal node.
[0040] If the third trust value (ie, the combined trust value) is less than the first preset threshold, the current node may identify and mark the neighbor node as an abnormal node.
[0041] Furthermore, it is determined whether the neighboring node has an upstream node.
[0042] If it is determined that there is an upstream node in the neighboring node, the abnormal node identification result is sent to the upstream node to prompt the upstream node to guard against possible attack behaviors of the abnormal node.
[0043] At the same time, the current node can determine the trust level of the current node to the neighboring node based on the third trust value (ie, the combined trust value), and update the trust level matrix based on the trust level. The trust level matrix is used to store the trust levels between all nodes in the network.
[0044] The node identification method provided in the embodiment of the present application dynamically determines a first weight coefficient based on the number of times the current node monitors the neighboring node, dynamically determines a second weight coefficient based on the first weight coefficient, and then dynamically determines a third trust value between the current node and the neighboring node based on the first trust value and the first weight coefficient, the second trust value and the second weight coefficient. Node identification is performed through the third trust value. In the process of node identification, a dynamic method is used to determine the weight coefficients corresponding to different trust values. Compared with a static node trust strategy that directly uses fixed weight coefficients, the method has higher flexibility and is easier to adapt to dynamic changes of nodes, which reflects the importance of direct observation and monitoring between nodes and improves the accuracy of node identification results.
[0045] In some embodiments, obtaining a first trust value and a second trust value between a current node and a neighboring node of the current node includes: obtaining a packet forwarding ratio, a link transmission probability and a historical trust value between the current node and the neighboring node of the current node; performing a weighted aggregation calculation based on the packet forwarding ratio, the link transmission probability and the historical trust value to obtain a first trust value; determining the number of next-hop nodes in the transmission path between the current node and the target node; the next-hop node is a node with a hop count of 1 between the current node and the node; determining the second trust value based on the number and a fourth trust value of the current node; the fourth trust value is determined based on the trust value of each next-hop node and the current node.
[0046] Specifically, if it is determined that the current node is not a source node, the data packet forwarding ratio, link transmission probability, and historical trust value between the current node and a neighboring node of the current node are obtained.
[0047] Optionally, the historical trust value is a historical first trust value (ie, a historical direct trust value).
[0048] Furthermore, based on the packet forwarding ratio, link transmission probability and historical trust value, a first trust value (ie, direct trust value) between the current node and the neighboring node is calculated by weighted summation.
[0049] Among them, the packet forwarding ratio refers to the ratio of the number of packets forwarded by the current node and neighboring nodes to the total number of packets sent by the source node; the link transmission probability refers to the ratio of the number of request messages received by the neighboring nodes from the current node to the number of request messages sent by the current node.
[0050] Furthermore, the number of next-hop nodes in the transmission path between the current node and the target node is determined, where the next-hop node is a node with a hop count of 1 between the current node and the target node, that is, the number of 1-hop neighbors in the data packet transmission path between the current node and the target node is determined.
[0051] Further, based on the quantity and a fourth trust value of the current node, the second trust value is determined, and the fourth trust value is determined based on the trust value of each next-hop node and the current node.
[0052] Specifically, according to the number of 1-hop neighbors and the fourth trust value of the current node (ie, the shared trust value), the second trust value (ie, the indirect trust value) between the current node and the neighboring node is calculated.
[0053] The fourth trust value (ie, shared trust value) of the current node refers to a trust value between a 1-hop neighbor and the current node that is greater than a preset recommended trust threshold, and this value can be securely shared among nodes in the mobile ad hoc network.
[0054] For example, assuming that there are three 1-hop neighbors (i.e., next-hop nodes) in the data packet transmission path between the current node A and the target node, namely, node B, node C, and node D, and the trust values between the current node A and node B, node C, and node D are 0.5, 0.75, and 0.4, respectively, and the preset recommended trust threshold is 0.45, then the shared trust values between the current node A and node B, node C, and node D include 0.5 and 0.75. At this time, the second trust value between the current node and the neighboring node can be calculated according to the number of 1-hop neighbors and all shared trust values of the current node according to the following formula (ie indirect trust value): ; in, It represents the trust value between the current node and its one-hop neighbor that is greater than the preset recommended trust threshold, that is, the fourth trust value (that is, the shared trust value) of the current node; S represents the number of next-hop nodes in the transmission path between the current node and the target node, that is, the number of one-hop neighbors in the data packet transmission path between the current node and the target node.
[0055] The node identification method provided in the embodiment of the present application can adopt a trusted routing maintenance method after confirming that the current node is not a source node. By calculating the direct trust value and the indirect trust value between the current node and the neighboring nodes, and then calculating the combined trust value, the abnormal node can be quickly identified according to the combined trust value. At the same time, since this method does not need to use the trust values of all 1-hop neighbors for calculation, but uses a shared trust value greater than a preset recommended trust threshold for calculation, network overhead can be reduced.
[0056] In some embodiments, after a neighbor node is identified as an abnormal node, it also includes: determining whether there is an upstream node for the neighbor node; if it is determined that there is an upstream node for the neighbor node, sending the abnormal node identification result to the upstream node; based on a third trust value, determining the trust level of the current node for the neighbor node; based on the trust level, updating the trust level matrix; the trust level matrix is used to store the trust levels between all nodes in the network.
[0057] Specifically, if the neighboring node is determined to be an abnormal node, it is determined whether the neighboring node has an upstream node.
[0058] If it is determined that there is an upstream node in the neighboring node, the abnormal node identification result is sent to the upstream node to prompt the upstream node to guard against possible attack behaviors of the abnormal node.
[0059] At the same time, the current node can determine the trust level of the current node to the neighboring node based on the third trust value (ie, the combined trust value), and update the trust level matrix based on the trust level. The trust level matrix is used to store the trust levels between all nodes in the network.
[0060] In some embodiments, after determining whether the third trust value is less than the first preset threshold, it also includes: if the third trust value is greater than or equal to the first preset threshold, identifying the neighbor node as a normal node; based on the third trust value, determining the trust level of the current node to the neighbor node; based on the trust level, updating the trust level matrix; the trust level matrix is used to store the trust levels between all nodes in the network.
[0061] Specifically, after obtaining the third trust value (ie, the combined trust value), it is determined whether the third trust value (ie, the combined trust value) is less than a first preset threshold.
[0062] If the third trust value (ie, the combined trust value) is greater than or equal to the first preset threshold, the neighbor node is identified as a normal node.
[0063] Furthermore, the current node may determine the trust level of the current node to the neighboring node based on the third trust value (ie, the combined trust value), and update the trust level matrix based on the trust level, where the trust level matrix is used to store the trust levels between all nodes in the network.
[0064] In some embodiments, if it is determined that the current node is not a source node, then before obtaining the first trust value and the second trust value between the current node and the neighboring nodes of the current node, it also includes: when the current node receives a data packet, determining whether the current node is a source node; if it is determined that the current node is a source node, finding the data packet transmission path between the current node and the target node; predicting the first probability and the second probability between every two adjacent nodes in the data packet transmission path; the first probability is the probability of cooperative forwarding of data packets between two adjacent nodes, and the second probability is the probability of non-cooperative forwarding of data packets between two adjacent nodes; based on all first probabilities and second probabilities, identifying all nodes in the data packet transmission path to obtain node identification results.
[0065] Please continue reading Figure 2 ,When the current node receives a data packet, that is, when the current node receives a data packet forwarding request message from other nodes in the mobile ad hoc network, it first determines whether the current node is the source node (that is, it determines whether the current node has sent any data packet to the target node before).
[0066] The data packet forwarding request message carries information such as the ID of other nodes and the ID of the target node, and the target node refers to the node that ultimately receives the data packet.
[0067] Furthermore, if it is determined that the current node is the source node, the data packet transmission path between the current node and the target node is discovered and searched through routing, and the probability of cooperative forwarding of data packets and the probability of uncooperative forwarding of data packets between every two adjacent nodes in the data packet transmission path are predicted.
[0068] Among them, the first probability The probability of cooperative forwarding of data packets can be determined according to the historical cooperation times and historical non-cooperation times of the two nodes according to the following formula: ; represents the historical number of cooperation times between node i and node i in forwarding data packets; Represents the number of historical non-cooperation times between node i and node j in forwarding data packets (that is, the number of times node i or node j does not forward the data packet after receiving the data packet sent by the other party, where the case where node i or node j is the target node and does not forward the data packet is not counted).
[0069] is the probability coefficient calculated based on the physical distance and signal strength between node i and node j, where the physical distance can be obtained by normalizing the distances of all nodes in the network topology, and the signal strength can be measured in real time, so the probability coefficient It can reflect the real-time communication status between two nodes in a mobile ad hoc network. The better the communication status, the greater the probability of cooperation between the two nodes.
[0070] Accordingly, the second probability (i.e., the probability of uncooperative forwarding of data packets) can be determined according to the following formula: .
[0071] Furthermore, based on all the first probabilities and the second probabilities, all nodes in the data packet transmission path are identified to obtain a node identification result.
[0072] Specifically, for any two adjacent nodes, denoted as node i and node j, if the first probability (i.e., the probability of cooperatively forwarding data packets) is greater than the second preset threshold, then node i can identify node j as a normal node; if the second probability (ie, the probability of non-cooperative forwarding of data packets) is greater than the third preset threshold, node i can identify node j as an abnormal node.
[0073] The node identification method provided in the embodiment of the present application, when confirming that the current node is the source node, can use a specific method to identify abnormal nodes in the data packet transmission path before the data packet is transmitted, thereby increasing the possibility of early detection of abnormal nodes in the mobile ad hoc network, thereby ensuring that the number of packet losses in the data packet transmission path is minimized and improving network throughput.
[0074] In some embodiments, based on all first probabilities and second probabilities, all nodes in the data packet transmission path are identified, and after obtaining the node identification result, it also includes: if it is determined based on the node identification result that there are abnormal nodes in the data packet transmission path, then stop forwarding the data packet, delete the abnormal nodes in the data packet transmission path, and return to the step of finding the data packet transmission path between the current node and the target node until the data packet is forwarded to the target node; if it is determined based on the node identification result that there are no abnormal nodes in the data packet transmission path, then forward the data packet to the target node.
[0075] If it is determined based on the node identification result that there is an abnormal node in the data packet transmission path, forwarding of the data packet is stopped, and the routing information of the abnormal node in the data packet transmission path is deleted, so that the abnormal node in the mobile ad hoc network is deleted.
[0076] Preferably, after deleting the abnormal node in the data packet transmission path, according to the calculated first probability (i.e., the probability of cooperative forwarding of packets) and the second probability (i.e., the probability of non-cooperative forwarding of data packets) updates the pre-stored node trust value and trust level.
[0077] Furthermore, the step of searching for a data packet transmission path between the current node and the target node is returned, that is, after deleting the abnormal node in the mobile ad hoc network, a new data packet transmission path is searched again (during this period, any routing request from the abnormal node is rejected, thereby ensuring that the abnormal node is completely deleted from the mobile ad hoc network); when a new data packet transmission path is found, the first probability and the second probability between every two adjacent nodes in the new data packet transmission path are continued to be predicted, thereby continuing to identify nodes, until there is no abnormal node in the found data packet transmission path, and the data packet is transmitted to the target node.
[0078] If it is determined based on the node identification result that there is no abnormal node in the data packet transmission path, the data packet is forwarded to the target node.
[0079] The node identification method provided in the embodiment of the present application can provide a specific trusted routing maintenance mechanism for source nodes and intermediate nodes. Therefore, it is suitable for all types of nodes in mobile ad hoc networks, that is, the applicability of this solution is wide; secondly, in this solution, the trust between nodes in the mobile ad hoc network can be accurately quantified, so that abnormal nodes in the data packet transmission path can be accurately identified; finally, the use of this solution can also avoid problems such as erroneous information deliberately forwarded by shared abnormal nodes, thereby interfering with data packet transmission.
[0080] The present application also provides a node identification device. Figure 3 , Figure 3 3 is a schematic diagram of the structure of a node identification device provided in an embodiment of the present application. In the embodiment of the present application, the node identification device includes a first calculation module 310, a second calculation module 320, a judgment module 330 and an identification module 340.
[0081] The first calculation module 310 is configured to obtain a first trust value and a second trust value between the current node and a neighboring node of the current node if it is determined that the current node is not a source node.
[0082] The second calculation module 320 is used to perform weighted aggregation calculation based on the first trust value and the first weight coefficient of the first trust value, the second trust value and the second weight coefficient of the second trust value to obtain a third trust value between the current node and the neighboring node.
[0083] The first weight coefficient is dynamically determined based on the number of times the current node monitors the neighboring node, and the second weight coefficient is dynamically determined based on the first weight coefficient.
[0084] The judgment module 330 is used to judge whether the third trust value is less than the first preset threshold.
[0085] The identification module 340 is configured to identify the neighbor node as an abnormal node if the third trust value is less than the first preset threshold.
[0086] In some embodiments, the first calculation module 310 is used to obtain the packet forwarding ratio, link transmission probability and historical trust value between the current node and the neighboring nodes of the current node; perform weighted aggregation calculation based on the packet forwarding ratio, link transmission probability and historical trust value to obtain a first trust value; determine the number of next-hop nodes in the transmission path between the current node and the target node; the next-hop node is a node with a hop count of 1 between the current node and the node; determine the second trust value based on the number and the fourth trust value of the current node; the fourth trust value is determined based on the trust value of each next-hop node and the current node.
[0087] In some embodiments, the identification module 340 is used to determine whether there is an upstream node for the neighboring node; if it is determined that there is an upstream node for the neighboring node, the abnormal node identification result is sent to the upstream node; based on the third trust value, the trust level of the current node to the neighboring node is determined; based on the trust level, the trust level matrix is updated; the trust level matrix is used to store the trust levels between all nodes in the network.
[0088] In some embodiments, the identification module 340 is used to identify the neighbor node as a normal node if the third trust value is greater than or equal to the first preset threshold; based on the third trust value, determine the trust level of the current node to the neighbor node; based on the trust level, update the trust level matrix; the trust level matrix is used to store the trust levels between all nodes in the network.
[0089] In one embodiment, the determination module 330 is used to determine whether the current node is a source node when the current node receives a data packet.
[0090] The identification module 340 is used to find the data packet transmission path between the current node and the target node if it is determined that the current node is the source node; predict the first probability and the second probability between every two adjacent nodes in the data packet transmission path; the first probability is the probability of cooperative forwarding of data packets between the two adjacent nodes, and the second probability is the probability of non-cooperative forwarding of data packets between the two adjacent nodes; based on all the first probabilities and the second probabilities, identify all nodes in the data packet transmission path to obtain node identification results.
[0091] In one embodiment, the identification module 340 is used to stop forwarding the data packet, delete the abnormal node in the data packet transmission path, and return to the step of finding the data packet transmission path between the current node and the target node until the data packet is forwarded to the target node if it is determined based on the node identification result that there is an abnormal node in the data packet transmission path, and forward the data packet to the target node if it is determined based on the node identification result that there is no abnormal node in the data packet transmission path.
[0092] The present application also provides an electronic device, Figure 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the node identification method.
[0093] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0094] An embodiment of the present application also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the node identification method provided by the above methods is implemented.
[0095] An embodiment of the present application also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the node identification methods provided by the above methods.
[0096] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0097] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0098] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A node identification method, characterized in that: include: If it is determined that the current node is not the source node, obtaining a first trust value and a second trust value between the current node and a neighboring node of the current node; Performing a weighted aggregation calculation based on the first trust value and a first weight coefficient of the first trust value, the second trust value and a second weight coefficient of the second trust value to obtain a third trust value between the current node and the neighboring node; The first weight coefficient is dynamically determined based on the number of times the current node monitors the neighbor node, and the second weight coefficient is dynamically determined based on the first weight coefficient; Determining whether the third trust value is less than a first preset threshold; If the third trust value is less than the first preset threshold, the neighbor node is identified as an abnormal node.
2. The node identification method according to claim 1, characterized in that: The obtaining of a first trust value and a second trust value between the current node and a neighboring node of the current node includes: Obtaining a data packet forwarding ratio, a link transmission probability, and a historical trust value between the current node and a neighboring node of the current node; Performing weighted aggregation calculation based on the data packet forwarding ratio, the link transmission probability and the historical trust value to obtain the first trust value; Determine the number of next-hop nodes in the transmission path between the current node and the target node; the next-hop node is a node with a hop count of 1 between the next-hop node and the current node; The second trust value is determined based on the number and a fourth trust value of the current node; the fourth trust value is determined based on the trust value of each of the next-hop nodes and the current node.
3. The node identification method according to claim 1, characterized in that: After the neighbor node is identified as an abnormal node, the method further includes: Determine whether the neighbor node has an upstream node; If it is determined that the neighboring node has an upstream node, sending the abnormal node identification result to the upstream node; Determining, based on the third trust value, a trust level of the current node for the neighbor node; Based on the trust level, a trust level matrix is updated; the trust level matrix is used to store the trust levels between all nodes in the network.
4. The node identification method according to claim 1, characterized in that: After determining whether the third trust value is less than the first preset threshold, the method further includes: If the third trust value is greater than or equal to the first preset threshold, identifying the neighbor node as a normal node; Determining, based on the third trust value, a trust level of the current node for the neighbor node; Based on the trust level, a trust level matrix is updated; the trust level matrix is used to store the trust levels between all nodes in the network.
5. The node identification method according to claim 1, characterized in that: If it is determined that the current node is not a source node, before obtaining the first trust value and the second trust value between the current node and the neighboring node of the current node, the method further includes: When the current node receives a data packet, determining whether the current node is a source node; If it is determined that the current node is a source node, searching for a data packet transmission path between the current node and a target node; Predicting a first probability and a second probability between every two adjacent nodes in the data packet transmission path; the first probability is the probability of the two adjacent nodes cooperatively forwarding the data packet, and the second probability is the probability of the two adjacent nodes not cooperatively forwarding the data packet; Based on all the first probabilities and the second probabilities, all nodes in the data packet transmission path are identified to obtain a node identification result.
6. The node identification method according to claim 5, characterized in that: After identifying all nodes in the data packet transmission path based on all the first probabilities and the second probabilities and obtaining the node identification result, the method further includes: If it is determined based on the node identification result that there is an abnormal node in the data packet transmission path, then stop forwarding the data packet, delete the abnormal node in the data packet transmission path, and return to the step of finding the data packet transmission path between the current node and the target node until the data packet is forwarded to the target node; If it is determined based on the node identification result that there is no abnormal node in the data packet transmission path, the data packet is forwarded to the target node.
7. A node identification device, characterized in that: include: A first calculation module, configured to obtain a first trust value and a second trust value between the current node and a neighboring node of the current node if it is determined that the current node is not a source node; A second calculation module, configured to perform weighted aggregation calculation based on the first trust value and a first weight coefficient of the first trust value, the second trust value and a second weight coefficient of the second trust value, to obtain a third trust value between the current node and the neighboring node; The first weight coefficient is dynamically determined based on the number of times the current node monitors the neighbor node, and the second weight coefficient is dynamically determined based on the first weight coefficient; A judging module, used to judge whether the third trust value is less than a first preset threshold; An identification module is used to identify the neighbor node as an abnormal node if the third trust value is less than the first preset threshold.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the node identification method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the node identification method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the node identification method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Position identification system, method and device based on single code channel and storage medium
CN119471569A
