Automatic networking method, device and system
By identifying the root node in the Internet of Things (IoT) and constructing a root chain form for encrypted communication, a tree structure is formed, which solves the problems of diverse IoT terminal types and complex connections, and simplifies software design and improves network security.
Patent Information
- Application Number
- CN202511601209.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-04
- Publication Date
- 2026-03-17
AI Technical Summary
The wide variety of IoT terminal types and complex connection methods in IoT networking lead to complex hardware application software design issues.
An automatic networking method is provided, which discovers neighboring nodes in the same network domain by controlling multiple terminal nodes, determines the root node based on the root node priority value, and uses the root node to build a root chain form and conduct encrypted communication with interaction messages, forming a tree structure based on nodes, which simplifies data interaction between terminal nodes.
It reduces the difficulty of hardware application software design caused by the wide variety of IoT terminal types and complex connection methods, improves network security and reliability, and simplifies the software development process.
Smart Images

Figure CN121691010A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, in particular to an automatic networking method, an automatic networking device, an automatic networking system, a machine readable storage medium and a computer program product. BACKGROUND
[0002] With the pace of advancing of intelligent factory, intelligent park, city intelligent network and other technologies, the data communication security of Internet of Things and Internet of Things terminal application scenarios gradually becomes more and more important. At present, in the Internet of Things networking, there are wide types of Internet of Things terminals and complex connection modes, which lead to complex hardware application software design. SUMMARY
[0003] The purpose of the embodiments of the present application is to provide an automatic networking method, device and system, which are used to solve the problem of complex hardware application software design caused by wide types of Internet of Things terminals and complex connection modes in the Internet of Things networking.
[0004] In order to achieve the above purpose, the embodiments of the present application provide an automatic networking method, comprising: controlling a plurality of terminal nodes to discover neighbor nodes in a same network domain through a preset method; in the case that all the terminal nodes belong to the neighbor nodes in the same network domain, controlling the plurality of terminal nodes to interact with each other through respective negotiation messages; the negotiation message of each terminal node comprises node attributes of each terminal node; the node attributes at least comprise a root node priority value; determining a root node in all the terminal nodes based on a comparison result of the root node priority value of all the terminal nodes; controlling the root node to send a negotiation confirmation message to all normal terminal nodes to complete initial networking; the normal terminal nodes represent terminal nodes in the plurality of terminal nodes excluding the root node.
[0005] Optionally, the method further comprises: controlling the root node to construct a root node topology table based on the node attributes of the root node and all the normal terminal nodes; controlling the root node to generate a root chain table; the root chain table comprises a plurality of root chains; each root chain comprises a loop sequence identifier, a loop key and a time stamp; controlling the root node to construct a first interaction message based on the root node topology table and the root chain table; encrypting the first interaction message by using a set initial key to obtain a first encrypted message; controlling the root node to send the first encrypted message to all the normal terminal nodes.
[0006] Optionally, the method further comprises: controlling the root node to generate an updated root chain based on the random cycle sequence identifier and the node attribute of all ordinary terminal nodes, and to generate an updated root node topology table based on the node attribute of all current nodes; controlling the root node to construct a second interaction message based on the updated root node topology table and the updated root chain; determining the cycle key of the last root chain in the root chain table as an updated key; encrypting the second interaction message with the updated key to obtain a second encrypted message; controlling the root node to send the second encrypted message to all ordinary terminal nodes.
[0007] Optionally, the node attribute further comprises a node identifier; and the controlling the root node to generate an updated root chain based on the random cycle sequence identifier and the node attribute of all ordinary terminal nodes comprises: controlling the root node to generate an updated root chain based on the random cycle sequence identifier and the node identifier of all ordinary terminal nodes.
[0008] Optionally, the method further comprises: controlling all ordinary terminal nodes to update the root chain table based on the updated root chain, and controlling all ordinary terminal nodes to take the cycle key of the latest root chain received as an encryption key for data interaction.
[0009] Optionally, the method further comprises: controlling the new terminal node to discover neighbor nodes in the same network domain through a preset method; in a case where the new terminal node and the plurality of terminal nodes all belong to neighbor nodes in the same network domain, controlling the new terminal node and all ordinary terminal nodes to perform data interaction with each other through respective negotiation messages to establish an adjacency relationship; controlling the new terminal node to send a root chain synchronization negotiation message to the adjacency terminal node of the new terminal node; the root chain synchronization negotiation message comprising a node attribute of the new terminal node; controlling the adjacency terminal node to forward the root chain synchronization negotiation message to the root node; controlling the root node to perform admission authentication on the root chain synchronization negotiation message of the new terminal node; in a case where the new terminal node completes the admission authentication, controlling the root node to send a special interaction message to the adjacency terminal node; the special interaction message comprising at least a root chain with a latest timestamp. Control the adjacent terminal node to update the root chain based on the latest timestamp of the root chain, and set the adjacent terminal node as a branch node; The branch node is controlled to send the root chain with the latest timestamp, the root node topology form of the branch node, and the root chain form to the newly added terminal node.
[0010] Optionally, controlling the root node to perform admission authentication on the root chain synchronization negotiation message of the newly added terminal node includes: The root node is controlled to perform access authentication on the root chain synchronization negotiation message of the newly added terminal node using a whitelist or feedback information from the management node; The whitelist includes all trusted terminal nodes; the feedback information of the management node represents the access authentication feedback information made by the administrator to the newly added terminal node using the management node; the management node is any one of the root node, the branch node, and the ordinary terminal node.
[0011] Optionally, the method further includes: In the event of an error in directly establishing an adjacency relationship between the first terminal node and the second terminal node, the first terminal node and the second terminal node are controlled to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in their respective root chain forms.
[0012] Optionally, controlling the first terminal node and the second terminal node to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in their respective root chain forms includes: The system controls the first terminal node to construct a first verification request based on multiple first random cyclic sequence identifiers in the root chain form, and controls the first terminal node to send the first verification request to the second terminal node. The second terminal node is controlled to respond to the first verification request, and the circular key corresponding to each of the plurality of first random circular sequence identifiers is determined based on the root chain form of the second terminal node; The second terminal node is controlled to calculate a first hash value based on the sum of the circular keys corresponding to each first random circular sequence identifier; Control the second terminal node to send the first hash value to the first terminal node, and construct a second verification request based on multiple second random cyclic sequence identifiers in the root chain form of the second terminal node, and control the second terminal node to send the second verification request to the first terminal node; The first terminal node is controlled to verify the first hash value based on the circular key corresponding to each of the first random circular sequence identifiers; If the first hash value verification passes, control the first terminal node to respond to the second verification request and determine the cycle key corresponding to each of the plurality of second random cycle sequence identifiers based on the root chain table of the first terminal node; The first terminal node is controlled to calculate a second hash value based on the sum of the cyclic keys corresponding to each second random cyclic sequence identifier; Control the first terminal node to send the second hash value to the second terminal node; The second terminal node is controlled to verify the second hash value based on the circular key corresponding to each second random circular sequence identifier; If the second hash value verification is successful, control the interaction of mutual trust verification success information between the first terminal node and the second terminal node to suggest adjacency relationships; Control the interaction between the first terminal node and the second terminal node on the root chain with the latest timestamp.
[0013] Optionally, the method further includes: In the event of an error in establishing an adjacency relationship between the third and fourth terminal nodes indirectly through an intermediate node, the intermediate node and the fourth terminal node are controlled to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in the root chain form; the intermediate node is the root node or the branch node. If the node mutual trust verification between the intermediate node and the fourth terminal node is successful, control the exchange of mutual trust verification success information between the intermediate node and the fourth terminal node to suggest adjacency relationships; The intermediate node is controlled to forward the third interaction message of the third terminal node to the fourth terminal node in order to request the node attributes of the fourth terminal node; Control the interaction of negotiation messages between the intermediate node and the fourth terminal node so that the fourth terminal node can obtain the root chain with the latest timestamp; The fourth terminal node is controlled to respond to the third interaction message and send a response message to the third terminal node; the response message includes the node attributes of the fourth terminal node.
[0014] Optionally, controlling the intermediate node and the fourth terminal node to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in the root chain form includes: The intermediate node is controlled to construct a third verification request based on multiple third random cyclic sequence identifiers in the root chain form, and the intermediate node is controlled to send the third verification request to the fourth terminal node; The fourth terminal node is controlled to respond to the third verification request, and the circular key corresponding to each of the plurality of third random circular sequence identifiers is determined based on the root chain form of the fourth terminal node; The fourth terminal node is controlled to calculate the third hash value based on the sum of the circular keys corresponding to each third random circular sequence identifier; The fourth terminal node is controlled to send the third hash value to the intermediate node; The intermediate node is controlled to verify the third hash value based on the circular key corresponding to each of the third random circular sequence identifiers; If the third hash value verification is successful, the node mutual trust verification between the intermediate node and the fourth terminal node is successful.
[0015] On the other hand, embodiments of the present invention also provide an automatic networking device, comprising: The discovery module is used to control multiple terminal nodes to discover neighboring nodes in the same network domain through preset methods. The interaction module is used to control the data interaction between multiple terminal nodes through their respective negotiation messages when the multiple terminal nodes are all neighbor nodes in the same network domain; the negotiation message of each terminal node includes the node attributes of each terminal node; the node attributes include at least the root node priority value; The determination module is used to determine the root node among all terminal nodes based on the comparison results of the root node priority values of all terminal nodes. The networking module is used to control the root node to send negotiation confirmation messages to all ordinary terminal nodes to complete the initial networking; the ordinary terminal nodes represent the terminal nodes among the multiple terminal nodes excluding the root node.
[0016] On the other hand, embodiments of the present invention also provide an automatic networking system, including multiple terminal nodes, wherein the multiple terminals are used to implement the above-described automatic networking method.
[0017] On the other hand, the present invention also provides a machine-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described automatic networking method.
[0018] On the other hand, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described automatic networking method.
[0019] Through the above technical solution, the embodiments of the present invention transform the various connection protocols and interface protocols of traditional Internet of Things (IoT) into terminal node connections and data interaction sessions between terminal nodes, forming a tree structure based on nodes. The embodiments of the present invention no longer need to concern themselves with the complexity of IoT network connections between terminals and between network center services, greatly reducing the difficulty of software development. The embodiments of the present invention solve the problem that the wide variety of IoT terminal types and complex connection methods in existing solutions lead to complex hardware application software design.
[0020] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0021] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating the automatic networking method provided by the present invention; Figure 2 This is a schematic diagram of the network domain tree structure provided by the present invention; Figure 3 This is one of the flowcharts illustrating the initialization of the network in the automatic networking method provided by this invention; Figure 4 This is the second schematic diagram of the initial networking process in the automatic networking method provided by the present invention; Figure 5 This is the third flowchart illustrating the initialization process of the automatic networking method provided by this invention. Figure 6 This is a schematic diagram of the negotiation message provided by the present invention; Figure 7 This is the fourth flowchart illustrating the initialization process of the automatic networking method provided by this invention. Figure 8 This is the fifth flowchart illustrating the initialization process of the automatic networking method provided by this invention. Figure 9 This is one of the schematic diagrams of the process for adding a new terminal node to the network provided by the present invention; Figure 10 This is the second schematic diagram of the process for adding a new terminal node to the network provided by the present invention; Figure 11 This is the third schematic diagram of the process for adding a new terminal node to the network provided by the present invention; Figure 12 This is a schematic diagram of the mutual trust authentication process in the direct connection mode provided by the present invention; Figure 13 This is a schematic diagram of the mutual trust authentication process under the indirect mode provided by the present invention; Figure 14 This is a schematic diagram of the automatic networking device provided by the present invention. Detailed Implementation
[0022] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.
[0023] Method Implementation Examples Please refer to Figure 1 This invention provides an automatic networking method, comprising: Step 100: Control multiple terminal nodes to discover neighboring nodes in the same network domain through a preset method.
[0024] Please refer to Figure 2 In the IoT network of this invention, various terminals are defined with corresponding roles: Terminal Point (TP), Branch Point (BP), Root Point (RP / BackupRoot Point, BRP), and Management Point (MP). These roles collectively constitute a network domain tree structure. When terminal nodes communicate, they identify themselves and other terminals using node identifiers (Point id, Pid), and use different roles to distinguish their functions and roles in the IoT network. Each node maintains neighbor and adjacency relationships with other nodes. Root and branch nodes determine the topology and structure through adjacency relationships. The terms used in this invention are explained below: Terminal node representation: In this embodiment of the invention, all IoT nodes with dynamic networking capabilities are classified as terminal nodes, which are the most basic node types in the IoT network. Terminal nodes receive and maintain their own root chain form and the root node topology form published by the root node.
[0025] Branch node representation: In this embodiment of the invention, if a terminal node provides relay services for other terminal nodes and maintains the link between other terminal nodes and the root node, then the terminal node becomes a branch node. In addition to the functions of the aforementioned terminal node, the branch node also includes the adjacency relationship of the terminal nodes it relays.
[0026] The root node is a crucial service node in this embodiment of the invention. It is automatically selected from terminal nodes or branch nodes, or its priority can be manually set. The root node serves all terminal nodes and branch nodes adjacent to it in the IoT network, periodically publishing root chain and root topology updates. Simultaneously, the root node maintains a list of authentication information for all nodes within the IoT network, facilitating identity verification during mutual trust queries between terminal nodes.
[0027] The backup root node acts as a backup to the root node, simulating the root node with its own PID and synchronizing with it in real time. Its root chain list, root topology list, and authentication information list remain consistent with the root node. The adjacency list of the terminal node contains the PID and topology information of both the root node and the backup root node. If the root node is lost or communication is interrupted, the terminal node will first check the status of the backup root node and restore the connection.
[0028] The management node, as the management interface node in the IoT network, primarily provides an operational interface for administrators. It can display and control the authentication and access of all network terminal nodes, node data interaction methods (relay or direct connection), root node replacement, and priority settings. The management node can be set as any terminal node, branch node, or root node. Initially, its priority is specified by the initially set root node priority value (or RP-prefer parameter).
[0029] The service network refers to a CDN service network located on the Internet. Its main function is to facilitate end nodes distributed in non-standalone networks and Internet environments to find root nodes in the same network domain. The service network provides root nodes or branch nodes exposed on the Internet with the opportunity to publish their adjacency state. The initial settings of the end nodes include specific Tracker certificates, and they use TLS to connect to specific Tracker service networks.
[0030] An Autonomous System Area (ASA) refers to a set of virtual networks formed by nodes with the same ASA identifier in this embodiment of the invention. This set features automatic network formation and autonomous root node election. It distributes keys to automatically joining nodes and possesses root authentication and mutual trust authentication characteristics. Hereinafter referred to as a network domain. Figure X The logical topology and tree topology in the X example diagram describe the network domain.
[0031] Direct mode: This mode can be published by the root node, allowing all nodes within the network domain to form adjacencies and directly exchange data. In direct mode, if an adjacency relationship between nodes fails to be established, mutual authentication can be used to authenticate each other, allowing nodes that have interrupted their key loop to quickly rejoin the network domain.
[0032] Indirect mode: This mode can be published by the root node. In indirect mode, all communication and data exchange between nodes is forwarded by the root node or a backup root node. End nodes do not directly establish adjacency relationships with each other; end nodes only establish adjacency relationships with the root node or a backup root node. In indirect mode, node authentication is performed by the root node, providing stronger control over the network domain than in direct mode.
[0033] Negotiation Message (Hello Message): When nodes in a network domain establish adjacency relationships, they send HelloMessages (hereinafter referred to as Hello messages) to negotiate the adjacency relationship. Hello messages contain different flags to distinguish the function of the message, such as adjacency status request, root node status request, root node relay request, etc.
[0034] Exchange Message: Nodes that have established adjacency relationships in a network domain exchange data through exchange messages (hereinafter referred to as Exchange messages). In addition to general data exchange, Exchange messages also carry the update and publication content of the root chain and root topology.
[0035] The term "neighbor" refers to other nodes of various types within the same network domain that a node in the IoT network of this embodiment can discover through methods such as Ethernet multicast, Bluetooth broadcast, and Zigbee mesh discovery. After discovering the existence of other types of nodes, the terminal node defines them as neighbors; at this point, there is no actual data interaction between the nodes.
[0036] Adjacency refers to the process where neighboring nodes establish an adjacency relationship by sending Hello messages when they need to interact. These Hello messages contain information such as the node's current PID, root node connection status, and basic node status. Hello messages are encrypted using a loop key and marked with a flag. If the exchange of Hello messages is successful, the two nodes form an adjacency relationship and begin sending Exchange messages to exchange topology and configuration information.
[0037] It should be noted that the embodiments of the present invention only provide a general description of the message structure of Hello messages and Exchange messages. In some embodiments, these two message structures may include digital watermarks and specific flag designs for data authenticity auditing.
[0038] Please refer to Figure 3In this embodiment of the invention, terminal nodes (TPs) of the Internet of Things (IoT) network can discover other nodes of various types in the same network domain through multicast or broadcast methods such as Ethernet multicast, Bluetooth broadcast, and Zigbee mesh discovery. Thus, this embodiment of the invention controls multiple terminal nodes to discover neighboring nodes within the same network domain.
[0039] Step 200: When the multiple terminal nodes are all neighboring nodes within the same network domain, control the multiple terminal nodes to interact with each other through their respective negotiation messages; each terminal node's negotiation message includes the node attributes of each terminal node; the node attributes include at least the root node priority value.
[0040] Please refer to Figure 4 When multiple terminal nodes are determined to be neighboring nodes within the same network domain, this embodiment of the invention controls the multiple terminal nodes to interact with each other through negotiation messages (i.e., Hello messages). Each terminal node's negotiation message includes its node attributes. The node attributes of all nodes in this embodiment can be set automatically or manually. Node attributes include required and optional parameters. Before joining a network domain, the required parameters of a node need to be specified, including the node identifier (Point id, Pid), root node priority value (RP-prefer, root node priority), network domain identifier (Asid, network domain id), network domain initial key (ASKey), node terminal certificate (TP-cert), Tracker certificate (Tracker-cert), etc. Table 1 below describes some of the more important parameters: Table 1
[0041] It should be noted that, compared to the traditional dynamic networking process, the network domain identifier ASid and network domain initial key ASKey in the embodiments of the present invention can effectively prevent the access of incorrect terminals in mixed and promiscuous networks.
[0042] In this embodiment of the invention, the negotiation message of each terminal node includes the node attributes of each terminal node. The node attributes include at least a root node priority value. The root node priority value is used in the root node election process during network domain initialization; the larger the value, the higher the priority of the node being elected as the root node. In other embodiments, the root node priority value is also used in the process of preferentially selecting relay branch nodes when a terminal node joins a network domain.
[0043] Step 300: Based on the comparison results of the root node priority values of all terminal nodes, determine the root node among all terminal nodes.
[0044] Multiple neighboring terminal nodes establish adjacency relationships by negotiating messages and exchanging connection information (node attributes) to find the root node. If no existing root node or root node connection is found, a root node election is initiated within the network domain. In one embodiment, the root node priority value of all terminal nodes is compared, and the terminal node with the highest root node priority value is determined as the root node. The term "ordinary terminal node" refers to the terminal nodes among the multiple terminal nodes excluding the root node; that is, at this point, all terminal nodes excluding the root node are considered ordinary terminal nodes.
[0045] It should be noted that the root node election is based on the root node priority value. This parameter can be set manually to facilitate control over the final election results of the root node, backup root node, and management node in this domain.
[0046] Step 400: Control the root node to send negotiation confirmation messages to all ordinary terminal nodes to complete the initial network formation; Please refer to Figure 5 After the root node (RP) election is completed, the root node begins sending negotiation confirmation messages (Hello ACK messages) to all ordinary terminal nodes, thereby completing the initial network formation. In this embodiment of the invention, the process of discovering neighbor nodes and establishing adjacency relationships between nodes employs the concept of the Shortest Path Tree routing algorithm, ultimately forming a tree structure with multiple shortest paths originating from the root node.
[0047] This invention relates to a logical middleware layer built upon Internet of Things (IoT) networks (Ethernet, WLAN, Bluetooth gateways, Zigbee, etc.). It defines a node-based tree structure, transforming traditional IoT connection protocols and interface protocols into node connections and data interaction sessions between nodes. This invention eliminates the need to consider the complexities of IoT network connections between terminal devices and network center services, thereby greatly simplifying application design and improving compatibility.
[0048] Therefore, this invention transforms traditional IoT connection protocols and interface protocols into terminal node connections and data interaction sessions between terminal nodes, forming a node-based tree structure. This invention eliminates the need to consider the complexity of IoT network connections between terminals and between network center services, significantly reducing software development difficulty. This invention also solves the problem of complex hardware application software design caused by the wide variety of IoT terminal types and complex connection methods in existing solutions.
[0049] In other aspects of embodiments of the present invention, the method further includes: Step 500: Control the root node to construct a root node topology form based on the node attributes of the root node and all ordinary terminal nodes.
[0050] In this embodiment of the invention, the root node generates a root node topology form based on the node attributes of all ordinary terminal nodes and branch nodes that have joined the network domain and successfully authenticated. Because the dynamic IoT network topology method in this embodiment employs the shortest path approach, the resulting topology ensures that the path from the root node to each node is unique, and this topology also guarantees the uniqueness of the root node at any given moment. In this embodiment, the root node updates and publishes the root node topology form to each IoT network node in real time, thereby preventing root node spoofing. The root node topology form format is shown in Table 2 below: Table 2
[0051] Wherein: Point type: indicates the node role type, such as root node, terminal node, branch node, management node, etc.; Point id (Pid): indicates the node identifier (or sequence ID) of other nodes in the topology received by the root node, with a total length of 48 bits; Adviser: indicates the publisher of the node's topology information, generally the Pid value of the branch node that published the node; Age: indicates the current node's lifespan, which will be reset after updating the topology state; Link type: indicates the way the current node accesses the IoT network. This invention supports multiple connection methods, not limited to the methods in the above examples; Metrics: indicates the metric value of the node's access to the IoT network. Connection latency, connection method, node computing power, node attribute settings, etc., will all affect this metric value. The metric value is published by each node, and other nodes will perform secondary calculations when generating the topology form. Nodes use this metric value to determine and select the topology structure, and influence the establishment of adjacency relationships between nodes.
[0052] Step 600: Control the root node to generate a root chain form; the root chain form includes multiple root chains; each root chain includes a cycle sequence identifier, a cycle key, and a timestamp.
[0053] After the root node election is completed, the initial root chain form synchronization process is performed. The initial synchronized root chain form contains multiple root chains (or multiple sets of root chains). For example, in one embodiment, the root chain form may include 29+1 sets of root chain data. Each set of root chains contains a loop sequence identifier (Loop id), a loop key, and a timestamp. One set of root chains serves as the loop key for the next root chain synchronization; for example, the last set of root chains in the 29+1 sets serves as the loop key for the next root chain synchronization. The other 29 sets of root chains are used for node mutual trust verification. In one embodiment, the root chain form format is shown in Table 3 below: Table 3
[0054] Step 700: Control the root node to construct a first interactive message based on the root node topology form and the root chain form.
[0055] Step 800: Encrypt the first interactive message using the set initial key to obtain the first encrypted message.
[0056] Step 900: Control the root node to send the first encrypted message to all ordinary terminal nodes.
[0057] The control root node constructs a first exchange message based on the root node topology form and root chain form. This first exchange message for initial root chain synchronization is encrypted using a pre-defined initial key (i.e., the network domain initial key ASKey), resulting in a first encrypted message. The control root node then sends this first encrypted message to all ordinary terminal nodes. All ordinary terminal nodes decrypt the first encrypted message using the network domain initial key ASKey and store the root node topology form and root chain form, thus achieving the initial root chain synchronization.
[0058] In other aspects of embodiments of the present invention, the method further includes: Step 1000: Control the root node interval to set the time period, generate an updated root chain based on the random cyclic sequence identifier and the node attributes of all ordinary terminal nodes, and generate an updated root node topology form based on the node attributes of all current nodes.
[0059] The system controls the root node to automatically generate a root chain and update the root chain form according to a set time period, as well as to generate an updated root node topology form based on the node attributes of all current nodes. Updating the root chain includes a random cyclic sequence identifier and a calculated cyclic key. The calculated cyclic key can be obtained based on the node attributes of all ordinary terminal nodes.
[0060] In one embodiment, the node attributes further include a node identifier; the step of controlling the root node interval to set a time period and generating an updated root chain based on a random cyclic sequence identifier and the node attributes of all ordinary terminal nodes includes: controlling the root node interval to set a time period and generating an updated root chain based on a random cyclic sequence identifier and the node identifiers of all ordinary terminal nodes.
[0061] In this embodiment of the invention, the circular key generated in updating the root chain is generated based on the random circular sequence identifier and the node identifiers of all ordinary terminal nodes. For example, the method for generating the circular key in updating the root chain is as follows: ; in: Represents the circular key for the nth root chain synchronization; The random circular sequence identifier for the nth root chain synchronization (this value is a 24-bit random value). This represents the sum of the Pid values (node identifiers) of all branch nodes and terminal nodes in the latest root node topology table up to the nth root chain synchronization. This indicates the function for performing hash value operations.
[0062] Step 1100: Control the root node to construct a second interactive message based on the updated root node topology form and the updated root chain; Step 1200: Determine the circular key of the last root chain in the root chain form as the update key; Step 1300: Encrypt the second interaction message using the update key to obtain the second encrypted message; Step 1400: Control the root node to send the second encrypted message to all ordinary terminal nodes.
[0063] The control root node constructs a second interaction message based on updating the root node topology form and updating the root chains. The root node determines the circular key of the last root chain in the root chain form as the update key, and uses the update key to encrypt the second interaction message to obtain a second encrypted message; the control root node then sends the second encrypted message to all the ordinary terminal nodes.
[0064] In other aspects of embodiments of the present invention, the method further includes: Step 1500: Control all ordinary terminal nodes to update the root chain form based on the updated root chain, and control all ordinary terminal nodes to use the received latest root chain's circular key as the encryption key for data interaction.
[0065] All ordinary terminal nodes decrypt the second interaction message using the circular key of the last root chain in their own root chain form to obtain the updated root chain. Upon receiving the updated root chain published by the root node, other ordinary terminal nodes in the network domain simultaneously update their own root chain forms and use the circular key of the latest root chain as the encryption key to encrypt the interacting data. Due to the root node's characteristic of synchronizing the root chain and its own topology changes to all terminal nodes or branch nodes at specific time intervals, this root chain form and root node topology form are updated in real time and stored in all IoT nodes. Terminal nodes and branch nodes can verify the circular key received each cycle, ensuring the root node's unforgeable nature, thereby ensuring topology uniqueness and the security of distributed verification.
[0066] It should be noted that during the adjacency establishment process and data exchange, Hello and Exchange messages not only contain fields encrypted using the Loop Key, but also digital watermarking and a flag, further enhancing the unforgeability of the network domain topology. Please refer to [link / reference]. Figure 6 , Figure 6 This illustrates the Ethernet packet structure in one embodiment.
[0067] Thus, the root node and ordinary terminal nodes maintain their adjacency relationship through Hello messages, and update the current network domain root node topology form and root chain through Exchange messages. Please refer to... Figure 7 In direct-connect mode, when terminal nodes in a network domain need to communicate, the terminal node first queries the connection methods of other terminal nodes in the local root node's topology table. If no connection is found, it sends an Exchange message to query the root node. If the desired terminal node information is found, the terminal nodes establish an adjacency relationship and begin data exchange. Please refer to [link to relevant documentation]. Figure 8 In indirect mode, when terminal nodes in a network domain need to communicate, the terminal node first sends a Hello message marked with a specific flag to the root node, carrying the topology information of the corresponding terminal node or branch node, requesting the root node to relay the connection. The root node relays and forwards the Hello message, marking the requester's topology information. After the connection is established, the root node begins relaying Exchange messages between the terminal nodes to complete data exchange.
[0068] This invention presents a root chain encryption method similar to blockchain technology. This method, combined with a dynamic networking approach, effectively addresses the current need for dynamic data encryption in IoT networks. Furthermore, the root chain update method solves the problem of node spoofing in IoT networks. Therefore, in this invention, the generation and updating of the root chain remain synchronized during initialization and root node election, ensuring the security and trustworthiness of nodes throughout the network domain and further improving the reliability of the IoT network in responding to events such as chain breaks, interruptions, and the addition of new nodes.
[0069] In other aspects of embodiments of the present invention, the method further includes: Step 1600: Control the newly added terminal node to discover neighboring nodes in the same network domain through a preset method.
[0070] When a newly added terminal node completes initialization and begins to join the network domain, it will first attempt to discover other neighboring nodes in the network domain through methods such as Ethernet multicast, Bluetooth broadcast, and Zigbee mesh.
[0071] Step 1700: When the newly added terminal node and the multiple terminal nodes are all neighboring nodes in the same network domain, control the newly added terminal node to interact with all the ordinary terminal nodes through their respective negotiation messages to establish an adjacency relationship.
[0072] Please refer to Figure 9 A newly added terminal node (marked in green) attempts to establish adjacency with neighboring nodes via a Hello message (negotiation message). Since the new terminal node carries the same network domain identifier (ASid) and network domain initial key (ASkey), other neighboring nodes will reply with Hello messages carrying a flag, which includes each neighboring node's node attributes (node identifier, root node priority value, network domain identifier, network domain initial key, node terminal certificate, Tracker certificate, etc.). The newly joined node then selects the best adjacency based on these parameters.
[0073] Step 1800: Control the newly added terminal node to send a root chain synchronization negotiation message to the neighboring terminal nodes of the newly added terminal node; the root chain synchronization negotiation message includes the node attributes of the newly added terminal node.
[0074] Step 1900: Control the adjacent terminal node to forward the root chain synchronization negotiation message to the root node.
[0075] Please refer to Figure 10When a new terminal node is added, it sends a Hello message to its neighboring terminal nodes to attempt to join the network domain, and sends a root chain synchronization negotiation message to synchronize the root chain. The neighboring terminal nodes then send the node attributes of the new terminal node (node identifier, root node priority value, network domain identifier, network domain initial key, node terminal certificate, Tracker certificate, and other parameter information) to the root node for authentication.
[0076] Step 2000: Control the root node to perform admission authentication on the root chain synchronization negotiation message of the newly added terminal node.
[0077] Please refer to Figure 10 The root node performs admission authentication on the root chain synchronization negotiation messages of the newly added terminal node. In one embodiment, controlling the root node to perform admission authentication on the root chain synchronization negotiation messages of the newly added terminal node includes: controlling the root node to perform admission authentication on the root chain synchronization negotiation messages of the newly added terminal node using a whitelist or feedback information from the management node; The whitelist includes all trusted terminal nodes; the feedback information of the management node represents the access authentication feedback information made by the administrator to the newly added terminal node using the management node; the management node is any one of the root node, the branch node, and the ordinary terminal node.
[0078] In one embodiment, the root node can perform admission authentication on the root chain synchronization negotiation messages of the newly added terminal node through a whitelist. The whitelist includes the node identifiers of all trusted terminal nodes. The root node can determine that the newly added terminal node has completed admission authentication if its node identifier is in the whitelist; otherwise, if the node identifier of the newly added terminal node is not in the whitelist, the root node can determine that the admission authentication of the newly added terminal node has failed.
[0079] In other embodiments, the root node performs admission authentication on the root chain synchronization negotiation message of the newly added terminal node based on feedback information from the management node. The management node allows administrators to manage the entire IoT network through a single node, completing the authentication and admission of newly added nodes. When a management node with a root node priority value of 0 exists in the IoT network, the administrator uses the admission authentication information provided by the management node for the newly added terminal node, and the root node performs admission authentication on the root chain synchronization negotiation message of the newly added terminal node based on this admission authentication information; alternatively, the administrator uses the management node to indicate that the admission authentication for the newly added terminal node has failed, and the root node determines that the admission authentication for the root chain synchronization negotiation message of the newly added terminal node has failed based on this failure.
[0080] Therefore, this embodiment of the invention enables administrators to manage the entire IoT network through a single management node, completing the authentication and admission process for newly added nodes. In the absence of a management node (when there is no root node in the entire IoT network and its priority value is not 0), the node authentication and admission process is automatically completed using the whitelist set by the root node.
[0081] Step 2100: When the newly added terminal node completes access authentication, control the root node to send a special interaction message to the adjacent terminal node; the special interaction message includes at least the root chain with the latest timestamp.
[0082] Step 2200: Control the adjacent terminal node to update the root chain based on the latest timestamp of the root chain, and set the adjacent terminal node as a branch node.
[0083] Step 2300: Control the branch node to send the root chain with the latest timestamp, the root node topology form of the branch node, and the root chain form to the newly added terminal node.
[0084] Please refer to Figure 11 If the root node's admission authentication is successful, the root node will send a special Exchange message (special interaction message) to the adjacent terminal nodes. This message contains topology parameters such as the authenticated terminal node's PID, as well as the root chain with the latest timestamp. Upon receiving the special Exchange message, the adjacent terminal node updates its own root chain and sets its root node adjacency state (RP-Adj state) to 2 (i.e., changing from a terminal node to a branch node). Subsequently, the branch node sends its root chain with the latest timestamp, its root node topology form, and the root chain form to the newly added terminal node, thus completing the process of adding the new terminal node to the network domain.
[0085] The root chain data update method in this embodiment of the invention is integrated throughout the entire topology change process, thereby ensuring dynamic and distributed data security even when the node topology changes. This is similar to the characteristic of blockchain where data credibility and integrity remain even after block changes.
[0086] In other aspects of embodiments of the present invention, the method further includes: Step 2400: In the event of an error in directly establishing an adjacency relationship between the first terminal node and the second terminal node, control the first terminal node and the second terminal node to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in their respective root chain forms.
[0087] When root chain synchronization is interrupted, a node reconnection process and mutual trust authentication process are established. Direct connection mode allows all nodes within the network domain to form adjacency relationships and directly interact with each other. Direct connection mode can be published by the root node, allowing all nodes within the network domain to form adjacency relationships and directly interact with each other. In direct connection mode, if an error occurs in establishing an adjacency relationship between nodes, mutual trust authentication mode can be used for mutual authentication, allowing nodes that have interrupted key cycles to quickly rejoin the network domain. The first terminal node and the second terminal node are controlled to perform node mutual trust authentication based on the cycle key corresponding to at least one of the cycle sequence identifiers in their respective root chain forms. For example, in direct connection mode, mutual trust authentication between terminal nodes is attempted three times, each time randomly selecting the sum of three random cycle sequence identifiers and their corresponding cycle keys to verify the other party's authentication information.
[0088] For example, step 2400, controlling the first terminal node and the second terminal node to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in their respective root chain forms, includes: Step 2401: Control the first terminal node to construct a first verification request based on multiple first random cyclic sequence identifiers in the root chain form, and control the first terminal node to send the first verification request to the second terminal node.
[0089] Step 2402: Control the second terminal node to respond to the first verification request and determine the circular key corresponding to each of the plurality of first random circular sequence identifiers based on the root chain form of the second terminal node.
[0090] Step 2403: Control the second terminal node to calculate the first hash value based on the sum of the circular keys corresponding to each first random circular sequence identifier.
[0091] Step 2404: Control the second terminal node to send the first hash value to the first terminal node, and construct a second verification request based on multiple second random cyclic sequence identifiers in the root chain form of the second terminal node, and control the second terminal node to send the second verification request to the first terminal node.
[0092] Step 2405: Control the first terminal node to verify the first hash value based on the circular key corresponding to each of the first random circular sequence identifiers.
[0093] Step 2406: If the first hash value verification is successful, control the first terminal node to respond to the second verification request and determine the circular key corresponding to each of the plurality of second random circular sequence identifiers based on the root chain form of the first terminal node.
[0094] Step 2407: Control the first terminal node to calculate the second hash value based on the sum of the circular keys corresponding to each second random circular sequence identifier.
[0095] Step 2408: Control the first terminal node to send the second hash value to the second terminal node.
[0096] Step 2409: Control the second terminal node to verify the second hash value based on the circular key corresponding to each second random circular sequence identifier.
[0097] Step 2410: If the second hash value is verified successfully, control the first terminal node and the second terminal node to exchange mutual trust verification success information to suggest adjacency relationships.
[0098] Step 2411: Control the interaction between the first terminal node and the second terminal node to obtain the root chain of the latest timestamp.
[0099] The first terminal node (TPA) and the second terminal node (TPB) refer to any of the ordinary terminal nodes mentioned above. Please refer to... Figure 12First, the first terminal node sends a negotiation message to the second terminal node to attempt to propose an adjacency relationship. If the second terminal node encounters a circular key decryption error, it sends a mutual verification request to the first terminal node to request mutual trust verification. Next, the first terminal node sends a TLS certificate request to the second terminal node to establish a connection. The second terminal node sends a TLS certificate request to the first terminal node to establish a connection. The system controls the first terminal node to construct a first verification request based on multiple first random circular sequence identifiers in the root chain table, and controls the first terminal node to send the first verification request to the second terminal node. In response to the first verification request, the second terminal node determines the circular key corresponding to each of the multiple first random circular sequence identifiers based on its own root chain table. The system controls the second terminal node to calculate a first hash value based on the sum of the circular keys corresponding to each first random circular sequence identifier. The system controls the second terminal node to send the first hash value to the first terminal node, and to construct a second verification request based on multiple second random circular sequence identifiers in the second terminal node's root chain table, and controls the second terminal node to send the second verification request to the first terminal node. The first terminal node is controlled to calculate a first verification hash value based on the sum of the circular keys corresponding to each of the first random cyclic sequence identifiers. If this first verification hash value matches the first hash value, the first hash value verification is successful. If the first hash value verification is successful, the first terminal node responds to a second verification request and determines the circular key corresponding to each of the multiple second random cyclic sequence identifiers based on the root chain list of the first terminal node. The first terminal node calculates a second hash value based on the sum of the circular keys corresponding to each of the second random cyclic sequence identifiers. The first terminal node sends the second hash value to the second terminal node. The second terminal node calculates a second verification hash value based on the sum of the circular keys corresponding to each of the second random cyclic sequence identifiers. If this second verification hash value matches the second hash value, the second hash value verification is successful. If the second hash value verification is successful, the second terminal node sends a mutual trust verification success message (mutual trust verification success ACK) to the first terminal node to establish an adjacency relationship. The first terminal node sends a mutual trust verification success message (mutual trust verification success ACK) to the second terminal node to establish an adjacency relationship. The system then controls the second terminal node to send the root chain of the latest timestamp to the first terminal node, and controls the first terminal node to send the root chain of the latest timestamp to the second terminal node. The root chain of the latest timestamp includes the circular key for the latest timestamp. The second terminal node selects the circular key for the latest timestamp and sends an acknowledgment response to the first terminal node. The first terminal node selects the circular key for the latest timestamp and sends an acknowledgment response to the second terminal node.It should be noted that the mutual trust verification between the first terminal node and the second terminal node can be attempted multiple times (e.g., 3 times). Each time, the hash value of the sum of 3 random cyclic sequence identifiers and the corresponding cyclic keys is randomly selected to verify the other party's authentication information.
[0100] The advantage of the direct connection mode's mutual trust verification mechanism lies in the fact that in a large-scale IoT network, various nodes are widely distributed, and there are significant differences in network environment, physical environment, and node performance. Inevitably, some root nodes or branch nodes will need to reconnect due to interrupted key cycles. In this situation, the direct connection mode provides a way for nodes to quickly reconnect using existing circular key sequences in their own root chain lists, returning to the network domain to begin the next root chain cycle. This effectively reduces the latency of re-authentication and re-establishment of adjacencies between nodes, and also reduces the data processing burden on the root nodes.
[0101] In other aspects of embodiments of the present invention, the method further includes: Step 2500: In the event of an error in establishing an adjacency relationship between the third terminal node and the fourth terminal node indirectly through an intermediate node, control the intermediate node and the fourth terminal node to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in the root chain form.
[0102] Please refer to Figure 13 The third terminal node (TPA) and the fourth terminal node (TPB) can be any one of the ordinary terminal nodes. Intermediate nodes are either root nodes or branch nodes. When root chain synchronization is interrupted, a node reconnection process and mutual trust authentication process are established. In indirect mode, all communication and data interaction between nodes is forwarded by the root node or backup root node. Indirect mode can be published by the root node. Terminal nodes do not directly establish adjacency relationships with each other; terminal nodes only establish adjacency relationships with the root node or branch nodes. In this mode, node authentication is performed by the root node, providing stronger control over the network domain than in direct connection mode. The failure reconnection and mutual trust authentication process is completed by the root node.
[0103] First, the third terminal node sends a Hello message verification request to the root node. The root node sends a Hello ACK verification success message to the third terminal node. The third terminal node sends a third interaction message to the root node, which requests the node attributes of the fourth terminal node. The root node responds to the third interaction message by sending a wait message to the third terminal node. The root node sends a negotiation message to the fourth terminal node to attempt to suggest an adjacency relationship. If the fourth terminal node encounters a circular key decryption message error, the fourth terminal node sends a mutual verification request to the root node to request mutual trust verification. Next, the root node sends a TLS certificate request to the fourth terminal node to establish a connection. The fourth terminal node sends a TLS certificate request to the root node to establish a connection. The intermediate node and the fourth terminal node are controlled to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in the root chain list. For example, in indirect mode, the mutual trust verification between the root node and the fourth terminal node is attempted three times, each time randomly selecting three random circular sequence identifiers and the sum of their corresponding circular keys to verify the other party's authentication information.
[0104] It should be noted that step 2500 can be set after step 1500 or after step 2300.
[0105] In one embodiment, step 2500, controlling the intermediate node and the fourth terminal node to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in the root chain form, includes: Step 2501: Control the intermediate node to construct a third verification request based on multiple third random cyclic sequence identifiers in the root chain form, and control the intermediate node to send the third verification request to the fourth terminal node.
[0106] Step 2502: Control the fourth terminal node to respond to the third verification request, and determine the circular key corresponding to each of the plurality of third random circular sequence identifiers based on the root chain form of the fourth terminal node.
[0107] Step 2503: Control the fourth terminal node to calculate the third hash value based on the sum of the circular keys corresponding to each third random circular sequence identifier.
[0108] Step 2504: Control the fourth terminal node to send the third hash value to the intermediate node.
[0109] Step 2505: Control the intermediate node to verify the third hash value based on the circular key corresponding to each of the third random circular sequence identifiers.
[0110] Step 2506: If the third hash value verification is successful, the node mutual trust verification between the intermediate node and the fourth terminal node is successful.
[0111] The control root node constructs a third verification request based on multiple third random cyclic sequence identifiers in the root chain form, and sends the third verification request to the fourth terminal node. The control fourth terminal node responds to the third verification request by determining the cycle key corresponding to each of the multiple third random cyclic sequence identifiers based on its own root chain form. The control fourth terminal node calculates a third hash value based on the sum of the cycle keys corresponding to each third random cyclic sequence identifier. The control fourth terminal node sends the third hash value to the root node. The control root node calculates a third verification hash value based on the sum of the cycle keys corresponding to each third random cyclic sequence identifier. If this third verification hash value matches the third hash value, the third hash value verification is successful.
[0112] Step 2600: If the node mutual trust verification between the intermediate node and the fourth terminal node is successful, control the interaction of mutual trust verification success information between the intermediate node and the fourth terminal node to suggest adjacency relationships.
[0113] Step 2700: Control the intermediate node to forward the third interaction message of the third terminal node to the fourth terminal node to request the node attributes of the fourth terminal node.
[0114] Step 2800: Control the interaction of negotiation messages between the intermediate node and the fourth terminal node so that the fourth terminal node can obtain the root chain with the latest timestamp.
[0115] Step 2900: Control the fourth terminal node to respond to the third interaction message and send a response message to the third terminal node; the response message includes the node attributes of the fourth terminal node.
[0116] If the mutual trust verification between the root node and the fourth terminal node is successful, the root node sends a mutual trust verification success message (mutual trust verification success ACK) to the fourth terminal node, and the fourth terminal node sends a mutual trust verification success message (mutual trust verification success ACK) to the root node. The intermediate control node forwards the third interaction message from the third terminal node to the fourth terminal node to request the node attributes of the fourth terminal node. The fourth terminal node sends a Hello message (negotiation message) to the root node to request the root chain with the latest timestamp. The root node responds to the Hello message and sends the root chain with the latest timestamp to the fourth terminal node. The fourth terminal node responds to the third interaction message and sends a response message to the third terminal node; the response message includes the node attributes of the fourth terminal node.
[0117] The advantage of the indirect mode in this embodiment of the invention is that, in a small IoT network, since there are many terminal nodes adjacent to the root node, the root node can directly act as the main gateway, reducing the process of establishing adjacency relationships between terminal nodes and making the data interaction process more convenient.
[0118] In summary, this invention proposes a self-organizing network method for the Internet of Things (IoT). Building upon existing networks such as Ethernet, P2P networks, WLAN, Bluetooth, and Zigbee, it reconstructs a logical middleware layer using node identifiers. This middleware layer manages all communication protocols and methods to the logical nodes and employs a blockchain-like dynamic key encryption method combined with network state for data transmission. The overall IoT terminal, device, hardware application, and software design only need to focus on data flow and message queues, without needing to consider network connectivity, transmission methods, encryption, and other fundamental network conditions. This solution, on the one hand, enables the development of IoT terminal applications using a unified dynamic protocol, significantly reducing software development difficulty; on the other hand, the middleware layer incorporates data escape algorithms and link state algorithms, making IoT device communication more flexible and secure.
[0119] In other words, this invention proposes a dynamic logical networking method using node identifiers and a self-organizing IoT network method using dynamic encryption. It designs a method for logically classifying each terminal device in the IoT network based on node roles. This method effectively solves the problems of the wide variety of IoT terminal device types, chaotic connection methods, and complex hardware application software design. This invention also proposes a root chain encryption method similar to blockchain technology. This method, combined with the dynamic networking method, effectively solves the current need for dynamic data encryption in IoT networks and addresses the problem of node spoofing in IoT networks through this root chain update method. Therefore, this invention solves the problem of data security during the mixing and intermingling of IoT with other networks, as well as the difficulties in terminal authentication and access control in such network environments. This invention also addresses the problem of the current single security encryption method for large-scale IoT, and the risk of replay, hijacking, and forgery attacks with fixed keys or tokens. This invention also designs methods for automatic joining, reconnection after interruption, and mutual trust authentication of IoT node network domains, thereby effectively enabling IoT terminal devices to escape network difficulties due to changes in the connection environment. This invention solves the problem of central nodes in current IoT terminal devices, effectively reducing the problem of overall IoT interruption and crashes caused by centralized services. The embodiments of the present invention solve the problem of terminal getting out of trouble under various networking modes of the Internet of Things, and effectively improve the utilization rate of terminals under various networking modes.
[0120] It should be noted that the dynamic encryption method used in the embodiments of the present invention can be replaced by the dynamic TLS certificate method in other embodiments; the dynamic networking method can be replaced by the WLAN mesh networking method; and the blockchain-like encryption process can be replaced by a simple AES circular key.
[0121] Device Examples Please refer to Figure 14 On the other hand, embodiments of the present invention also provide an automatic networking device, comprising: Discovery module 1401 is used to control multiple terminal nodes to discover neighboring nodes in the same network domain through a preset method; The interaction module 1402 is used to control the multiple terminal nodes to interact with each other through their respective negotiation messages when the multiple terminal nodes are all neighboring nodes in the same network domain; the negotiation message of each terminal node includes the node attributes of each terminal node; the node attributes include at least the root node priority value. The determination module 1403 is used to determine the root node among all terminal nodes based on the comparison result of the root node priority values of all terminal nodes. The networking module 1404 is used to control the root node to send negotiation confirmation messages to all ordinary terminal nodes to complete the initial networking; the ordinary terminal nodes represent the terminal nodes among the multiple terminal nodes excluding the root node.
[0122] Optionally, the device further includes: The first synchronization module is used to control the root node to construct a root node topology form based on the node attributes of the root node and all ordinary terminal nodes; control the root node to generate a root chain form; the root chain form includes multiple root chains; each root chain includes a cycle sequence identifier, a cycle key, and a timestamp; control the root node to construct a first interaction message based on the root node topology form and the root chain form; encrypt the first interaction message using a set initial key to obtain a first encrypted message; and control the root node to send the first encrypted message to all ordinary terminal nodes.
[0123] Optionally, the device further includes: The second synchronization module is used to control the root node to set a time period, generate an updated root chain based on a random cyclic sequence identifier and the node attributes of all ordinary terminal nodes, and generate an updated root node topology form based on the node attributes of all current nodes; control the root node to construct a second interaction message based on the updated root node topology form and the updated root chain; determine the cyclic key of the last root chain in the root chain form as the update key; encrypt the second interaction message using the update key to obtain a second encrypted message; and control the root node to send the second encrypted message to all ordinary terminal nodes.
[0124] Optionally, the node attributes further include a node identifier; the step of controlling the root node interval to set a time period and generating an updated root chain based on a random cyclic sequence identifier and the node attributes of all ordinary terminal nodes includes: The root node interval is controlled to set a time period, and an updated root chain is generated based on the random cyclic sequence identifier and the node identifiers of all ordinary terminal nodes.
[0125] Optionally, the device further includes: The update module is used to control all ordinary terminal nodes to update the root chain form based on the updated root chain, and to control all ordinary terminal nodes to use the received latest root chain's circular key as the encryption key for data interaction.
[0126] Optionally, the device further includes: Control newly added terminal nodes to discover neighboring nodes within the same network domain using a preset method; The new node addition module is used to: control the new terminal node to interact with all ordinary terminal nodes through their respective negotiation messages to establish adjacency relationships when the new terminal node and the multiple terminal nodes belong to the same network domain as neighboring nodes; control the new terminal node to send a root chain synchronization negotiation message to its neighboring terminal nodes; the root chain synchronization negotiation message includes the node attributes of the new terminal node; control the neighboring terminal nodes to forward the root chain synchronization negotiation message to the root node; control the root node to perform admission authentication on the root chain synchronization negotiation message of the new terminal node; when the new terminal node completes admission authentication, control the root node to send a special interaction message to the neighboring terminal nodes; the special interaction message includes at least the root chain with the latest timestamp; control the neighboring terminal nodes to update the root chain based on the root chain with the latest timestamp and set the neighboring terminal node as a branch node; control the branch node to send the root chain with the latest timestamp, the root node topology form of the branch node, and the root chain form to the new terminal node.
[0127] Optionally, controlling the root node to perform admission authentication on the root chain synchronization negotiation message of the newly added terminal node includes: The root node is controlled to perform access authentication on the root chain synchronization negotiation message of the newly added terminal node using a whitelist or feedback information from the management node; The whitelist includes all trusted terminal nodes; the feedback information of the management node represents the access authentication feedback information made by the administrator to the newly added terminal node using the management node; the management node is any one of the root node, the branch node, and the ordinary terminal node.
[0128] Optionally, the device further includes: The first verification module is used to control the first terminal node and the second terminal node to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in their respective root chain forms in the event of an error in directly establishing an adjacency relationship between the first terminal node and the second terminal node.
[0129] Optionally, controlling the first terminal node and the second terminal node to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in their respective root chain forms includes: The system controls the first terminal node to construct a first verification request based on multiple first random cyclic sequence identifiers in the root chain form, and controls the first terminal node to send the first verification request to the second terminal node. The second terminal node is controlled to respond to the first verification request, and the circular key corresponding to each of the plurality of first random circular sequence identifiers is determined based on the root chain form of the second terminal node; The second terminal node is controlled to calculate a first hash value based on the sum of the circular keys corresponding to each first random circular sequence identifier; Control the second terminal node to send the first hash value to the first terminal node, and construct a second verification request based on multiple second random cyclic sequence identifiers in the root chain form of the second terminal node, and control the second terminal node to send the second verification request to the first terminal node; The first terminal node is controlled to verify the first hash value based on the circular key corresponding to each of the first random circular sequence identifiers; If the first hash value verification passes, control the first terminal node to respond to the second verification request and determine the cycle key corresponding to each of the plurality of second random cycle sequence identifiers based on the root chain table of the first terminal node; The first terminal node is controlled to calculate a second hash value based on the sum of the cyclic keys corresponding to each second random cyclic sequence identifier; Control the first terminal node to send the second hash value to the second terminal node; The second terminal node is controlled to verify the second hash value based on the circular key corresponding to each second random circular sequence identifier; If the second hash value verification is successful, control the interaction of mutual trust verification success information between the first terminal node and the second terminal node to suggest adjacency relationships; Control the interaction between the first terminal node and the second terminal node on the root chain with the latest timestamp.
[0130] Optionally, the device further includes: The second verification module is used to control the intermediate node and the fourth terminal node to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in the root chain form when an error occurs in establishing an adjacency relationship between the third terminal node and the fourth terminal node indirectly through an intermediate node; the intermediate node is the root node or the branch node; if the node mutual trust verification between the intermediate node and the fourth terminal node is successful, the module controls the intermediate node and the fourth terminal node to exchange mutual trust verification success information to suggest an adjacency relationship; controls the intermediate node to forward the third interaction message of the third terminal node to the fourth terminal node to request the node attributes of the fourth terminal node; controls the intermediate node and the fourth terminal node to exchange negotiation messages to enable the fourth terminal node to obtain the root chain with the latest timestamp; and controls the fourth terminal node to respond to the third interaction message and send a response message to the third terminal node; the response message includes the node attributes of the fourth terminal node.
[0131] Optionally, controlling the intermediate node and the fourth terminal node to perform node mutual trust verification based on the circular key corresponding to at least one of the circular sequence identifiers in the root chain form includes: The intermediate node is controlled to construct a third verification request based on multiple third random cyclic sequence identifiers in the root chain form, and the intermediate node is controlled to send the third verification request to the fourth terminal node; The fourth terminal node is controlled to respond to the third verification request, and the circular key corresponding to each of the plurality of third random circular sequence identifiers is determined based on the root chain form of the fourth terminal node; The fourth terminal node is controlled to calculate the third hash value based on the sum of the circular keys corresponding to each third random circular sequence identifier; The fourth terminal node is controlled to send the third hash value to the intermediate node; The intermediate node is controlled to verify the third hash value based on the circular key corresponding to each of the third random circular sequence identifiers; If the third hash value verification is successful, the node mutual trust verification between the intermediate node and the fourth terminal node is successful.
[0132] The automatic networking device includes a processor and a memory. The discovery module 1401, interaction module 1402, determination module 1403 and networking module 1404 are all stored in the memory as program units. The processor executes the program units stored in the memory to realize the corresponding functions.
[0133] A processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured.
[0134] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0135] On the other hand, embodiments of the present invention also provide an automatic networking system, including multiple terminal nodes, wherein the multiple terminals are used to implement the above-described automatic networking method.
[0136] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a machine-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the above-described automatic networking method.
[0137] In another aspect, the present invention also provides a machine-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the above-described automatic networking method.
[0138] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0139] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, 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 can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An automatic network formation method characterized by comprising: The method comprises: controlling a plurality of terminal nodes to discover neighbor nodes in a same network domain through a preset method; in a case where the plurality of terminal nodes all belong to neighbor nodes in the same network domain, controlling the plurality of terminal nodes to interact with each other through respective negotiation messages; the negotiation message of each terminal node comprises node attributes of each terminal node; the node attributes at least comprise a root node priority value; determining a root node among all the terminal nodes based on a comparison result of the root node priority values of all the terminal nodes; controlling the root node to send a negotiation confirmation message to all ordinary terminal nodes to complete initial networking; the ordinary terminal node represents a terminal node in the plurality of terminal nodes excluding the root node.
2. The automatic networking method according to claim 1, characterized by, The method further comprises: controlling the root node to construct a root node topology table based on the node attributes of the root node and all the ordinary terminal nodes; controlling the root node to generate a root chain table; the root chain table comprises a plurality of root chains; each root chain comprises a cyclic sequence identifier, a cyclic key and a timestamp; controlling the root node to construct a first interaction message based on the root node topology table and the root chain table; encrypting the first interaction message by using a set initial key to obtain a first encrypted message; controlling the root node to send the first encrypted message to all the ordinary terminal nodes.
3. The automatic networking method according to claim 2, characterized in that, The method further comprises: controlling the root node to generate an updated root chain based on a random cyclic sequence identifier and the node attributes of all the ordinary terminal nodes, and to generate an updated root node topology table based on the node attributes of all the nodes at present, at intervals of a set time period; controlling the root node to construct a second interaction message based on the updated root node topology table and the updated root chain; determining the cyclic key of the last root chain in the root chain table as an updated key; encrypting the second interaction message by using the updated key to obtain a second encrypted message; controlling the root node to send the second encrypted message to all the ordinary terminal nodes.
4. The automatic networking method according to claim 3, characterized in that, The node attributes further comprise a node identifier; and the controlling the root node to generate an updated root chain based on a random cyclic sequence identifier and the node attributes of all the ordinary terminal nodes comprises: controlling the root node to generate an updated root chain based on a random cyclic sequence identifier and the node identifiers of all the ordinary terminal nodes.
5. The automatic networking method according to claim 3, characterized by, The method further comprises: controlling all the ordinary terminal nodes to update the root chain table based on the updated root chain, and controlling all the ordinary terminal nodes to take the cyclic key of the latest root chain received as an encryption key for data interaction.
6. The automatic networking method according to claim 2, wherein The method further comprises: controlling a new terminal node to discover neighbor nodes in a same network domain through a preset method; in a case where the new terminal node and the plurality of terminal nodes all belong to neighbor nodes in the same network domain, controlling the new terminal node and all the ordinary terminal nodes to interact with each other through respective negotiation messages to establish an adjacency relationship. controlling the new terminal node to send a root chain synchronization negotiation message to a neighboring terminal node of the new terminal node; the root chain synchronization negotiation message including a node attribute of the new terminal node; controlling the neighboring terminal node to forward the root chain synchronization negotiation message to the root node; controlling the root node to perform admission authentication on the root chain synchronization negotiation message of the new terminal node; in a case where the new terminal node completes the admission authentication, controlling the root node to send a special interaction message to the neighboring terminal node; the special interaction message including at least a latest timestamp root chain; controlling the neighboring terminal node to perform root chain update based on the latest timestamp root chain, and setting the neighboring terminal node as a branch node; controlling the branch node to send the latest timestamp root chain, a root node topology table of the branch node, and the root chain table to the new terminal node.
7. The automatic networking method according to claim 6, characterized in that, The controlling the root node to perform admission authentication on the root chain synchronization negotiation message of the new terminal node includes: controlling the root node to perform admission authentication on the root chain synchronization negotiation message of the new terminal node by using a white list or feedback information of a management node; wherein the white list includes all trusted terminal nodes; the feedback information of the management node represents admission authentication feedback information made by a management personnel using a management node on the new terminal node; and the management node is any one of the root node, the branch node, and the ordinary terminal node.
8. The automatic networking method according to claim 2, wherein The method further includes: in a case where a direct establishment of a neighboring relationship between a first terminal node and a second terminal node is incorrect, controlling the first terminal node and the second terminal node to perform node mutual trust verification based on a corresponding cyclic key of at least one of the cyclic sequence identifiers in the root chain table of each of the first terminal node and the second terminal node.
9. The automatic networking method according to claim 8, characterized in that, The controlling the first terminal node and the second terminal node to perform node mutual trust verification based on a corresponding cyclic key of at least one of the cyclic sequence identifiers in the root chain table of each of the first terminal node and the second terminal node includes: controlling the first terminal node to construct a first verification request based on a plurality of first random cyclic sequence identifiers in the root chain table, and controlling the first terminal node to send the first verification request to the second terminal node; controlling the second terminal node to determine, in response to the first verification request, a cyclic key corresponding to each of the plurality of first random cyclic sequence identifiers based on a root chain table of the second terminal node; controlling the second terminal node to calculate a first hash value based on a sum of the cyclic key corresponding to each of the first random cyclic sequence identifiers; controlling the second terminal node to send the first hash value to the first terminal node, and to construct a second verification request based on a plurality of second random cyclic sequence identifiers in the root chain table of the second terminal node, and controlling the second terminal node to send the second verification request to the first terminal node; controlling the first terminal node to verify the first hash value based on the cyclic key corresponding to each of the first random cyclic sequence identifiers. In a case where the first hash value is verified, the first terminal node is controlled to determine, in response to the second verification request, a corresponding cycle key of each of the second random cycle sequence identifiers based on the root chain table of the first terminal node; The first terminal node is controlled to calculate a second hash value based on a sum of the corresponding cycle keys of each of the second random cycle sequence identifiers; The first terminal node is controlled to send the second hash value to the second terminal node; The second terminal node is controlled to verify the second hash value based on the corresponding cycle key of each of the second random cycle sequence identifiers; In a case where the second hash value is verified, the first terminal node and the second terminal node are controlled to exchange mutual trust verification success information to suggest an adjacency relationship; The first terminal node and the second terminal node are controlled to exchange a root chain of a latest timestamp.
10. The automatic networking method according to claim 6, characterized by, The method further comprises: In a case where an adjacency relationship is indirectly established between a third terminal node and a fourth terminal node through an intermediate node, the intermediate node and the fourth terminal node are controlled to perform node mutual trust verification based on the corresponding cycle key of at least one of the cycle sequence identifiers in the root chain table; the intermediate node is the root node or the branch node; In a case where the node mutual trust verification between the intermediate node and the fourth terminal node is passed, the intermediate node and the fourth terminal node are controlled to exchange mutual trust verification success information to suggest an adjacency relationship; The intermediate node is controlled to forward a third interaction message of the third terminal node to the fourth terminal node to request a node attribute of the fourth terminal node; The intermediate node and the fourth terminal node are controlled to exchange negotiation messages to enable the fourth terminal node to obtain a root chain of a latest timestamp; The fourth terminal node is controlled to send a response message to the third terminal node in response to the third interaction message; the response message comprises a node attribute of the fourth terminal node.
11. The automatic networking method according to claim 10, characterized by, The control of the intermediate node and the fourth terminal node to perform node mutual trust verification based on the corresponding cycle key of at least one of the cycle sequence identifiers in the root chain table comprises: The intermediate node is controlled to construct a third verification request based on a plurality of third random cycle sequence identifiers in the root chain table, and the intermediate node is controlled to send the third verification request to the fourth terminal node; The fourth terminal node is controlled to determine, in response to the third verification request, a corresponding cycle key of each of the third random cycle sequence identifiers based on the root chain table of the fourth terminal node; The fourth terminal node is controlled to calculate a third hash value based on a sum of the corresponding cycle keys of each of the third random cycle sequence identifiers; The fourth terminal node is controlled to send the third hash value to the intermediate node; The intermediate node is controlled to verify the third hash value based on the corresponding cycle key of each of the third random cycle sequence identifiers; The intermediate node is controlled to verify the third hash value based on the corresponding cycle key of each of the third random cycle sequence identifiers; In a case where the third hash value verification passes, node mutual trust verification between the intermediate node and the fourth terminal node passes.
12. An automatic networking device, characterized by Comprising: A discovery module configured to control a plurality of terminal nodes to discover neighbor nodes in a same network domain through a preset method; An interaction module configured to, in a case where the plurality of terminal nodes all belong to neighbor nodes in the same network domain, control the plurality of terminal nodes to perform data interaction with each other through respective negotiation messages; the negotiation message of each terminal node comprises node attributes of each terminal node; the node attributes at least comprise a root node priority value; A determination module configured to determine a root node among all terminal nodes based on a size comparison result of the root node priority value of all terminal nodes; A networking module configured to control the root node to send a negotiation confirmation message to all normal terminal nodes to complete initial networking; The normal terminal node represents a terminal node in the plurality of terminal nodes excluding the root node.
13. An automatic networking system, characterized by The plurality of terminal nodes are configured to implement the automatic networking method of any one of claims 1 to 11.
14. A machine-readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the automatic networking method of any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the automatic networking method of any one of claims 1 to 11.