Dynamic key generation and code conversion system and method for heterogeneous Internet of Things communication
By introducing dynamic key generation and encoding conversion systems into the Internet of Things communication system, the problem of single encoding conversion mechanism and insufficient security in the prior art is solved, and efficient, secure and reliable data transmission is achieved, which is suitable for large-scale applications of heterogeneous Internet of Things devices.
Patent Information
- Application Number
- CN202510064923.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2045-01-15
AI Technical Summary
In the existing Internet of Things communication systems, the encoding and conversion mechanism is single and the security is insufficient, making it difficult to meet the data conversion requirements between heterogeneous devices. The traditional static key generation mechanism is easy to be cracked, and the anti-interference and error correction capabilities are weak.
A dynamic key generation and encoding conversion system for heterogeneous Internet of Things communication is proposed. Through the combination of data acquisition module, graph construction module, key dynamic generation module, encoding module and planning module, key dynamic generation module, encoding module and planning module, the key is generated dynamically and encoded and converted, and the minimum spanning tree is used to find the optimal path for data transmission.
It significantly improves the confidentiality and anti-interference ability of data transmission, reduces computing overhead and redundant information, improves data compression efficiency and network bandwidth utilization, and enhances the reliability and compatibility of the system.
Smart Images

Figure CN119834960A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of dynamic coding technology, and more specifically, to a dynamic key generation and coding conversion system for heterogeneous Internet of Things communications. Background Art
[0002] With the rapid development of industrial Internet of Things technology, data encoding and conversion technology plays an increasingly important role in the Internet of Things communication system. At present, there are many types of Internet of Things devices, including various sensors, actuators and control devices. The data formats and communication protocols generated by these devices often differ greatly. In order to achieve effective communication between heterogeneous devices, data encoding and conversion processing is required.
[0003] At present, in the communication system of the Internet of Things, there are common problems such as single coding conversion mechanism and insufficient security. Especially in the industrial Internet of Things environment, due to the wide variety of equipment and different data formats, the traditional fixed coding scheme is difficult to meet the data conversion needs between heterogeneous devices. In practical applications, when it is necessary to encode the data of different types of equipment such as temperature sensors and pressure sensors, it is often necessary to develop a separate coding module for each data format, which not only increases the system development and maintenance costs, but also easily causes information loss during data conversion. At the same time, most of the existing coding schemes use a static key generation mechanism with a long key update cycle, which is easy to be cracked by attackers through long-term monitoring and analysis, resulting in sensitive data leakage. In addition, the traditional coding scheme performs poorly in data compression efficiency, often generates a large amount of redundant information, and occupies too much network bandwidth resources. In the complex electromagnetic environment of industrial sites, the existing coding schemes have weak anti-interference and error correction capabilities, which are prone to data transmission errors and affect the reliability of the system. These problems have seriously restricted the large-scale application and promotion of the Internet of Things communication system.
[0004] In view of this, the present invention proposes a dynamic key generation and encoding conversion system and method for heterogeneous Internet of Things communications to solve the above problems. Summary of the invention
[0005] In order to overcome the above-mentioned defects of the prior art and to achieve the above-mentioned purpose, the present invention provides the following technical solutions: A dynamic key generation and encoding conversion system for heterogeneous Internet of Things communications, comprising: a data acquisition module, for collecting monitoring data and topological structures of Internet of Things devices; A graph construction module, which constructs a comprehensive node graph based on the monitoring data and topological structure of IoT devices; the nodes in the comprehensive node graph correspond to IoT devices; A key dynamic generation module is used to dynamically generate a pseudo-random number sequence and distribute the pseudo-random number sequence to each node of the comprehensive node graph to obtain the key corresponding to each node; The encoding module encodes and converts the monitoring data of the corresponding IoT device based on the key obtained by node allocation to obtain the encoded monitoring data; The planning module is used to find the minimum spanning tree in the comprehensive node graph and determine the optimal path between each node based on the minimum spanning tree; the encoded monitoring data is communicated using the determined optimal path, and each module is connected by wired and / or wireless means to realize data transmission between modules.
[0006] Furthermore, the method of constructing the comprehensive node graph includes: Traverse all IoT devices, abstract each IoT device into a node, and add it to the node set V; traverse the communication links between IoT devices. If there is a communication link between two IoT devices, find the corresponding two nodes in the node set V, add an undirected edge between the two nodes, and add them to the edge set E; For each undirected edge , define its weight ; Obtain a preliminary weighted undirected graph G=(V, E); Jointly optimize the preliminary weighted undirected graph to obtain a comprehensive node graph; ;in, Undirected edge The physical distance between the corresponding two nodes, Undirected edge The bandwidth of the corresponding communication link; Undirected edge The delay of the corresponding communication link; Undirected edge The vertical height difference between the two corresponding nodes, For the height-affecting adjustment coefficient, is the channel congestion, is the congestion impact adjustment coefficient; is the link reliability coefficient, is the reliability impact adjustment factor; , and is the weight of the corresponding item; Channel congestion ;in, is the balance weight coefficient, is the current channel flow, is the maximum channel capacity, is the current queue length, is the maximum queue length; ;in, is the number of packets successfully transmitted, is the total number of packets sent, The number of correctly received data bits, is the total number of data bits sent, is the real-time response number, is the total number of requests; , and is the nonlinear adjustment index; is the preset time decay rate, is the current time point, is the reference time point.
[0007] Furthermore, the step of performing joint optimization includes: Step 1: For each node in the preliminary weighted undirected graph Calculate its comprehensive score ; Sort all nodes from high to low according to a comprehensive score to obtain a sorted node sequence; ;in, , and is the scoring weight coefficient, For Node The degree of For Node The betweenness centrality of For Node The set of neighbor nodes of To represent the node The number of edges that actually exist between neighbor nodes, for The sum of the degrees of all nodes in , and To adjust the parameters; Step 2: Take the node v1 with the highest comprehensive score from the sorted node sequence and regard v1 as a central node; Step 3. For v1, find the set N(v1) of all nodes directly connected to it; for each node u in N(v1), calculate the shortest path P(u, v1) from u to v1, and temporarily add all edges in P(u, v1) to the preliminary weighted undirected graph to form a new weighted undirected graph G'. At the same time, for each node pair (u, w) in N(v1), if there is no direct connection between node u and node w, calculate the shortest path P(u, w) from node u to node w, and temporarily add all edges in P(u, w) to the new weighted undirected graph G'; Step 4. Repeat step 3 to take out the node v2 with the second highest comprehensive score, regard v2 as another central node, and repeat step 3 for v2; Step 5: Repeat step 4 until all nodes are treated as central nodes. The new weighted undirected graph finally obtained is the comprehensive node graph.
[0008] Furthermore, the method of generating a pseudo-random number sequence includes: Define a two-dimensional grid space, where each grid represents a cell. Define a cell transfer rule for the cell. The cell transfer rule is as follows: if the states of the left and right neighbor cells of a cell are both 111, then the cell will become 1 at the next moment; if the states of the left and right neighbor cells are 110, 101, or 011, then the cell will become 0 at the next moment; for other combinations of the states of the left and right neighbor cells, the state of the cell remains unchanged; Set the scale of the two-dimensional grid space, define a binary array to store the current state of each cell, set the state of the middle cell in the two-dimensional grid space to 1, and the states of the remaining cells to 0; The left neighbor cell of the first cell is set as the last cell, and the right neighbor cell of the last cell is set as the first cell; and the cell states are updated iteratively. At the end of the iteration, a preliminary random number sequence is obtained. From the preliminary random number sequence, they are grouped by fixed length to obtain several groups of mid-segment bit sequences. Each group of mid-segment bit sequences is interpreted as a 64-bit integer. These 64-bit integers constitute a pseudo-random number sequence.
[0009] Furthermore, the method of iteratively updating the cell state includes: Create an empty list mb and an empty string mp; the empty list is used to store the sequence of cell states in each iteration; the empty string is used to store the concatenated bit sequence; for each iteration, according to the current cell state and cell transfer rules, calculate and update the new state of each cell at the next moment, the new states of all cells constitute a new state sequence, add the new state sequence to the empty list mb, convert the new state sequence into a binary string, that is, a bit sequence, and concatenate the binary string into the empty string mp; The bit sequence obtained in each iteration is divided into several windows of length w, and the The disorder index ; and perform weighted summation on the disordered indices calculated from several windows to obtain a comprehensive random index of the bit sequence obtained in each iteration; ;in, For Window The total length of the bit sequence, For Window The number of times 0 appears in the bit sequence, For Window The number of times 1 appears in the bit sequence, Influence indicators for external sources; External sources influence indicators Ways to obtain include: Define a set of random numbers, called a random set, and record any random number in the random set. Number of occurrences ; Based on this calculation, the external source impact index is obtained ; A random measurement threshold is preset, and the comprehensive random index of the currently generated bit sequence is calculated once every fixed number of times. If the currently calculated comprehensive random index is lower than the random measurement threshold, the iteration continues. If the currently calculated comprehensive random index has reached or exceeded the random measurement threshold, the iteration is stopped. The empty string mp is the preliminary random number sequence.
[0010] Furthermore, the method for searching the minimum spanning tree includes: On the basis of the comprehensive node graph, a flow network is constructed, and two special nodes s and t are created; s represents the source point of the flow network; t represents the sink point of the flow network; traverse each node v in the comprehensive node graph, create a new source edge e1=(s, v), add the new source edge e1 to the set of edges of the flow network, for each newly added new source edge e1, set the capacity of the new source edge e1 to infinity, traverse each node v in the comprehensive node graph, create a new sink edge e2=(v, t), add the new sink edge e2 to the set of edges of the flow network, for each newly added new sink edge e2, set the capacity of the new sink edge e2 to infinity; traverse each undirected edge in the comprehensive node graph , add it to the set of edges in the flow network and set its capacity to the weight The inverse of ; construct a hierarchical network based on the flow network, and use the hierarchical network to find the maximum flow that can be transmitted from the source point s to the sink point t. In the maximum flow, all edges with a flow of 1 form a spanning tree, which is the minimum spanning tree of the comprehensive node graph.
[0011] Furthermore, the method of constructing a hierarchical network based on the flow network and finding the maximum flow that can be transmitted from the source point s to the sink point t by using the hierarchical network includes: Starting from the source point s, perform a breadth-first search to hierarchize all reachable nodes, with the source point s being the 0th level. For each node v, record its level, and only when the current level is 1 greater than the level of the adjacent node, add its edge to the hierarchical network; Starting from the source point s, search for blocked flows in the direction of increasing levels. When it is impossible to move forward, go back to the previous level to continue searching. Each time a blocked flow is found, the total flow is increased according to the flow of the blocked flow. When searching for blocked flows, edges with smaller weights are given priority. For the forward edge through which the blocked flow passes, its residual capacity is reduced; for the reverse edge through which the blocked flow passes, its residual capacity is increased; when the blocked flow cannot be found anymore, the hierarchical network is rebuilt, and based on the updated hierarchical network, the breadth-first search is repeated for layering until a new hierarchical network cannot be built starting from the source point s. At this time, the maximum flow that can be transmitted from the source point s to the sink t is found.
[0012] Furthermore, the method of converting the monitoring data of the corresponding IoT device into code includes: The original monitoring data of the IoT device is used as plaintext data, and the plaintext data is grouped into 64-bit data blocks; based on the key obtained from the node corresponding to the current IoT device, 56-bit valid key bits are selected from the 64-bit key, and the 56-bit valid key bits are divided into two parts, the first 28 bits and the last 28 bits; and 16 rounds of shift iterations are performed on the two parts of the first 28 bits and the last 28 bits; for each round of shift iteration; the first 28 bits and the last 28 bits are shifted left, that is, the first, second, ninth, and sixteenth rounds are shifted left by 1 bit respectively, and the other rounds of shift iterations are shifted left by 2 bits, and the first 28 bits and the last 28 bits after the left shift are re-merged into 56 bits, and according to the preset compression permutation table PC2, 48 bits are selected from the re-merged 56 bits as subkeys, and after 16 rounds of shift iterations, 16 48-bit subkeys are generated; Perform an initial permutation on the 64-bit data block, that is, rearrange the bit order in the data block according to a preset IP permutation table; obtain a sorted data block; use a subkey to permutate and encrypt the sorted data block to obtain encoded monitoring data.
[0013] Furthermore, the method of using the subkey to perform permutation encryption on the sorted data blocks includes: The sorted data block is divided into two 32-bit parts, L0 and R0, on the left and right; L0 and R0 are encrypted for 16 rounds based on 16 48-bit subkeys; for each round of encryption iteration, any subkey K1 of the 16 48-bit subkeys is used to expand R0 to 48-bit data, the expanded 48-bit data is XORed with K1, the result of the XOR operation is divided into 8 6-bit data blocks, and the 8 6-bit data blocks are permuted by 32 bits to obtain a preliminary coding block, which is repeated for 16 rounds, and the preliminary coding blocks are merged into 64 bits, which are recorded as 64-bit preliminary coding blocks; according to the IP permutation table, the bit order of the 64-bit preliminary coding block is rearranged to obtain the encoded ciphertext data block, and all the ciphertext data blocks are spliced to obtain the encoded monitoring data.
[0014] A method for dynamic key generation and encoding conversion for heterogeneous Internet of Things communication, which is implemented based on the dynamic key generation and encoding conversion system for heterogeneous Internet of Things communication, comprises: step 1, collecting monitoring data and topological structure of Internet of Things devices; Step 2: Based on the monitoring data and topological structure of the IoT devices, a comprehensive node graph is constructed; the nodes in the comprehensive node graph correspond to the IoT devices; Step 3: dynamically generate a pseudo-random number sequence, and distribute the pseudo-random number sequence to each node of the comprehensive node graph to obtain the key corresponding to each node; Step 4: Based on the key obtained by node allocation, the monitoring data of the corresponding IoT device is encoded and converted to obtain the encoded monitoring data; Step 5: Find the minimum spanning tree in the comprehensive node graph, and determine the optimal path between each node based on the minimum spanning tree; use the determined optimal path to communicate the encoded monitoring data to achieve dynamic data security transmission.
[0015] The technical effects and advantages of the dynamic key generation and encoding conversion system and method for heterogeneous Internet of Things communications of the present invention are as follows: The present invention significantly improves the flexibility and adaptability of data encoding conversion, and can effectively cope with the encoding requirements of different types of data. The dynamic encoding mechanism adopted by the system greatly improves the confidentiality of data transmission, making data more difficult to be cracked and tampered with during transmission, while reducing the computational overhead of the encoding process; through the optimized encoding strategy, the system not only improves the data compression efficiency, but also significantly reduces the redundant information in the data transmission process, effectively saving network bandwidth resources; the system's adaptive encoding mechanism can automatically adjust the encoding parameters according to changes in the communication environment, while ensuring data integrity and achieving the optimization of transmission efficiency; in addition, the system also has a strong error correction capability, which can ensure accurate data transmission even in the case of poor channel quality, significantly improving the reliability of the communication system. At the same time, the system's encoding scheme has good compatibility and can be easily adapted to different communication protocols and data formats, providing strong support for the large-scale application of the Internet of Things. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of a dynamic key generation and encoding conversion system for heterogeneous Internet of Things communications of the present invention; Figure 2 It is a schematic diagram of the dynamic key generation and encoding conversion method for heterogeneous Internet of Things communications of the present invention. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] Example 1 See also Figure 1 As shown, the dynamic key generation and encoding conversion system for heterogeneous Internet of Things communication described in this embodiment includes: Data collection module, used to collect monitoring data and topology structure of IoT devices; A graph construction module, which constructs a comprehensive node graph based on the monitoring data and topological structure of IoT devices; the nodes in the comprehensive node graph correspond to IoT devices; A key dynamic generation module is used to dynamically generate a pseudo-random number sequence and distribute the pseudo-random number sequence to each node of the comprehensive node graph to obtain the key corresponding to each node; The encoding module encodes and converts the monitoring data of the corresponding IoT device based on the key obtained by node allocation to obtain the encoded monitoring data; The planning module is used to find the minimum spanning tree in the comprehensive node graph and determine the optimal path between each node based on the minimum spanning tree; the encoded monitoring data is communicated using the determined optimal path, and each module is connected by wired and / or wireless means to realize data transmission between modules.
[0019] Arrange various sensors, meters and other monitoring equipment on site to collect equipment operation data, including temperature, pressure, flow and power; this is monitoring data; obtain equipment layout and connection status through on-site survey or review of design documents, and draw a topological structure; the topological structure describes the location relationship and connection method of each IoT device.
[0020] The monitoring equipment transmits the collected data to the data acquisition terminal or field control station via wired or wireless means to form the original monitoring data.
[0021] Ways to build a comprehensive node graph include: Traverse all IoT devices, abstract each IoT device as a node, and add it to the node set V; traverse the communication links between IoT devices. If there is a communication link between two IoT devices, find the corresponding two nodes in the node set V, add an undirected edge between the two nodes, and add them to the edge set E; for each undirected edge , define its weight ; Obtain a preliminary weighted undirected graph G=(V, E); Jointly optimize the preliminary weighted undirected graph to obtain a comprehensive node graph; ;in, Undirected edge The physical distance between the corresponding two nodes, Undirected edge The bandwidth of the corresponding communication link; Undirected edge The delay of the corresponding communication link; Undirected edge The vertical height difference between the two corresponding nodes, To adjust the coefficient of height influence, the layout of industrial field equipment at different floors or heights is taken into account. is the channel congestion, ranging from [0, 1], It is the congestion impact adjustment coefficient, which reflects the real-time load status of the communication link; is the link reliability coefficient, For the reliability impact adjustment coefficient, the influence of fluctuations in communication quality in industrial environments is considered; , and are the weights of the distance, bandwidth, and delay factors.
[0022] Channel congestion ;in, is the balance weight coefficient, is the current channel flow, is the maximum channel capacity, is the current queue length, is the maximum queue length; ;in, is the number of successfully transmitted packets (the number of packets that successfully reach the destination within a statistical period), is the total number of packets sent (the number of all packets sent in the same cycle), The number of correctly received data bits (the receiving end verifies the correct number of data bits), is the total number of data bits sent, is the number of real-time responses (the number of responses completed within the specified time threshold), is the total number of requests; , and It is a nonlinear adjustment index, which is used to adjust the sensitivity of each indicator; is the preset time decay rate, is the current time point, is the reference time point (the time point of a network reset); the above parameters are obtained through the SNMP protocol of the switch and router, and are counted in real time during the data transmission process, and the statistical results are updated regularly.
[0023] The steps for joint optimization include: Step 1: For each node in the preliminary weighted undirected graph Calculate its comprehensive score ; Sort all nodes from high to low according to a comprehensive score to obtain a sorted node sequence; ;in, , and is the scoring weight coefficient, For Node The degree of the node The number of directly connected nodes), For Node The betweenness centrality of For Node The set of neighbor nodes of To represent the node The number of edges that actually exist between neighbor nodes, for The sum of the degrees of all nodes in , and It is an adjustment parameter used to control the behavior of the formula; it not only considers the direct connectivity between node neighbors, but also incorporates the connectivity between neighbor nodes and the entire network, thereby more comprehensively describing the closeness of the node and its neighbors.
[0024] Step 2: Take the node v1 with the highest comprehensive score from the sorted node sequence and regard v1 as a central node; Step 3. For v1, find the set N(v1) of all nodes directly connected to it; for each node u in N(v1), calculate the shortest path P(u, v1) from u to v1, and temporarily add all edges in P(u, v1) to the preliminary weighted undirected graph to form a new weighted undirected graph G'. At the same time, for each node pair (u, w) in N(v1), if there is no direct connection between node u and node w, calculate the shortest path P(u, w) from node u to node w, and temporarily add all edges in P(u, w) to the new weighted undirected graph G'.
[0025] Step 4. Repeat step 3 to take out the node v2 with the second highest comprehensive score, regard v2 as another central node, and repeat step 3 for v2; specifically, construct a weight matrix, each element in the matrix represents the weight of the directed edge between the two nodes, and then run the shortest path algorithm (such as Dijkstra algorithm or Floyd algorithm, etc.) to find the set of directed edges of the shortest path from node u to node w, which is P(u, w); Step 5: Repeat step 4 until all nodes are treated as central nodes. The final new weighted undirected graph is the comprehensive node graph. In the comprehensive node graph, there are multiple different paths connecting any two nodes, thereby improving the fault tolerance and reliability of the communication path.
[0026] Ways to generate pseudo-random number sequences include: A two-dimensional grid space is defined, where each grid represents a cell. For cells, cell transfer rules are defined. The cell transfer rules consist of 8 binary digits, and each digit corresponds to a combination of neighbor states. That is, if the states of the left and right neighbor cells of a cell are both 111, then the cell will become 1 at the next moment; if the states of the left and right neighbor cells are 110, 101, or 011, then the cell will become 0 at the next moment; for other combinations of the states of the left and right neighbor cells, the state of the cell remains unchanged.
[0027] Set the scale of the two-dimensional grid space (e.g., 1000 cells), define a binary array to store the current state of each cell, set the state of the middle cell in the two-dimensional grid space (e.g., the 500th cell) to 1, and the states of the remaining cells to 0; The left neighbor cell of the first cell is set as the last cell, and the right neighbor cell of the last cell is set as the first cell; and the cell states are updated iteratively, and a preliminary random number sequence is obtained at the end of the iteration.
[0028] Create an empty list mb and an empty string mp; the empty list is used to store the sequence of cell states in each iteration; the empty string is used to store the concatenated bit sequence; for each iteration, according to the current cell state and cell transfer rules, calculate and update the new state of each cell at the next moment, the new states of all cells constitute a new state sequence, add the new state sequence to the empty list mb, convert the new state sequence into a binary string, that is, a bit sequence, and concatenate the binary string into the empty string mp.
[0029] The bit sequence obtained in each iteration is divided into several windows of length w, and the The disorder index ; and perform weighted summation on the disordered indices calculated from several windows to obtain a comprehensive random index of the bit sequence obtained in each iteration; ;in, For Window The total length of the bit sequence, For Window The number of times 0 appears in the bit sequence, For Window The number of times 1 appears in the bit sequence, Indicators that are affected by external sources.
[0030] External sources influence indicators Ways to obtain include: Define a set of random numbers (including repeated random numbers), record it as a random set, and record any random number in the random set Number of occurrences Based on this calculation, the external source impact index is obtained ; A randomness measurement threshold is preset. Specifically, through a series of randomness tests such as those provided by NIST SP 800-22, according to the requirements in the test standard, a threshold that can pass most randomness tests is set; every fixed number of times (such as every 1000 iterations), the comprehensive randomness index of the currently generated bit sequence is calculated. If the currently calculated comprehensive randomness index is lower than the randomness measurement threshold, it means that the randomness of the generated bit sequence is not enough, and the iteration is continued to generate a longer bit sequence. If the currently calculated comprehensive randomness index has reached or exceeded the randomness measurement threshold, the iteration is stopped. At this time, the generated bit sequence is considered to have sufficient randomness and unpredictability, and the final empty string mp is the preliminary random number sequence.
[0031] The preliminary random number sequence is grouped into fixed lengths (eg, 64 bits) to obtain several groups of mid-segment bit sequences. Each group of mid-segment bit sequences is interpreted as a 64-bit integer. These 64-bit integers constitute a pseudo-random number sequence.
[0032] The obtained pseudo-random number sequence is divided into segments of equal length, and each node in the comprehensive node graph is traversed. During the traversal process, the segment is assigned to the node as the key of the currently traversed node. If the key length is not enough, the pseudo-random sequence is reused.
[0033] The methods for finding the minimum spanning tree include: On the basis of the comprehensive node graph, a flow network is constructed, and two special nodes s and t are created; s represents the source point of the flow network; t represents the sink point of the flow network; traverse each node v in the comprehensive node graph, create a new source edge e1=(s, v), add the new source edge e1 to the set of edges of the flow network, for each newly added new source edge e1, set the capacity of the new source edge e1 to infinity, traverse each node v in the comprehensive node graph, create a new sink edge e2=(v, t), add the new sink edge e2 to the set of edges of the flow network, for each newly added new sink edge e2, set the capacity of the new sink edge e2 to infinity; traverse each undirected edge in the comprehensive node graph , add it to the set of edges in the flow network and set its capacity to the weight The reciprocal of; the new sink edge, new source edge and original undirected edge in the flow network are all edges of the flow network.
[0034] A hierarchical network is constructed based on the flow network, and the hierarchical network is used to find the maximum flow that can be transmitted from the source point s to the sink t. Specifically, starting from the source point s, a breadth-first search (BFS) is performed to layer all reachable nodes, with the source point s as the 0th layer. For each node v, its layer is recorded, and only when the current layer is 1 greater than the layer of the adjacent node, its edge is added to the hierarchical network.
[0035] Starting from the source point s, search for blocking flows (a path from the source point to the sink point, which can increase the flow of the entire network) in the direction of increasing levels. More specifically, a blocking flow refers to a path in the current level network that can no longer increase the flow. When it is impossible to move forward, go back to the previous level to continue searching. Each time a blocking flow is found, the total flow is increased according to the flow of the blocking flow (a flow from the source point to the sink point in the network, initially 0). When looking for a blocking flow, edges with smaller weights are given priority.
[0036] For the forward edge (the edge with the same direction as the flow) through which the blocked flow passes, reduce its residual capacity; that is, the flow on the corresponding edge can still be increased; for the reverse edge (the edge in the opposite direction of the flow) through which the blocked flow passes, increase its residual capacity; the extent of reduction and increase depends on the specific situation. It should be noted that when sending flow along a forward edge, reduce the residual capacity of this edge; at the same time, increase the residual capacity of the corresponding reverse edge to make it equal to the flow just sent; in this way, if it is found in subsequent iterations that this decision needs to be revoked, the flow can be sent along the reverse edge.
[0037] When no more blocking flows can be found, the hierarchical network is rebuilt. Based on the updated hierarchical network, the breadth-first search is repeated for stratification until a new hierarchical network cannot be built from the source point s. At this time, the maximum flow that can be transmitted from the source point s to the sink t is found; in the maximum flow, all edges with a flow of 1 form a spanning tree. All edges with a flow of 1 in the maximum flow have the following characteristics: They connect all nodes, they correspond to the edges with the smallest weight in the original graph, and they form a connected subgraph without cycles; this spanning tree is the minimum spanning tree of the comprehensive node graph; for any two nodes, find the path connecting them in the minimum spanning tree, and this path is the optimal path between the two nodes.
[0038] The methods for encoding and converting the monitoring data of the corresponding IoT device include: The original monitoring data of the IoT device is used as plaintext data, and the plaintext data is grouped into 64-bit (8-byte) data blocks; based on the key obtained from the node corresponding to the current IoT device, 56-bit valid key bits are selected from the 64-bit key, and the 56-bit valid key bits are divided into two parts, the first 28 bits and the last 28 bits; and 16 rounds of shift iterations are performed on the two parts of the first 28 bits and the last 28 bits; for each round of shift iteration; the two parts of the first 28 bits and the last 28 bits are shifted left, that is, the 1st, 2nd, 9th, and 16th rounds are shifted left by 1 bit respectively, and the other rounds of shift iterations are shifted left by 2 bits, and the first 28 bits and the last 28 bits after the left shift are re-merged into 56 bits, and according to the preset compression permutation table PC2 (a total of 48 elements, ranging from 1 to 56), 48 bits are selected from the re-merged 56 bits as subkeys, and after 16 rounds of shift iterations, 16 48-bit subkeys are generated.
[0039] Perform an initial permutation on the 64-bit data block, that is, rearrange the bit order in the data block according to the preset IP permutation table (a total of 64 elements, ranging from 1 to 64, indicating how to rearrange the order of bits in the 64-bit plaintext data block); obtain the sorted data block; use the subkey to permutate and encrypt the sorted data block, specifically, divide the sorted data block into two 32-bit parts, L0 and R0; perform 16 rounds of encryption iterations on L0 and R0 based on 16 48-bit subkeys; for each round of encryption iteration, use 16 48-bit subkeys Any subkey K1 in the subkey expands R0 to 48-bit data, and performs XOR operation on the expanded 48-bit data and K1, and divides the result of the XOR operation into 8 6-bit data blocks, and performs 32-bit permutation on the 8 6-bit data blocks to obtain preliminary coding blocks, repeat 16 rounds, and merge the preliminary coding blocks into 64 bits, recorded as 64-bit preliminary coding blocks; according to the IP permutation table, rearrange the bit sequence of the 64-bit preliminary coding blocks to obtain the encoded ciphertext data blocks, and splice all the ciphertext data blocks, that is, the encoded monitoring data.
[0040] Based on the minimum spanning tree, a routing table is built for each node, which records the optimal next-hop node from the node to other nodes; for example, for node A, if data is to be sent to node D, the next hop is node B; at each node, the encrypted monitoring data is grouped into data packets; appropriate header information is added to each data packet, such as destination node ID, sequence number, etc.
[0041] For each data packet to be sent, the next hop is searched in the routing table according to the destination node, and the data packet is sent to the corresponding next hop node. After the intermediate node receives the data packet, it checks the destination node ID. If it is not the destination node, it continues to forward it to the next hop node according to the routing table. It comprehensively considers multiple aspects such as path optimization and encrypted transmission, providing efficient, secure and reliable data transmission guarantee for the Internet of Things monitoring system.
[0042] This embodiment significantly improves the flexibility and adaptability of data encoding conversion, and can effectively respond to the encoding requirements of different types of data. The dynamic encoding mechanism adopted by the system greatly improves the confidentiality of data transmission, making data more difficult to crack and tamper with during transmission, while reducing the computational overhead of the encoding process; through the optimized encoding strategy, the system not only improves the data compression efficiency, but also significantly reduces the redundant information in the data transmission process, effectively saving network bandwidth resources; the system's adaptive encoding mechanism can automatically adjust the encoding parameters according to changes in the communication environment, while ensuring data integrity and optimizing transmission efficiency; in addition, the system also has a strong error correction capability, which can ensure accurate data transmission even in the case of poor channel quality, significantly improving the reliability of the communication system. At the same time, the system's encoding scheme has good compatibility and can easily adapt to different communication protocols and data formats, providing strong support for the large-scale application of the Internet of Things.
[0043] Example 2 See also Figure 2 As shown, the part not described in detail in this embodiment is described in Example 1, which provides a dynamic key generation and encoding conversion method for heterogeneous Internet of Things communication, including: Step 1: Collect monitoring data and topology of IoT devices; Step 2: Based on the monitoring data and topological structure of the IoT devices, a comprehensive node graph is constructed; the nodes in the comprehensive node graph correspond to the IoT devices; Step 3: dynamically generate a pseudo-random number sequence, and distribute the pseudo-random number sequence to each node of the comprehensive node graph to obtain the key corresponding to each node; Step 4: Based on the key obtained by node allocation, the monitoring data of the corresponding IoT device is encoded and converted to obtain the encoded monitoring data; Step 5: Find the minimum spanning tree in the comprehensive node graph, and determine the optimal path between each node based on the minimum spanning tree; use the determined optimal path to communicate the encoded monitoring data to achieve dynamic data security transmission.
[0044] Example 3 This embodiment discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the operation mode of the dynamic key generation and encoding conversion method for heterogeneous Internet of Things communication provided above is implemented.
[0045] Since the electronic device introduced in this embodiment is an electronic device used to implement the dynamic key generation and code conversion method for heterogeneous Internet of Things communication in the embodiment of this application, based on the dynamic key generation and code conversion method for heterogeneous Internet of Things communication introduced in the embodiment of this application, the technical personnel of this field can understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of this application is not described in detail here. As long as the technical personnel of this field implement the electronic device used by the dynamic key generation and code conversion method for heterogeneous Internet of Things communication in the embodiment of this application, it belongs to the scope of protection of this application.
[0046] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.
[0047] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technical users in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A dynamic key generation and encoding conversion system for heterogeneous Internet of Things communications, characterized in that: include: Data collection module, used to collect monitoring data and topology structure of IoT devices; A graph construction module, which constructs a comprehensive node graph based on the monitoring data and topological structure of IoT devices; the nodes in the comprehensive node graph correspond to IoT devices; A key dynamic generation module is used to dynamically generate a pseudo-random number sequence and distribute the pseudo-random number sequence to each node of the comprehensive node graph to obtain the key corresponding to each node; The encoding module encodes and converts the monitoring data of the corresponding IoT device based on the key obtained by node allocation to obtain the encoded monitoring data; The planning module is used to find the minimum spanning tree in the comprehensive node graph and determine the optimal path between each node based on the minimum spanning tree; the encoded monitoring data is communicated using the determined optimal path, and each module is connected by wired and / or wireless means to realize data transmission between modules.
2. The dynamic key generation and encoding conversion system for heterogeneous Internet of Things communications according to claim 1 is characterized in that: The method of constructing the comprehensive node graph includes: Traverse all IoT devices, abstract each IoT device into a node, and add it to the node set V; traverse the communication links between IoT devices. If there is a communication link between two IoT devices, find the corresponding two nodes in the node set V, add an undirected edge between the two nodes, and add them to the edge set E; For each undirected edge , define its weight ; Obtain a preliminary weighted undirected graph G=(V, E); Jointly optimize the preliminary weighted undirected graph to obtain a comprehensive node graph; ;in, Undirected edge The physical distance between the corresponding two nodes, Undirected edge The bandwidth of the corresponding communication link; Undirected edge The delay of the corresponding communication link; Undirected edge The vertical height difference between the two corresponding nodes, For the height-affecting adjustment coefficient, is the channel congestion, is the congestion impact adjustment coefficient; is the link reliability coefficient, is the reliability impact adjustment factor; , and is the weight of the corresponding item; Channel congestion ;in, is the balance weight coefficient, is the current channel flow, is the maximum channel capacity, is the current queue length, is the maximum queue length; ;in, is the number of packets successfully transmitted, is the total number of packets sent, The number of correctly received data bits, is the total number of data bits sent, is the number of real-time responses, is the total number of requests; , and is the nonlinear adjustment index; is the preset time decay rate, is the current time point, is the reference time point.
3. The dynamic key generation and encoding conversion system for heterogeneous Internet of Things communications according to claim 2 is characterized in that: The steps of performing joint optimization include: Step 1: For each node in the initial weighted undirected graph Calculate its comprehensive score ; Sort all nodes from high to low according to a comprehensive score to obtain a sorted node sequence; ;in, , and is the scoring weight coefficient, For Node The degree of For Node The betweenness centrality of For Node The set of neighbor nodes of To represent the node The number of edges that actually exist between neighbor nodes, for The sum of the degrees of all nodes in , and To adjust the parameters; Step 2: Take the node v1 with the highest comprehensive score from the sorted node sequence and regard v1 as a central node; Step 3. For v1, find the set N(v1) of all nodes directly connected to it; for each node u in N(v1), calculate the shortest path P(u, v1) from u to v1, and temporarily add all edges in P(u, v1) to the preliminary weighted undirected graph to form a new weighted undirected graph G'. At the same time, for each node pair (u, w) in N(v1), if there is no direct connection between node u and node w, calculate the shortest path P(u, w) from node u to node w, and temporarily add all edges in P(u, w) to the new weighted undirected graph G'; Step 4. Repeat step 3 to take out the node v2 with the second highest comprehensive score, regard v2 as another central node, and repeat step 3 for v2; Step 5: Repeat step 4 until all nodes are treated as central nodes. The new weighted undirected graph finally obtained is the comprehensive node graph.
4. The dynamic key generation and encoding conversion system for heterogeneous Internet of Things communications according to claim 3 is characterized in that: The method of generating a pseudo-random number sequence includes: Define a two-dimensional grid space, where each grid represents a cell. Define a cell transfer rule for the cell: if the states of the left and right neighbor cells of a cell are both 111, then the cell will become 1 at the next moment; if the states of the left and right neighbor cells are 110, 101, or 011, then the cell will become 0 at the next moment; for other combinations of the states of the left and right neighbor cells, the state of the cell remains unchanged; Set the scale of the two-dimensional grid space, define a binary array to store the current state of each cell, set the state of the middle cell in the two-dimensional grid space to 1, and the states of the remaining cells to 0; The left neighbor cell of the first cell is set as the last cell, and the right neighbor cell of the last cell is set as the first cell; and the cell states are updated iteratively. At the end of the iteration, a preliminary random number sequence is obtained. From the preliminary random number sequence, they are grouped by fixed length to obtain several groups of mid-segment bit sequences. Each group of mid-segment bit sequences is interpreted as a 64-bit integer. These 64-bit integers constitute a pseudo-random number sequence.
5. The dynamic key generation and encoding conversion system for heterogeneous Internet of Things communications according to claim 4 is characterized in that: The method of iteratively updating the state of the cell includes: Create an empty list mb and an empty string mp; the empty list is used to store the sequence of cell states in each iteration; the empty string is used to store the concatenated bit sequence; for each iteration, according to the current cell state and cell transfer rules, calculate and update the new state of each cell at the next moment, the new states of all cells constitute a new state sequence, add the new state sequence to the empty list mb, convert the new state sequence into a binary string, that is, a bit sequence, and concatenate the binary string into the empty string mp; The bit sequence obtained in each iteration is divided into several windows of length w, and the The disorder index ; and perform weighted summation on the disordered indices calculated from several windows to obtain a comprehensive random index of the bit sequence obtained in each iteration; ;in, For Window The total length of the bit sequence, For Window The number of times 0 appears in the bit sequence, For Window The number of times 1 appears in the bit sequence, Influence indicators for external sources; External sources influence indicators Ways to obtain include: Define a set of random numbers, called a random set, and record any random number in the random set. Number of occurrences ; Based on this calculation, the external source impact index is obtained ; A random measurement threshold is preset, and the comprehensive random index of the currently generated bit sequence is calculated once every fixed number of times. If the currently calculated comprehensive random index is lower than the random measurement threshold, the iteration continues. If the currently calculated comprehensive random index has reached or exceeded the random measurement threshold, the iteration is stopped. The empty string mp is the preliminary random number sequence.
6. The dynamic key generation and encoding conversion system for heterogeneous Internet of Things communications according to claim 5 is characterized in that: The method for finding the minimum spanning tree includes: On the basis of the comprehensive node graph, a flow network is constructed, and two special nodes s and t are created; s represents the source point of the flow network; t represents the sink point of the flow network; traverse each node v in the comprehensive node graph, create a new source edge e1=(s, v), add the new source edge e1 to the set of edges of the flow network, for each newly added new source edge e1, set the capacity of the new source edge e1 to infinity, traverse each node v in the comprehensive node graph, create a new sink edge e2=(v, t), add the new sink edge e2 to the set of edges of the flow network, for each newly added new sink edge e2, set the capacity of the new sink edge e2 to infinity; traverse each undirected edge in the comprehensive node graph , add it to the set of edges in the flow network and set its capacity to the weight The inverse of ; construct a hierarchical network based on the flow network, and use the hierarchical network to find the maximum flow that can be transmitted from the source point s to the sink point t. In the maximum flow, all edges with a flow of 1 form a spanning tree, which is the minimum spanning tree of the comprehensive node graph.
7. The dynamic key generation and encoding conversion system for heterogeneous Internet of Things communications according to claim 6 is characterized in that: The method of constructing a hierarchical network based on a flow network and using the hierarchical network to find the maximum flow that can be transmitted from a source point s to a sink point t includes: Starting from the source point s, perform a breadth-first search to hierarchize all reachable nodes, with the source point s being the 0th level. For each node v, record its level, and only when the current level is 1 greater than the level of the adjacent node, add its edge to the hierarchical network; Starting from the source point s, search for blocked flows in the direction of increasing levels. When it is impossible to move forward, go back to the previous level to continue searching. Each time a blocked flow is found, the total flow is increased according to the flow of the blocked flow. When searching for blocked flows, edges with smaller weights are given priority. For the forward edge through which the blocked flow passes, its residual capacity is reduced; for the reverse edge through which the blocked flow passes, its residual capacity is increased; when the blocked flow cannot be found anymore, the hierarchical network is rebuilt, and based on the updated hierarchical network, the breadth-first search is repeated for layering until a new hierarchical network cannot be built starting from the source point s. At this time, the maximum flow that can be transmitted from the source point s to the sink t is found.
8. The dynamic key generation and encoding conversion system for heterogeneous Internet of Things communications according to claim 7 is characterized in that: The method of encoding and converting the monitoring data of the corresponding IoT device includes: The original monitoring data of the IoT device is used as plaintext data, and the plaintext data is grouped into 64-bit data blocks; based on the key obtained from the node corresponding to the current IoT device, 56-bit valid key bits are selected from the 64-bit key, and the 56-bit valid key bits are divided into two parts, the first 28 bits and the last 28 bits; and 16 rounds of shift iterations are performed on the two parts of the first 28 bits and the last 28 bits; for each round of shift iteration; the first 28 bits and the last 28 bits are shifted left, that is, the first, second, ninth, and sixteenth rounds are shifted left by 1 bit respectively, and the other rounds of shift iterations are shifted left by 2 bits, and the first 28 bits and the last 28 bits after the left shift are re-merged into 56 bits, and according to the preset compression permutation table PC2, 48 bits are selected from the re-merged 56 bits as subkeys, and after 16 rounds of shift iterations, 16 48-bit subkeys are generated; Perform an initial permutation on the 64-bit data block, that is, rearrange the bit order in the data block according to a preset IP permutation table; obtain a sorted data block; use a subkey to permutate and encrypt the sorted data block to obtain encoded monitoring data.
9. The dynamic key generation and encoding conversion system for heterogeneous Internet of Things communications according to claim 8 is characterized in that: The method of using the subkey to perform permutation encryption on the sorted data blocks includes: The sorted data block is divided into two 32-bit parts, L0 and R0, on the left and right; L0 and R0 are encrypted for 16 rounds based on 16 48-bit subkeys; for each round of encryption iteration, any subkey K1 of the 16 48-bit subkeys is used to expand R0 to 48-bit data, the expanded 48-bit data is XORed with K1, the result of the XOR operation is divided into 8 6-bit data blocks, and the 8 6-bit data blocks are permuted by 32 bits to obtain a preliminary coding block, which is repeated for 16 rounds, and the preliminary coding blocks are merged into 64 bits, which are recorded as 64-bit preliminary coding blocks; according to the IP permutation table, the bit order of the 64-bit preliminary coding block is rearranged to obtain the encoded ciphertext data block, and all the ciphertext data blocks are spliced to obtain the encoded monitoring data.
10. A method for dynamic key generation and encoding conversion for heterogeneous Internet of Things communication, which is implemented based on the dynamic key generation and encoding conversion system for heterogeneous Internet of Things communication according to any one of claims 1 to 9, characterized in that: include: Step 1: Collect monitoring data and topology of IoT devices; Step 2: Based on the monitoring data and topological structure of the IoT devices, a comprehensive node graph is constructed; the nodes in the comprehensive node graph correspond to the IoT devices; Step 3: dynamically generate a pseudo-random number sequence, and distribute the pseudo-random number sequence to each node of the comprehensive node graph to obtain the key corresponding to each node; Step 4: Based on the key obtained by node allocation, the monitoring data of the corresponding IoT device is encoded and converted to obtain the encoded monitoring data; Step 5: Find the minimum spanning tree in the comprehensive node graph, and determine the optimal path between each node based on the minimum spanning tree; use the determined optimal path to communicate the encoded monitoring data to achieve dynamic data security transmission.
Citation Information
Patent Citations
Software-defined Internet of Things network topology data transmission security management method and system
CN112565230A
Federal learning security aggregation method suitable for edge computing scene
CN116094993A
Physical layer key generation
WO2021091615A1
Cited By
Intelligent control method and system for fly ash melting treatment production line
CN120122604A