Trusted routing method based on node hierarchical mechanism in mobile ad hoc network
By employing a trusted routing method based on a node hierarchical mechanism in mobile ad hoc networks, and selecting an appropriate signature verification method according to the dynamic security score of the transmission node, the high resource consumption of high-trust nodes in existing technologies is solved, and efficient utilization of network resources is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUBEI ENG UNIV
- Filing Date
- 2026-05-14
- Publication Date
- 2026-07-24
AI Technical Summary
In existing mobile ad hoc networks, nodes still need to perform strong signature verification when sending messages to highly trusted nodes, resulting in high overall network resource consumption.
By obtaining the dynamic security score of the transmission node, a signature verification method with different verification strength is selected according to the score. The dynamic security score is inversely proportional to the verification strength, thus reducing the verification strength of highly trusted nodes.
While ensuring security, it reduces the overall network resource consumption and improves the network resource utilization efficiency.
Smart Images

Figure CN122458024A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communications, and more particularly to a trusted routing method based on a node hierarchical mechanism in a mobile ad hoc network. Background Technology
[0002] Mobile ad hoc networks (MAVs) are decentralized, self-organizing, multi-hop communication networks composed of a group of wireless mobile nodes. They are widely used in environments where infrastructure is lacking or cannot rely on fixed base stations, such as battlefield communications, disaster relief, vehicular networks, intelligent transportation, and ad-hoc meetings. In these scenarios, nodes function as both hosts and routers, collaborating with each other to store, forward, and route messages. Currently, existing routing mechanisms, to ensure security, require each current node to perform strong digital signature verification for every message forwarded. This results in high overall network resource consumption, even when sending messages to highly trusted nodes. Therefore, reducing overall network resource consumption has become a pressing technical problem. Summary of the Invention
[0003] The main purpose of this application is to provide a trusted routing method based on a node hierarchical mechanism in mobile ad hoc networks, which aims to solve the problem that in the prior art, when the current node sends a message to a highly trusted node, it still needs to perform a high-strength signature verification, resulting in high overall network resource consumption.
[0004] To achieve the above objectives, this application proposes a trusted routing method based on a node hierarchical mechanism in mobile ad hoc networks, the method comprising: In the case of messages to be forwarded, a dynamic security score of the transmission node is obtained based on the network message transmission parameters of the transmission node. The dynamic security score is used to characterize the message transmission reliability of the transmission node. The target verification method is selected from the preset verification methods based on the dynamic security score of the transmission node. The preset verification methods include at least two verification methods with different verification strengths. The dynamic security score is inversely proportional to the verification strength. The message to be forwarded is signed using the target verification method, and if the signature verification is successful, the message to be forwarded is forwarded to the transmission node.
[0005] In one embodiment, the step of selecting the corresponding target authentication method from the preset authentication methods based on the dynamic security score of the transmission node includes: If the dynamic security score of the transmission node is higher than the first preset dynamic threshold, the transmission node is determined to be a highly trusted node, and the first preset verification method corresponding to the highly trusted node is selected as the target verification method from the preset verification methods. The first preset verification method is an integrity verification method based on hash message authentication code. If the dynamic security score of the transmission node is not higher than the first preset dynamic threshold but higher than the second preset dynamic threshold, then the transmission node is determined to be a trusted node, and the second preset verification method corresponding to the trusted node is selected as the target verification method from the preset verification methods. The second preset verification method is a key hash value verification method based on whitelist and timeliness. If the dynamic security score of the transmission node is not higher than the second preset dynamic threshold, the transmission node is determined to be a malicious node, and verification is refused and the message to be forwarded is refused to be forwarded to the transmission node.
[0006] In one embodiment, the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node includes: The message delivery reliability parameter of the transmission node is determined based on the difference between the message forwarding success rate and the message drop rate of the transmission node. The connection stability parameters of the transmission node are determined based on the average connection duration and connection frequency between the transmission node and its neighboring nodes. The social behavior consistency parameter of the transmission node is determined based on the time series variance of the social similarity between the transmission node and each neighbor node within a preset time period. The dynamic security score is obtained by weighting the message passing behavior reliability parameter, the connection stability parameter, and the social behavior consistency parameter.
[0007] In one embodiment, before the step of selecting the corresponding target verification method from the preset verification methods based on the dynamic security score of the transmission node, the method further includes: Determine whether the transmission node is the destination node; If the transmission node is the destination node, the message to be forwarded is verified using a destination node verification method, which is a digital signature verification method based on asymmetric encryption. If the transmission node is not the destination node, then the step of selecting the corresponding target verification method from the preset verification methods based on the dynamic security score of the transmission node is executed.
[0008] In one embodiment, before the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node, the following steps are included: Generate a random symmetric key, and encrypt the message to be forwarded using the symmetric key to obtain ciphertext data; Obtain the asymmetric encryption public key of the destination node, and encrypt the symmetric key with the public key to obtain the encryption key; A digital signature for the message to be forwarded is generated using the asymmetric encryption private key of the source node; The ciphertext data, the encryption key, and the digital signature are encapsulated into a data payload; The step of performing signature verification on the message to be forwarded using the target verification method, and forwarding the message to be forwarded to the transmission node if the signature verification is successful, includes: The data payload is signed and verified using the target verification method, and if the signature verification is successful, the data payload is forwarded to the transmission node.
[0009] In one embodiment, before the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node, the method further includes: Get the remaining number of copies of the message to be forwarded held by the current node; If the number of remaining replicas is greater than a preset threshold, then the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node is executed. If the number of remaining copies is less than or equal to the preset number threshold, then the forwarding process of the message to be forwarded is stopped.
[0010] In one embodiment, the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node includes: The dynamic security score corresponding to each adjacent node is obtained based on the network message transmission parameters of each adjacent node. The dynamic security scores corresponding to each adjacent node are sorted in descending order, and the adjacent node with the highest score is selected as the transmission node.
[0011] Furthermore, to achieve the above objectives, this application also proposes a trusted routing device based on a node hierarchical mechanism in a mobile ad hoc network, the device comprising: The scoring acquisition module is used to obtain the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node when there is a message to be forwarded. The dynamic security score is used to characterize the message transmission reliability of the transmission node. The method selection module is used to select a corresponding target verification method from preset verification methods based on the dynamic security score of the transmission node. The preset verification methods include at least two verification methods with different verification strengths, and the dynamic security score is inversely proportional to the verification strength. The message transmission module is used to perform signature verification on the message to be forwarded through the target verification method, and forward the message to be forwarded to the transmission node if the signature verification is successful.
[0012] Furthermore, to achieve the above objectives, this application also proposes a trusted routing device based on a node hierarchical mechanism in a mobile ad hoc network. The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. The computer program is configured to implement the steps of the trusted routing method based on a node hierarchical mechanism in a mobile ad hoc network as described above.
[0013] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the trusted routing method based on the node hierarchical mechanism in the mobile ad hoc network as described above.
[0014] This application provides a trusted routing method based on a node hierarchical mechanism in a mobile ad hoc network. The method includes: when there is a message to be forwarded, obtaining a dynamic security score of the transmission node based on the network message transmission parameters of the transmission node, wherein the dynamic security score is used to characterize the message transmission reliability of the transmission node; selecting a corresponding target verification method from preset verification methods based on the dynamic security score of the transmission node, wherein the preset verification methods include at least two verification methods with different verification strengths, and the dynamic security score is inversely proportional to the verification strength; performing signature verification on the message to be forwarded through the target verification method, and forwarding the message to be forwarded to the transmission node if the signature verification passes.
[0015] The trusted routing method based on a node hierarchical mechanism in mobile ad hoc networks of this application obtains the dynamic security score of the transmitting node based on its network message transmission parameters when a message to be forwarded exists. Based on the dynamic security score, a corresponding target verification method is selected from preset verification methods. The message to be forwarded is then verified using the target verification method, and if the signature verification passes, the message is forwarded to the transmitting node. Compared to existing methods where each current node performs high-strength digital signature verification on every forwarded message, resulting in high overall network resource consumption when sending messages to highly trusted nodes, this application determines the dynamic security score of the transmitting node and selects a corresponding target verification method from preset verification methods based on that score. Since the dynamic security score is inversely proportional to the verification strength of the verification method, the current node can perform lower-strength signature verification when sending messages to highly trusted nodes, thereby reducing overall network resource consumption. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application; Figure 2 This is a flowchart illustrating the first embodiment of the trusted routing method based on node hierarchical mechanism in mobile ad hoc networks according to this application. Figure 3 This is a flowchart illustrating the second embodiment of the trusted routing method based on node hierarchical mechanism in mobile ad hoc networks according to this application. Figure 4 This is a schematic diagram of the hybrid encryption process in the second embodiment of the trusted routing method based on node hierarchical mechanism in the mobile ad hoc network of this application; Figure 5 This is a flowchart illustrating the third embodiment of the trusted routing method based on node hierarchical mechanism in mobile ad hoc networks according to this application. Figure 6 This is a flowchart illustrating the overall message forwarding process of the trusted routing method based on a node hierarchical mechanism in this application. Figure 7 This is a block diagram of the trusted routing device based on a node hierarchical mechanism in the mobile ad hoc network of this application.
[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0021] Reference Figure 1 , Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.
[0022] like Figure 1 As shown, the trusted routing device based on a node hierarchical mechanism in this mobile ad hoc network may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to implement communication between these components. The user interface 1003 may be connected to a display screen; optionally, the user interface 1003 may include a standard wired interface or a wireless interface. In this application, the wired interface of the user interface 1003 may be a USB interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or non-volatile memory (NVM), such as a disk storage device. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0023] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0024] like Figure 1 As shown, the memory 1005, which is identified as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a trusted routing program based on a node hierarchical mechanism in a mobile ad hoc network.
[0025] exist Figure 1In the device shown, the network interface 1004 is mainly used to connect to the backend server and communicate with the backend server; the user interface 1003 is mainly used to connect to the user equipment; the device calls the trusted routing program based on the node hierarchical mechanism in the mobile ad hoc network stored in the memory 1005 through the processor 1001, and executes the steps of the trusted routing method based on the node hierarchical mechanism in the mobile ad hoc network provided in the embodiments of this application.
[0026] It should be noted that mobile ad hoc networks (MANs) are decentralized, self-organizing, multi-hop communication networks composed of a group of wireless mobile nodes. They are widely used in environments where infrastructure is lacking or cannot rely on fixed base stations, such as battlefield communications, disaster relief, vehicular networks, intelligent transportation, and temporary meetings. In these scenarios, nodes function as both hosts and routers, collaborating with each other to store, forward, and route messages. Currently, existing routing mechanisms, to ensure security, require each current node to perform strong digital signature verification for every message forwarded. This results in high overall network resource consumption, even when sending messages to highly trusted nodes. Therefore, reducing overall network resource consumption has become a pressing technical problem.
[0027] Therefore, to address the aforementioned shortcomings, this application provides a trusted routing method based on a node hierarchical mechanism in a mobile ad hoc network. The method includes: when a message to be forwarded exists, obtaining a dynamic security score of the transmission node based on its network message transmission parameters, wherein the dynamic security score characterizes the message transmission reliability of the transmission node; selecting a corresponding target verification method from preset verification methods based on the dynamic security score of the transmission node, wherein the preset verification methods include at least two verification methods with different verification strengths, and the dynamic security score is inversely proportional to the verification strength; performing signature verification on the message to be forwarded using the target verification method, and forwarding the message to be forwarded to the transmission node if the signature verification passes.
[0028] The trusted routing method based on node hierarchical mechanism in the mobile ad hoc network of this application obtains the dynamic security score of the transmission node and selects the corresponding target verification method from the preset verification methods according to the dynamic security score of the transmission node. The dynamic security score is inversely proportional to the verification strength. Finally, the signature verification of the message to be forwarded is performed through the target verification method. This allows for the execution of lower-strength signature verification when sending messages to highly trusted nodes, thereby reducing the overall network resource consumption.
[0029] For ease of understanding, the following is combined with Figures 2 to 7 This application provides a detailed description of the trusted routing method based on a node hierarchical mechanism in mobile ad hoc networks.
[0030] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the trusted routing method based on a node hierarchical mechanism in a mobile ad hoc network according to this application. The first embodiment of the trusted routing method based on a node hierarchical mechanism in a mobile ad hoc network according to this application is proposed, as follows: Figure 2 As shown, in this embodiment, the specific method includes: Step S10: If there is a message to be forwarded, obtain the dynamic security score of the transmission node according to the network message transmission parameters of the transmission node. The dynamic security score is used to characterize the message transmission reliability of the transmission node.
[0031] It is understood that the method in this embodiment can be applied to a trusted routing device (hereinafter referred to as the device) based on the node hierarchical mechanism in the above-mentioned mobile ad hoc network. The device can be any device with data processing, program running and data acquisition functions, such as a computer, server, etc., and is not limited in this embodiment.
[0032] It should be noted that the aforementioned message to be forwarded can be a data packet received from the upper-layer application that needs to be sent to the destination node, such as a piece of text or a control command. In this embodiment, it can be a message that needs to be transmitted from the current node to the transmission node.
[0033] It should also be noted that the aforementioned transmission node can be an adjacent node within the current node's communication range that is included in the candidate list and participates in the forwarding decision. For example, the current node may select the neighboring node with the highest score as the transmission node after sorting the dynamic security scores of each neighboring node in descending order.
[0034] It is understood that the aforementioned network message transmission parameters may include historical behavioral data of the aforementioned transmission nodes during the message forwarding process, such as message forwarding success rate, message drop rate, connection duration with neighboring nodes, connection frequency, and time series variance of social similarity with neighboring nodes.
[0035] It is also understandable that the above dynamic security score can be a real value used to quantify the reliability of a node's message transmission in the current network environment. The higher the score, the more reliable the node is. For example, a decimal between 0 and 1, 0.85 indicates that the node has high message transmission reliability.
[0036] In its implementation, when the current node has messages to forward, it first obtains the network message transmission parameters of the transmitting node. The current node can read parameters from its local neighbor node information table, such as the number of successful message forwardings, the number of message drops, connection records with the current node, and the number of social interactions with the transmitting node in a recent period. Subsequently, the current node calculates the dynamic security score of the transmitting node based on these parameters. This dynamic security score reflects the reliability of the transmitting node's message transmission.
[0037] Step S20: Select the corresponding target verification method from the preset verification methods according to the dynamic security score of the transmission node. The preset verification methods include at least two verification methods with different verification strengths. The dynamic security score is inversely proportional to the verification strength.
[0038] It should be noted that the above-mentioned preset verification methods can be pre-configured signature verification methods, such as fast verification methods based on hash message authentication codes, key hash value verification methods based on whitelists and timeliness, and digital signature verification methods based on asymmetric encryption.
[0039] It should also be noted that the aforementioned verification strength can refer to a comprehensive measure of computational complexity, resource consumption, and security assurance level during the verification process. Higher verification strength indicates greater computational load, more processor and memory resources consumed, and stronger resistance to tampering. For example, the computational complexity of Rivest-Shamir-Adleman (RSA) digital signature verification is far higher than that of Hash-based Message Authentication Code (HMAC) tag verification. In this embodiment, the dynamic security score is inversely proportional to the verification strength. That is, when the dynamic security score of the transmitting node is higher (the more trustworthy the node), the device selects a lower strength verification method (less resource consumption); conversely, when the dynamic security score is lower (the less trustworthy the node), the device selects a higher strength verification method (more stringent security checks). For example, when transmitting the aforementioned message to be forwarded to a highly trustworthy node with a score above a high threshold, only a low-strength HMAC integrity verification is required, while when transmitting the aforementioned message to a trustworthy node with a score between the high and low thresholds, a medium-strength whitelist + timestamp verification is required.
[0040] It is understood that the target verification method mentioned above can be a specific verification strategy selected from the preset verification methods and corresponding to the current dynamic security score of the transmission node. For example, when the transmission node is determined to be a highly trusted node, the target verification method is integrity verification based on hash message authentication code.
[0041] In its implementation, after acquiring the dynamic security score of the transmission node, the device selects a corresponding target verification method from preset verification methods based on the score. The preset verification methods include at least two verification methods with different verification strengths, and the dynamic security score is inversely proportional to the verification strength. Specifically, the device pre-stores mapping relationships between multiple intervals of the dynamic security score and various preset verification methods. The device compares the calculated dynamic security score with these intervals to determine which interval the score falls into, and then selects the preset verification method corresponding to that interval as the target verification method. A higher score corresponds to a lower verification strength, and vice versa. Subsequently, the device performs signature verification on the message using the selected target verification method.
[0042] Step S30: Perform signature verification on the message to be forwarded using the target verification method, and if the signature verification passes, forward the message to be forwarded to the transmission node.
[0043] It should be noted that the aforementioned signature verification can refer to the process of verifying the authenticity, integrity, and non-repudiation of a message using digital signature technology. For example, it can determine whether a message has been tampered with or forged by comparing whether the digital signature attached to the message matches the hash value recalculated based on the message content. In this embodiment, the specific implementation of the signature verification depends on the selection of the target verification method; that is, different target verification methods correspond to different signature verification operations.
[0044] In its implementation, after selecting a target verification method, the device performs signature verification on the message to be forwarded using that method. Specifically, the device extracts signature information from the encapsulated data of the message to be forwarded and performs a verification operation according to the verification rules corresponding to the target verification method. If the verification passes, it indicates that the message to be forwarded has not been tampered with during transmission and its source is trustworthy, so the device forwards the message to the transmission node. If the verification fails, the device discards the message and does not perform a forwarding operation.
[0045] Furthermore, to clarify which verification method to use under what circumstances, in this embodiment, the step of selecting the corresponding target verification method from the preset verification methods based on the dynamic security score of the transmission node includes: Step S21: If the dynamic security score of the transmission node is higher than the first preset dynamic threshold, the transmission node is determined to be a highly trusted node, and the first preset verification method corresponding to the highly trusted node is selected as the target verification method from the preset verification methods. The first preset verification method is the integrity verification method based on hash message authentication code.
[0046] It should be noted that the aforementioned first preset dynamic threshold can be a pre-set scoring threshold used to distinguish high-trust nodes from other nodes. For example, it can be a value dynamically calculated based on the average and standard deviation of the dynamic security scores of all nodes in the network. In this embodiment, the aforementioned first preset dynamic threshold can be expressed as... Furthermore, in this embodiment, the aforementioned first preset dynamic threshold... It can be composed of two parts: a base threshold and a reward increment, which can be more specifically obtained by the following formula: ; In the above formula, ω is an adjustable reward coefficient, and σ is the standard deviation of the dynamic security scores of all nodes in the network, used to quantify the dispersion or volatility of the dynamic security scores of all nodes. This is the second preset dynamic threshold in this embodiment. The acquisition of this threshold will be described in detail in subsequent steps, but will not be described in detail here.
[0047] The above formula can be further expanded as follows: ; In the above formula, This represents the total number of nodes in the network. Indicates the first in the network 1 node The arithmetic mean of the dynamic security scores of all nodes in the network. The dynamic security score for node i will be explained in detail in subsequent steps. The specific methods of obtaining it will not be detailed here.
[0048] in The arithmetic mean of the dynamic security scores of all nodes in the network is calculated using the following formula: ; Thus far, the specific process of obtaining the first preset dynamic threshold in this embodiment has been described in detail.
[0049] It should also be noted that the aforementioned highly trustworthy nodes can refer to nodes whose dynamic security scores are higher than the first preset dynamic threshold. These nodes exhibit high message transmission reliability in the network and are considered trustworthy. The aforementioned first preset verification method can be the verification method with the lowest verification strength corresponding to the highly trustworthy node, selected from the preset verification methods.
[0050] It is understandable that the above-mentioned integrity verification method based on hash message authentication codes can refer to a verification method that determines the integrity of a message by comparing whether the HMAC tag attached to the message matches the HMAC value recalculated by the verifier. For example, the current node uses a key shared with the source node to perform a hash operation on the message content to generate an HMAC value, and compares it with the HMAC tag attached to the message. If the two match, the verification is successful.
[0051] In its implementation, after obtaining the dynamic security score of the transmission node, the device compares the score with a first preset dynamic threshold. If the dynamic security score is higher than the first preset dynamic threshold, the device determines the transmission node as a highly trusted node. Subsequently, the device selects the first preset verification method corresponding to the highly trusted node from preset verification methods as the target verification method. The first preset verification method is an integrity verification method based on hash message authentication codes. The device uses this method to perform message signature verification, that is, the device recalculates the HMAC value of the message based on the locally stored shared key and compares it with the HMAC tag attached to the message. After successful verification, the device forwards the message to the transmission node.
[0052] Step S22: If the dynamic security score of the transmission node is not higher than the first preset dynamic threshold but higher than the second preset dynamic threshold, then the transmission node is determined to be a trusted node, and the second preset verification method corresponding to the trusted node is selected as the target verification method from the preset verification methods. The second preset verification method is a key hash value verification method based on whitelist and timeliness.
[0053] It should be noted that the aforementioned second preset dynamic threshold can be a pre-set scoring threshold used to distinguish between trusted and malicious nodes. For example, it can be the first preset dynamic threshold multiplied by a proportional coefficient or a value dynamically determined based on the security score distribution of all nodes in the network. In this embodiment, it can be used... Furthermore, in this embodiment, the aforementioned second preset dynamic threshold... The dynamic adjustment is set to 70% of the current average network security score, which can be more specifically obtained using the following formula: ; Thus far, the specific process of obtaining the aforementioned second preset dynamic threshold in this embodiment has been described in detail.
[0054] It should also be noted that the aforementioned trusted nodes can refer to nodes whose dynamic security scores are not higher than the first preset dynamic threshold but are higher than the second preset dynamic threshold. Such nodes have a medium level of trust in the network, neither as reliable as highly trusted nodes nor as malicious nodes.
[0055] It is understandable that the aforementioned second preset verification method can be a verification method selected from the preset verification methods, with a verification strength that is moderate for trusted nodes. The aforementioned key hash value verification method based on whitelists and timeliness can refer to a method of determining message trustworthiness by checking whether the session key hash value carried in the message to be forwarded exists in the key whitelist maintained locally by the current node, and verifying whether the timestamp of the whitelist entry is within its validity period. For example, the current node extracts the hash value of the session key from the message, queries whether the same hash value exists in the local whitelist, and simultaneously checks whether the difference between the record time of the entry and the current time is less than a preset validity period threshold. If both checks pass, the message is confirmed to be trustworthy.
[0056] In its implementation, after obtaining the dynamic security score of the transmission node, the device compares the score with a first preset dynamic threshold and a second preset dynamic threshold. If the dynamic security score of the transmission node is not higher than the first preset dynamic threshold but is higher than the second preset dynamic threshold, the device determines that the transmission node is a trusted node. Subsequently, the device selects the second preset verification method corresponding to the trusted node from preset verification methods as the target verification method. The second preset verification method is a key hash value verification method based on a whitelist and timeliness. The device uses this method to verify the message to be forwarded, specifically including: extracting the hash value of the session key from the message to be forwarded, checking whether the hash value exists in the locally maintained key whitelist, and verifying whether the timestamp of the whitelist entry is within the validity period. After all checks pass, the device confirms that the message is trusted and forwards the message to be forwarded to the transmission node. If any check fails, the verification fails, and the device does not perform the forwarding operation.
[0057] Step S23: If the dynamic security score of the transmission node is not higher than the second preset dynamic threshold, then the transmission node is determined to be a malicious node, and verification is refused and the message to be forwarded is refused to be forwarded to the transmission node.
[0058] It should be noted that the aforementioned malicious nodes can refer to nodes whose dynamic security score is lower than the second preset dynamic threshold. Such nodes exhibit abnormal or untrustworthy characteristics in terms of message forwarding behavior, connection stability, or consistency of social behavior, and are considered potential security threat nodes.
[0059] It is understandable that the aforementioned refusal to perform verification may mean that the device does not perform any signature verification operation on the message to be forwarded. This is because, after determining that the transmission node is a malicious node, the device no longer assigns any verification method to that node, thereby saving computing resources and avoiding forwarding messages to the malicious node. The aforementioned refusal to forward the message to the transmission node may mean that the device stops the current forwarding process and does not send the message to the malicious node.
[0060] In its implementation, after obtaining the dynamic security score of the transmission node, the device compares the score with a second preset dynamic threshold. If the dynamic security score of the transmission node is not higher than the second preset dynamic threshold, the device determines that the transmission node is a malicious node. Subsequently, the device refuses to perform verification, that is, it does not perform any signature verification operation on the message to be forwarded. At the same time, the device refuses to forward the message to be forwarded to the transmission node and directly stops the current forwarding process. The device can choose to continue searching for other neighboring nodes as candidate transmission nodes, or temporarily retain the message to be forwarded in its local cache to wait for the next forwarding opportunity, but it will not send any messages to nodes that have been marked as malicious.
[0061] Furthermore, in order to accurately obtain the aforementioned dynamic security score, in this embodiment, the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node includes: Step S11: Determine the message delivery reliability parameters of the transmission node based on the difference between the message forwarding success rate and the message discard rate of the transmission node.
[0062] It should be noted that the aforementioned message forwarding success rate can refer to the ratio of the number of messages successfully forwarded by the transmitting node to the total number of messages to be forwarded received. For example, if a node successfully forwards 95 messages in a recent period and receives a total of 100 messages, the forwarding success rate is 0.95, which can be expressed as follows in this embodiment: Furthermore, in this embodiment, the message forwarding success rate... It can be obtained through the following formula: ; In the above formula, Represents a node The number of messages successfully forwarded Represents a node The number of messages discarded. Represents a node Total number of messages received and awaiting forwarding.
[0063] It should also be noted that the aforementioned message drop rate can refer to the ratio of the number of messages actively dropped by the transmitting node to the total number of messages it receives awaiting forwarding. For example, if a node drops 5 messages and receives a total of 100 messages, the drop rate is 0.05. In this embodiment, it can be expressed as... Similar to the message forwarding success rate mentioned above, in this embodiment, the message discard rate... It can be obtained through the following formula: ; In the above formula, This indicates the number of messages that node i actively discarded.
[0064] It is understandable that the aforementioned message delivery reliability parameter can be a numerical value used to quantify the reliability of a node in message forwarding behavior. A higher value indicates that the node is more likely to successfully forward messages rather than discard them, thus exhibiting higher behavioral reliability. In this embodiment, it can be expressed as... .
[0065] It can also be understood that the aforementioned difference can refer to the value obtained by subtracting the drop rate from the forwarding success rate. This difference reflects the net effect of a node's active forwarding and passive dropping behavior during message transmission. The larger the difference, the more reliable the node's forwarding behavior. Therefore, in this embodiment, it can be expressed as: .
[0066] In its implementation, the aforementioned device determines the message delivery reliability parameter of a transmission node based on the difference between the message forwarding success rate and the message drop rate. Specifically, the device first reads the number of successfully forwarded messages, the number of dropped messages, and the total number of received messages from the locally maintained neighbor node history records. Then, the device calculates the message forwarding success rate by dividing the number of successfully forwarded messages by the total number of received messages. Simultaneously, the device calculates the message drop rate by dividing the number of dropped messages by the total number of received messages. Finally, the device subtracts the message drop rate from the calculated message forwarding success rate; the difference is the message delivery reliability parameter of the transmission node. A higher parameter value indicates greater reliability in message delivery behavior of the transmission node.
[0067] Step S12: Determine the connection stability parameters of the transmission node based on the average connection duration and connection frequency between the transmission node and its neighboring nodes.
[0068] It should be noted that the aforementioned average connection duration can refer to the arithmetic mean of the duration of each connection between the transmitting node and its neighboring nodes. For example, if the transmitting node establishes three connections with its neighboring nodes within the observation period, with durations of 100 seconds, 150 seconds, and 200 seconds respectively, then the average connection duration is 150 seconds. In this embodiment, it can be used as... More specifically, in this embodiment, the average connection duration... It can be obtained through the following formula: ; In the above formula, Represents a node Number of connections, This represents the duration of the k-th connection.
[0069] It should also be noted that the aforementioned connection frequency can refer to the number of times the transmission node establishes connections with its neighboring nodes per unit time. For example, if 4 connections are established within a time window Δt, where Δt is 5 minutes, then the connection frequency is 0.8 times / minute. In this embodiment, it can be used as... More specifically, in this embodiment, the connection frequency... It can be obtained through the following formula: ; In the above formula, Represents a node In the time window Number of connections within, This refers to the observation time window.
[0070] The aforementioned connection stability parameter can be a value used to quantify the connection stability and interaction activity of the transmission node in the network. A higher value indicates that the transmission node can maintain a single connection for a longer period and has a higher interaction frequency, thus exhibiting higher connection stability. In this embodiment, it can be used... More specifically, in this embodiment, the connection stability parameter... It can be obtained through the following formula: ; In its implementation, the device determines the connection stability parameter of the transmission node based on the average connection duration and connection frequency between the transmission node and its neighboring nodes. Specifically, the device reads historical connection data between the transmission node and each neighboring node over a past period from its locally maintained neighbor connection records, including the start and end times of each connection. Then, the device calculates the duration of each connection and divides the sum of all connection durations by the total number of connections to obtain the average connection duration. Simultaneously, the device counts the total number of connections established by the transmission node within a set time window Δt, and divides this number by Δt to obtain the connection frequency. Finally, the device multiplies the average connection duration by the connection frequency; the product is the connection stability parameter of the transmission node. A higher parameter value indicates greater reliability in terms of connection stability.
[0071] Step S13: Determine the social behavior consistency parameter of the transmission node based on the time series variance of the social similarity between the transmission node and each neighboring node within a preset time period.
[0072] It should be noted that the aforementioned social similarity can refer to the degree of similarity between the transmission node and a neighboring node at the level of social interaction. For example, it can be quantified by the proportion of the number of connections between the two nodes to the sum of the number of connections of all nodes in the cluster. The higher the value, the closer the social relationship between the two nodes.
[0073] It should also be noted that the aforementioned preset time period can be a relatively long time window used to capture the long-term trends and periodicity of node behavior patterns, such as the past 24 hours or 7 days. This time period differs from the short time window Δt used when calculating connection frequency. The aforementioned time series variance can be a statistical measure of the deviation between the social similarity values calculated at multiple discrete time points within the preset time period and their arithmetic mean. A larger variance indicates more drastic fluctuations in social similarity and more unstable behavior patterns.
[0074] It should be understood that the aforementioned social behavior consistency parameter can be a numerical value used to quantify the stability of the transmission node's behavior during social interactions with its neighboring nodes. A higher value indicates that the transmission node's social behavior pattern is more predictable and stable, thus possessing higher cooperation credibility. In this embodiment, it can be used... More specifically, in this embodiment, the social behavior consistency parameter... It can be obtained through the following formula: ; In the above formula, for The current set of neighbors, For a specific time node and Social similarity Indicates within the time window Within, a series of discrete time points The measurements obtained above The sample variance.
[0075] In this embodiment, the social similarity between two nodes can be quantified by calculating the ratio of the number of connections between the current node and encountered nodes to the sum of the number of connections between the current node and all nodes in the cluster. and Social similarity It can be obtained through the following formula: ; In the above formula, Let E(i,j) represent the total number of nodes in the cluster, and let E(i,j) represent the number of connections between node i and node j. This represents the sum of the number of connections made by all nodes within the cluster. .
[0076] In this embodiment, Indicates within the time window Within, a series of discrete time points The measurements obtained above The sample variance is calculated using the following formula: ; in Indicates time window The number of samplings within the range, i.e., the number of times the social similarity value is calculated. Indicates the first Each sampling time point ,node and nodes Social similarity between them Indicates within the time window Inside, all The arithmetic mean, representing the window internal nodes and The average level or central trend of social similarity. What we need to measure is the degree to which the similarity at each moment deviates from this average level.
[0077] In its implementation, the device determines the social behavior consistency parameter of the transmission node based on the time series variance of the social similarity between the transmission node and its neighboring nodes over a preset time period. Specifically, the device first divides the preset time period into multiple time slots with short time windows Δt as intervals. At the end of each time slot, it calculates the social similarity between the transmission node and its current neighboring nodes, thus forming a time series of social similarity for each neighboring node. Subsequently, for each neighboring node, the device calculates the variance of the time series corresponding to that neighboring node. This variance reflects the degree of fluctuation in the social similarity between the transmission node and that neighboring node over time. Then, the device subtracts the variance from 1 to obtain the stability of that neighboring node. Next, the device takes the arithmetic mean of the stability of all neighboring nodes, and the resulting value is the social behavior consistency parameter of the transmission node. The higher the parameter value, the more stable the social relationship between the transmission node and its neighboring nodes, and the more consistent the behavioral patterns.
[0078] Step S14: The message passing behavior reliability parameter, the connection stability parameter, and the social behavior consistency parameter are weighted and calculated to obtain the dynamic security score.
[0079] It should be noted that the above weighted calculation can refer to a calculation method in which different parameters are multiplied by their corresponding weight coefficients and then summed. For example, a weight of 0.4 is set for the message transmission behavior reliability parameter, a weight of 0.3 is set for the connection stability parameter, and a weight of 0.3 is set for the social behavior consistency parameter. The three are then weighted and summed to obtain a dynamic security score.
[0080] In its implementation, the device calculates the message delivery reliability parameter, connection stability parameter, and social behavior consistency parameter of the transmission node, respectively. Then, it weights these three parameters to obtain a dynamic security score for the transmission node. Specifically, the device obtains three pre-configured weight coefficients, corresponding to message delivery reliability, connection stability, and social behavior consistency, respectively. Then, the device multiplies each parameter by its corresponding weight coefficient and adds the three products together to obtain the dynamic security score. This score comprehensively reflects the trustworthiness of the transmission node across multiple dimensions; a higher score indicates a more reliable node.
[0081] This embodiment obtains the dynamic security score of the transmission node and selects the corresponding target verification method from the preset verification methods based on the dynamic security score of the transmission node. The dynamic security score is inversely proportional to the verification strength. Finally, the target verification method is used to perform signature verification on the message to be forwarded. This allows for lower strength signature verification when sending messages to highly trusted nodes, thereby reducing the overall network resource consumption.
[0082] Reference Figure 3 , Figure 3 This is a flowchart illustrating the second embodiment of the trusted routing method based on a node hierarchical mechanism in a mobile ad hoc network of this application. Based on the first embodiment described above, a second embodiment of the trusted routing method based on a node hierarchical mechanism in a mobile ad hoc network of this application is proposed.
[0083] To ensure accurate transmission of the message to be forwarded when the transmission node is the final destination node, in this embodiment, before the step of selecting the corresponding target verification method from the preset verification methods based on the dynamic security score of the transmission node, the method further includes: Step S01: Determine whether the transmission node is the destination node.
[0084] It should be noted that the aforementioned destination node can refer to the mobile ad hoc network node to which the message to be forwarded ultimately needs to be delivered, such as the receiving node specified when the source node initiates communication. The destination node is the endpoint of message transmission; once the message reaches the destination node, delivery is complete, and forwarding ceases.
[0085] In its implementation, before forwarding a message to a transmission node, the device first determines whether the transmission node is the destination node. Specifically, the device reads the destination node identifier (e.g., the network address or ID of the destination node) from the header or encapsulation information of the message to be forwarded and compares this identifier with the node identifier of the transmission node. If they match, the device determines that the transmission node is the destination node; if they do not match, the device determines that the transmission node is not the destination node. This determination will affect the subsequent selection of the verification method: when the transmission node is the destination node, the device can proceed with the verification process for the destination node; when the transmission node is not the destination node, the device continues to select the corresponding target verification method based on the dynamic security score.
[0086] Step S02: If the transmission node is the destination node, the message to be forwarded is verified using the destination node verification method, which is a digital signature verification method based on asymmetric encryption.
[0087] It should be noted that the aforementioned destination node verification method refers to the signature verification method used when the transmitting node is confirmed as the final receiving node of the message to be forwarded.
[0088] It should also be noted that the aforementioned digital signature verification method based on asymmetric encryption can refer to a method that uses asymmetric encryption algorithms (such as RSA) to verify digital signatures. This verification method has high computational complexity and resource consumption, and is used to ensure the end-to-end authenticity and integrity of messages from the source node to the destination node. Unlike the aforementioned verification methods based on hash message authentication codes or whitelist timeliness, the destination node verification method does not rely on intermediate nodes; instead, the destination node independently completes the final confirmation of the message source and the validity of the session key.
[0089] In its implementation, after determining that the transmission node is the destination node, the device verifies the message to be forwarded using a destination node verification method. This destination node verification method is a digital signature verification method based on asymmetric encryption. Specifically, the device performs a digital signature verification operation on the message to be forwarded, corresponding to the encryption process of the source node, to confirm the authenticity and integrity of the message. If the verification passes, it indicates that the message to be forwarded was indeed sent by a legitimate source node and has not been tampered with; if the verification fails, the device discards the message to be forwarded. Subsequently, after successful verification, the device can further process the message content (e.g., decrypt the ciphertext and view it). Compared to the verification method targeting the current node, the destination node verification method is stronger, aiming to provide the highest level of security for the final delivery of the message.
[0090] Step S03: If the transmission node is not the destination node, then the step of selecting the corresponding target verification method from the preset verification methods based on the dynamic security score of the transmission node is executed.
[0091] In its implementation, after determining that the transmission node is not the destination node, the device executes the step of selecting a corresponding target verification method from preset verification methods based on the transmission node's dynamic security score. Specifically, the device proceeds to the verification method selection process described above, that is, based on the calculated dynamic security score of the transmission node, it determines the range in which the score falls, and selects the target verification method corresponding to the score from a variety of preset verification methods. Subsequently, the device uses the selected target verification method to perform signature verification on the message to be forwarded. If the verification passes, the message is forwarded to the transmission node. If the verification fails, the device does not perform the forwarding operation.
[0092] Furthermore, to ensure security during message transmission, refer to Figure 4 , Figure 4 This is a schematic diagram of the hybrid encryption process in the second embodiment of the trusted routing method based on node hierarchical mechanism in mobile ad hoc networks of this application, as shown below. Figure 4 As shown, in this embodiment, before the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node, the following steps are included: Step S001: Generate a random symmetric key, and encrypt the message to be forwarded using the symmetric key to obtain ciphertext data.
[0093] It should be noted that the aforementioned symmetric key can refer to the key used in encryption algorithms that use the same key for both encryption and decryption, such as the 128-bit, 192-bit, or 256-bit random number sequence used in the Advanced Encryption Standard (AES) encryption algorithm.
[0094] It should also be noted that the above-mentioned random generation can refer to generating unpredictable key values through a random number generator, such as using a cryptographically secure pseudo-random number generator to generate a 128-bit random number as an AES session key.
[0095] It is understandable that the aforementioned ciphertext data may refer to the data format obtained after the original message to be forwarded has been converted by a symmetric encryption algorithm and cannot be directly read. Only by decrypting it with the same symmetric key can the original message content be recovered.
[0096] In its implementation, the aforementioned device first generates a random symmetric key, for example, by generating a 128-bit random number as the AES symmetric key (e.g., ...). Figure 4 In the process, an AES random symmetric key is generated. Subsequently, the device uses the symmetric key to encrypt the message to be forwarded (e.g., ...). Figure 4 In this process, the actual data is encrypted using an AES key to obtain ciphertext data (such as...). Figure 4 In this process, the device takes the message to be forwarded as plaintext input, uses a symmetric encryption algorithm and the symmetric key to encrypt the plaintext, and outputs ciphertext data that cannot be directly read. This ciphertext data can be transmitted over the network, and even if intercepted by a malicious node, the original message content cannot be recovered because the correct symmetric key is not available.
[0097] Step S002: Obtain the asymmetric encryption public key of the destination node, and encrypt the symmetric key with the public key to obtain the encryption key.
[0098] It should be noted that the asymmetric encryption public key of the aforementioned destination node can refer to the encryption key publicly disclosed by the destination node for use in asymmetric encryption algorithms. This public key can be paired with the corresponding private key, and data encrypted with the public key can only be decrypted with the same private key.
[0099] It should also be noted that the aforementioned encryption key may refer to the key data in ciphertext form obtained by encrypting the symmetric key using the public key. This encryption key can be publicly transmitted on the network, and only the destination node with the corresponding private key can decrypt and restore the original symmetric key.
[0100] In its implementation, after generating a random symmetric key and encrypting the message to be forwarded to obtain ciphertext data, the device acquires the destination node's asymmetric encryption public key. The device can obtain this public key from a local cache, routing table, or through certificate exchange. Subsequently, the device encrypts the symmetric key using the public key (e.g., ...). Figure 4 In this process, the receiver's RSA public key is used to encrypt the AES key, resulting in the encryption key (e.g., ...). Figure 4 (In the process, obtain the encrypted AES key).
[0101] At this point, the device has obtained two intermediate data sets: ciphertext data (obtained by encrypting the message to be forwarded with a symmetric key) and an encryption key (obtained by encrypting the symmetric key with the destination node's public key). In the hybrid encryption process of this embodiment, the device first encapsulates these two data sets into an intermediate object. This intermediate object contains the encrypted message content and the encrypted symmetric key, but does not yet contain a digital signature. Subsequently, in the subsequent signing step, the device creates a digital signature and combines this digital signature with the intermediate object to form the final data payload.
[0102] Step S003: Generate a digital signature for the message to be forwarded using the asymmetric encryption private key of the source node.
[0103] It should be noted that the asymmetric encryption private key of the aforementioned source node can refer to the decryption or signature key held and strictly kept confidential by the source node itself, used in asymmetric encryption algorithms. This private key corresponds to the public key that the source node publishes to the outside world, and the data generated using the private key can be verified using the corresponding public key.
[0104] It should also be noted that the aforementioned digital signature can refer to data obtained by encrypting specific data (such as the hash value of the session key, message identifier, HMAC tag, etc.) with a private key. This signature can serve as an electronic certificate of the authenticity and integrity of the message source. The recipient uses the public key of the source node to verify the signature to confirm that the message has not been tampered with and indeed comes from the source node.
[0105] In its implementation, after completing the hybrid encryption and obtaining an intermediate object of ciphertext data and encryption key, the device generates a digital signature for the message to be forwarded using the source node's asymmetric encryption private key. Specifically, the device first performs a hash operation on key information associated with the message to be forwarded (such as the hash value of the session key, HMAC tag, message ID, source node information, etc.) to obtain a fixed-length digest. Then, it uses the source node's own asymmetric encryption private key to encrypt the digest, and the encryption result is the digital signature.
[0106] Step S004: Encapsulate the ciphertext data, the encryption key, and the digital signature into a data payload.
[0107] It should be noted that the aforementioned data payload refers to a complete data unit that, after encapsulation, can be transmitted over the network. This data unit contains three parts: ciphertext data, encryption key, and digital signature. The data payload is the final message format sent from the source node to the next-hop node or destination node. The receiver can extract the necessary information from this data payload for decryption and signature verification.
[0108] In its implementation, the device first encapsulates the ciphertext data and encryption key into an intermediate object, then generates a digital signature, and combines this digital signature with the intermediate object to form the final data payload. This data payload can be stored in a local cache, awaiting forwarding when it encounters a suitable transmission node. During subsequent forwarding, the receiving node or relay node can extract the ciphertext data, encryption key, and digital signature from this data payload and perform corresponding verification operations (e.g., verifying HMAC tags, whitelist hash values, or digital signatures) according to its own trust level. This encapsulation method unifies encryption protection and signature authentication within a single data unit, ensuring message confidentiality while providing verification evidence for authenticity and integrity.
[0109] Correspondingly, given the aforementioned data payload, the step of performing signature verification on the message to be forwarded using the target verification method, and forwarding the message to be forwarded to the transmission node if the signature verification passes, includes: Step S31: Perform signature verification on the data payload using the target verification method, and if the signature verification passes, forward the data payload to the transmission node.
[0110] In its implementation, after selecting a target verification method, the device performs signature verification on the data payload using that method. Specifically, the device extracts necessary information (such as HMAC tags, session key hashes, etc.) from the data payload according to the previously selected verification method (e.g., low-strength HMAC verification or medium-strength whitelist verification) and performs the corresponding verification operation. If the verification passes, it indicates that the message content in the data payload has not been tampered with during transmission and its source is trustworthy. Subsequently, the device forwards the entire data payload to the transmission node. If the verification fails, the device discards the data payload and does not perform the forwarding operation. It should be noted that the signature verification operation does not involve decrypting the ciphertext data in the data payload, nor does it involve decrypting the encryption key. The verification process is completed independently based solely on signature-related fields (such as HMAC tags, digital signatures, etc.).
[0111] Reference Figure 5 , Figure 5 This is a flowchart illustrating the third embodiment of the trusted routing method based on a node hierarchical mechanism in a mobile ad hoc network according to this application. Based on the above embodiments, this application proposes a third embodiment of the trusted routing method based on a node hierarchical mechanism in a mobile ad hoc network. In order to enable multiple message transmissions, in this embodiment, before the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node, the method further includes: Step S0001: Obtain the remaining number of copies of the message to be forwarded held by the current node.
[0112] It should be noted that the aforementioned current node can refer to the node that is currently executing this method, i.e., the relay node or source node participating in message forwarding in the mobile ad hoc network.
[0113] It should also be noted that the aforementioned remaining replica count can refer to the number of message replicas that the current node still holds that have not yet been forwarded or discarded. Understandably, in the replica control mechanism, each message is assigned an initial replica count (e.g., set to 6) upon creation. Each time the message is successfully forwarded to a neighboring node, the remaining replica count held by the current node decreases accordingly. This count is used to determine whether to continue forwarding the message, preventing the message from being infinitely replicated in the network and consuming network resources. It should be noted that the replica allocation mode mentioned above can support both binary and standard replica allocation modes during message transmission. In binary mode, the sending node and receiving node each receive approximately half the replica count during each forwarding, with the sending node retaining half of its current replica count and the receiving node receiving half of its current replica count. This mode has slow diffusion and low network overhead, making it suitable for resource-constrained high-density networks. In standard mode, the sending node only forwards one replica during each forwarding, retaining one less replica than its current count. This mode has fast diffusion and high network overhead, making it suitable for low-latency networks.
[0114] In its implementation, the device obtains the remaining number of replicas of the message to be forwarded held by the current node. Specifically, before deciding whether to forward a message, the device first queries the current value of the replica counter maintained for that message in its local cache. This counter records the remaining forwarding quota for that message that has not yet been utilized. The device can obtain the remaining number of replicas by reading the data corresponding to the message. This number decreases with each successful forwarding and serves as the basis for subsequent forwarding decisions.
[0115] Step S0002: If the number of remaining replicas is greater than a preset threshold, then execute the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node.
[0116] It should be noted that the aforementioned preset threshold can be a pre-defined positive integer used to determine whether there are enough copies of the message available for continued forwarding, for example, set to 1. When the number of remaining copies is greater than this threshold, it indicates that the message is still eligible for further propagation; if the number of remaining copies is less than or equal to this threshold, forwarding is stopped to avoid wasting network resources.
[0117] In its implementation, after obtaining the number of remaining copies of the message to be forwarded held by the current node, the device compares the number of remaining copies with a preset threshold. If the number of remaining copies is greater than the preset threshold, the device executes the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node, that is, continues the subsequent transmission node selection, score calculation and forwarding process.
[0118] Step S0003: If the number of remaining copies is less than or equal to the preset number threshold, then stop the forwarding process of the message to be forwarded.
[0119] It should be noted that stopping the forwarding of the message to be forwarded may mean that the device no longer adds the message to the forwarding queue or passes it to any neighboring node, that is, terminating the propagation process of the message at the current node.
[0120] In its implementation, after obtaining the remaining number of copies of the message to be forwarded held by the current node, the device compares the remaining number of copies with a preset threshold. If the remaining number of copies is less than or equal to the preset threshold, the device stops forwarding the message to be forwarded.
[0121] Furthermore, to maximize the probability of successful message delivery, in this embodiment, the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node includes: Step S101: Obtain the dynamic security score corresponding to each adjacent node based on the network message transmission parameters of each adjacent node.
[0122] It should be noted that the aforementioned adjacent nodes can refer to other mobile ad hoc network nodes within the current node's communication range that can directly exchange data. In this step, the device does not only obtain a score for a single transmission node, but calculates the dynamic security score for each of the current node's adjacent nodes in order to select the optimal transmission node subsequently.
[0123] In its implementation, when message forwarding is required, the device first obtains a list of all neighboring nodes of the current node. Then, for each neighboring node in the list, the device calculates a dynamic security score based on its network message transmission parameters (including message forwarding success rate, message drop rate, average connection duration, connection frequency, and social similarity time series variance). The device can iterate through the entire set of neighboring nodes, generating a dynamic security score for each node. This score quantifies the reliability of message transmission for each neighboring node; a higher score indicates a more trustworthy node and a more suitable candidate for the next transmission node. After calculation, the device obtains a mapping table or list containing neighboring node identifiers and their corresponding dynamic security scores.
[0124] Step S102: Sort the dynamic security scores corresponding to each adjacent node in descending order, and select the adjacent node with the highest score as the transmission node.
[0125] It should be noted that the descending order sorting mentioned above can refer to arranging the values from largest to smallest. For example, sorting the dynamic security score set {0.65, 0.92, 0.35} into {0.92, 0.65, 0.35}. The neighboring node with the highest score can refer to the node that is in the first position after descending order sorting, that is, the node with the largest dynamic security score among all neighboring nodes.
[0126] In its implementation, after acquiring the dynamic security scores of each adjacent node, the device sorts all the dynamic security scores of the adjacent nodes in descending order. Based on the sorting result, the device selects the adjacent node with the highest score as the transmission node. Specifically, the device retrieves the first node from the sorted list (i.e., the node with the highest score) and designates it as the next-hop transmission node for the message to be forwarded. If multiple adjacent nodes have the same highest score, the device can select any one of them (e.g., the node with the smallest node identifier). After selection, the device uses this transmission node for subsequent target verification method selection, signature verification, and message forwarding.
[0127] Reference Figure 6 , Figure 6 This is a flowchart illustrating the overall message forwarding process of the trusted routing method based on a node hierarchical mechanism in this application, as follows: Figure 6As shown, the message forwarding process of the trusted routing method based on the node hierarchical mechanism is divided into three core stages: message creation, message forwarding decision, and message reception. The specific execution steps are as follows: In the message creation stage, firstly, replica initialization is performed and the number of replicas is set. Then, RSA-AES hybrid encryption is performed (including two sub-steps: 1. AES encryption of data, 2. RSA encryption of AES key). Next, a hierarchical digital signature is created and an HMAC tag + signature is generated. Finally, the ciphertext + encryption key + signature are encapsulated into the data payload (i.e., Figure 6 (Security message), and the message is cached after completion.
[0128] After entering the message forwarding decision-making stage, the first step is to perform replica filtering, that is, to determine whether the number of remaining replicas is greater than or equal to a preset number threshold (i.e., Figure 6 If the number of remaining replicas is less than 1, skip it and it cannot be forwarded. If the number of remaining replicas is equal to the preset threshold, further check if the candidate list is empty. If it is empty, execute no forwarding action. If it is not empty, sort the nodes in the candidate list according to their security scores and select the node with the highest score for forwarding. If the number of remaining replicas is greater than the preset threshold, add the above message to the forwardable list and traverse all connections, checking the status of all adjacent nodes (i.e., ...). Figure 6 The system checks the other node to see if it is currently transmitting a message (i.e., the other node is in the process of transmitting a message). Figure 6 If the node isTransferring, skip the connection; otherwise, check if the node's trust status is trusted (i.e., it is a trusted node). Figure 6 If the node isTrustedNode is an untrusted node, the malicious node is skipped. If the node is trusted, the message status is checked to determine whether the other node already has the message. If so, the connection is skipped and other connections are checked. Otherwise, the original routing logic is executed. If the message passes the filtering of the original routing logic, it is added to the candidate list. If the message does not pass the filtering, other connections are checked.
[0129] Upon entering the message receiving phase, the system first checks if the node is the destination node. If it is, the system proceeds to the destination node verification process. If the verification is successful, the message is delivered. If the verification fails, the message is discarded. If the node is not the destination node, the system proceeds to the relay node verification process (i.e., the transmission node verification in this embodiment). If the verification is successful, both the sender and receiver update the message copy. If the number of updated message copies is less than or equal to 1, the system determines that the message is exhausted and the forwarding ends. If the number of updated message copies is greater than 1, the message continues to be forwarded.
[0130] In addition, refer to Figure 7 , Figure 7This is a block diagram of the trusted routing device based on a node hierarchical mechanism in the mobile ad hoc network of this application. Figure 7 As shown in the embodiments of this application, a trusted routing device based on a node hierarchical mechanism in a mobile ad hoc network is also proposed. This trusted routing device based on a node hierarchical mechanism in a mobile ad hoc network includes: The scoring acquisition module 701 is used to acquire the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node when there is a message to be forwarded. The dynamic security score is used to characterize the message transmission reliability of the transmission node. The method selection module 702 is used to select a corresponding target verification method from the preset verification methods according to the dynamic security score of the transmission node. The preset verification methods include at least two verification methods with different verification strengths, and the dynamic security score is inversely proportional to the verification strength. The message transmission module 703 is used to perform signature verification on the message to be forwarded through the target verification method, and forward the message to be forwarded to the transmission node if the signature verification is successful.
[0131] Furthermore, this application also proposes a storage medium, which is a computer-readable storage medium, storing a computer program. When the computer program is executed by a processor, it implements the steps of the trusted routing method based on the node hierarchical mechanism in the mobile ad hoc network as described above.
[0132] The device in this embodiment obtains the dynamic security score of the transmission node and selects the corresponding target verification method from the preset verification methods based on the dynamic security score of the transmission node. The dynamic security score is inversely proportional to the verification strength. Finally, the device performs signature verification on the message to be forwarded through the target verification method. This allows for lower-strength signature verification when sending messages to highly trusted nodes, thereby reducing the overall network resource consumption.
[0133] Other embodiments or specific implementations of the trusted routing device based on the node hierarchical mechanism in the mobile ad hoc network described in this embodiment can be referred to the above-described method embodiments, and will not be repeated here.
[0134] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0135] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0136] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0137] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A trusted routing method based on a node hierarchical mechanism in a mobile ad hoc network, characterized in that, The method includes: In the case of messages to be forwarded, a dynamic security score of the transmission node is obtained based on the network message transmission parameters of the transmission node. The dynamic security score is used to characterize the message transmission reliability of the transmission node. The target verification method is selected from the preset verification methods based on the dynamic security score of the transmission node. The preset verification methods include at least two verification methods with different verification strengths. The dynamic security score is inversely proportional to the verification strength. The message to be forwarded is signed using the target verification method, and if the signature verification is successful, the message to be forwarded is forwarded to the transmission node.
2. The method as described in claim 1, characterized in that, The step of selecting the corresponding target verification method from the preset verification methods based on the dynamic security score of the transmission node includes: If the dynamic security score of the transmission node is higher than the first preset dynamic threshold, the transmission node is determined to be a highly trusted node, and the first preset verification method corresponding to the highly trusted node is selected as the target verification method from the preset verification methods. The first preset verification method is an integrity verification method based on hash message authentication code. If the dynamic security score of the transmission node is not higher than the first preset dynamic threshold but higher than the second preset dynamic threshold, then the transmission node is determined to be a trusted node, and the second preset verification method corresponding to the trusted node is selected as the target verification method from the preset verification methods. The second preset verification method is a key hash value verification method based on whitelist and timeliness. If the dynamic security score of the transmission node is not higher than the second preset dynamic threshold, the transmission node is determined to be a malicious node, and verification is refused and the message to be forwarded is refused to be forwarded to the transmission node.
3. The method as described in claim 1, characterized in that, The step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node includes: The message delivery reliability parameter of the transmission node is determined based on the difference between the message forwarding success rate and the message discard rate of the transmission node. The connection stability parameters of the transmission node are determined based on the average connection duration and connection frequency between the transmission node and its neighboring nodes. The social behavior consistency parameter of the transmission node is determined based on the time series variance of the social similarity between the transmission node and each neighbor node within a preset time period. The dynamic security score is obtained by weighting the message passing behavior reliability parameter, the connection stability parameter, and the social behavior consistency parameter.
4. The method as described in claim 1, characterized in that, Before the step of selecting the corresponding target verification method from the preset verification methods based on the dynamic security score of the transmission node, the method further includes: Determine whether the transmission node is the destination node; If the transmission node is the destination node, the message to be forwarded is verified using a destination node verification method, which is a digital signature verification method based on asymmetric encryption. If the transmission node is not the destination node, then the step of selecting the corresponding target verification method from the preset verification methods based on the dynamic security score of the transmission node is executed.
5. The method as described in claim 1, characterized in that, Before the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node, the following steps are included: Generate a random symmetric key, and encrypt the message to be forwarded using the symmetric key to obtain ciphertext data; Obtain the asymmetric encryption public key of the destination node, and encrypt the symmetric key with the public key to obtain the encryption key; A digital signature for the message to be forwarded is generated using the asymmetric encryption private key of the source node; The ciphertext data, the encryption key, and the digital signature are encapsulated into a data payload; The step of performing signature verification on the message to be forwarded using the target verification method, and forwarding the message to the transmission node if the signature verification is successful, includes: The data payload is signed and verified using the target verification method, and if the signature verification is successful, the data payload is forwarded to the transmission node.
6. The method as described in claim 1, characterized in that, Before the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node, the method further includes: Get the remaining number of copies of the message to be forwarded held by the current node; If the number of remaining replicas is greater than a preset threshold, then the step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node is executed. If the number of remaining copies is less than or equal to the preset number threshold, then the forwarding process of the message to be forwarded is stopped.
7. The method as described in claim 1, characterized in that, The step of obtaining the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node includes: The dynamic security score corresponding to each adjacent node is obtained based on the network message transmission parameters of each adjacent node. The dynamic security scores corresponding to each adjacent node are sorted in descending order, and the adjacent node with the highest score is selected as the transmission node.
8. A trusted routing device based on a node hierarchical mechanism in a mobile ad hoc network, characterized in that, The device includes: The scoring acquisition module is used to obtain the dynamic security score of the transmission node based on the network message transmission parameters of the transmission node when there is a message to be forwarded. The dynamic security score is used to characterize the message transmission reliability of the transmission node. The method selection module is used to select a corresponding target verification method from preset verification methods based on the dynamic security score of the transmission node. The preset verification methods include at least two verification methods with different verification strengths, and the dynamic security score is inversely proportional to the verification strength. The message transmission module is used to perform signature verification on the message to be forwarded through the target verification method, and forward the message to be forwarded to the transmission node if the signature verification is successful.
9. A trusted routing device based on a node hierarchical mechanism in a mobile ad hoc network, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the trusted routing method based on a node hierarchical mechanism in a mobile ad hoc network as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the trusted routing method based on the node hierarchical mechanism in a mobile ad hoc network as described in any one of claims 1 to 7.