Dynamic Key Generation and Coding Conversion System and Method for Heterogeneous Internet of Things Communication
By constructing a comprehensive node graph and dynamically generating pseudo-random number sequence and dynamically determining the path based on the minimum spanning tree, the problem of single encoding and conversion mechanism and insufficient security in the Internet of Things communication system is solved, and efficient and reliable data transmission is achieved.
Patent Information
- Application Number
- CN202510064923.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-01-15
AI Technical Summary
The encoding and conversion mechanism in the existing Internet of Things communication systems is single and has insufficient security, making it difficult to adapt to the data conversion needs between heterogeneous devices, and has weak anti-interference capabilities, which affects system reliability and data transmission efficiency.
A dynamic key generation and encoding conversion system for heterogeneous Internet of Things communication is adopted. Through data acquisition, graph construction, dynamic key generation, encoding modules and planning modules, a comprehensive node graph is constructed, a pseudo-random number sequence is dynamically generated, and the optimal path is determined based on the minimum spanning tree for data transmission, realizing dynamic encoding and secure transmission.
It improves the flexibility and confidentiality of data transmission, reduces computing overhead, reduces redundant information, enhances error correction capabilities, improves the reliability and compatibility of the system, and adapts to different communication protocols and data formats.
Smart Images

Figure CN119834960B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dynamic coding, and more specifically, to a dynamic key generation and coding conversion system for heterogeneous Internet of Things (IoT) communication. Background Art
[0002] With the rapid development of industrial IoT technology, data coding and conversion technology plays an increasingly important role in IoT communication systems; currently, there is a wide variety of IoT devices, including various sensors, actuators, and control devices, etc., and the data formats and communication protocols generated by these devices often vary greatly; in order to achieve effective communication between heterogeneous devices, data coding and conversion processing is required.
[0003] Currently, in IoT communication systems, there are generally problems such as a single coding conversion mechanism and insufficient security; especially in the industrial IoT environment, due to the wide variety of device types and different data formats, traditional fixed coding schemes are difficult to meet the data conversion requirements between heterogeneous devices; in practical applications, when coding the data of different types of devices such as temperature sensors and pressure sensors, it is often necessary to develop coding modules separately for each data format, which not only increases the system development and maintenance costs, but also easily causes information loss during the data conversion process; at the same time, most of the existing coding schemes adopt a static key generation mechanism, with a long key update period, and are easily cracked by attackers through long-term monitoring and analysis, resulting in the leakage of sensitive data; in addition, traditional coding schemes perform poorly in terms of data compression efficiency, often generating a large amount of redundant information and occupying too much network bandwidth resources; in the complex electromagnetic environment of industrial sites, the anti-interference ability and error correction ability of existing coding schemes are weak, and data transmission errors are likely to occur, affecting the reliability of the system. These problems seriously restrict the large-scale application and promotion of IoT communication systems.
[0004] In view of this, the present invention proposes a dynamic key generation and coding conversion system and method for heterogeneous IoT communication to solve the above problems. Summary of the Invention
[0005] To overcome the above-mentioned defects of the prior art and to achieve the above object, the present invention provides the following technical solution: A dynamic key generation and coding conversion system for heterogeneous IoT communication, including: a data acquisition module for collecting monitoring data and topological structure of IoT devices;
[0006] A graph construction module for constructing 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;
[0007] A key dynamic generation module for dynamically generating a pseudo-random number sequence and allocating the pseudo-random number sequence to each node of the comprehensive node graph to obtain the keys corresponding to each node;
[0008] An encoding module that encodes and converts the monitoring data of the corresponding Internet of Things device based on the key obtained by node allocation to obtain the encoded monitoring data;
[0009] A planning module that is used to find a minimum spanning tree in the comprehensive node graph and determine the optimal path between each node based on the minimum spanning tree; communicate the encoded monitoring data using the determined optimal path, and each module is connected by wired and / or wireless means to achieve data transmission between modules.
[0010] Further, the method for constructing the comprehensive node graph includes:
[0011] Traverse all Internet of Things devices, abstract each Internet of Things device as a node, and add it to the node set V; traverse the communication links between Internet of Things devices. If there is a communication link between two Internet of Things devices, find the corresponding two nodes in the node set V, add an undirected edge between these two nodes, and add it to the edge set E;
[0012] For each undirected edge , define its weight ; obtain the preliminary weighted undirected graph G=(V, E); perform joint optimization on the preliminary weighted undirected graph to obtain the comprehensive node graph;
[0013] ; where is the physical distance between the two nodes corresponding to the undirected edge , is the bandwidth of the communication link corresponding to the undirected edge ; is the delay of the communication link corresponding to the undirected edge ; is the vertical height difference between the two nodes corresponding to the undirected edge , is the height influence adjustment coefficient, is the channel congestion degree, is the congestion influence adjustment coefficient; is the link reliability coefficient, is the reliability influence adjustment coefficient; , and are the weights of the corresponding items;
[0014] Channel congestion degree ; where is the balance weight coefficient, is the current channel traffic, is the channel maximum capacity, is the current queue length, is the maximum queue length;
[0015] ; where, is the number of successfully transmitted data packets, is the total number of transmitted data packets, is the number of correctly received data bits, is the total number of transmitted data bits, is the number of real-time response times, is the total number of requests; and and are non-linear adjustment exponents; is the preset time decay rate, is the current time point, is the reference time point.
[0016] Further, the steps of performing joint optimization include:
[0017] Step 1. For the preliminary weighted undirected graph, for each node calculate its comprehensive score ; sort all nodes in descending order according to a comprehensive score to obtain a sorted node sequence;
[0018] ; where, and and are scoring weight coefficients, is the degree of node , is the betweenness centrality of node , is the set composed of the neighbor nodes of node , is the number of actually existing edges between the neighbor nodes representing node , is the sum of the degrees of all nodes in, and are adjustment parameters;
[0019] Step 2. Take out the node v1 with the highest comprehensive score from the sorted node sequence and regard v1 as a central node;
[0020] 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 the 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 pair of nodes (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 the 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;
[0021] Step 5: Repeat Step 4 until all nodes have been processed as central nodes and then stop. The finally obtained new weighted undirected graph is the comprehensive node graph.
[0022] Furthermore, the method for generating the pseudo-random number sequence includes:
[0023] Define a two-dimensional grid space, where each grid in the two-dimensional grid space represents a cell. Define cell transition rules for the cells. The cell transition rules are 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;
[0024] 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 set the states of the remaining cells to 0;
[0025] And set the left neighbor cell of the first cell to the last cell, and set the right neighbor cell of the last cell to the first cell; and iteratively update the states of the cells. After the iteration ends, obtain a preliminary random number sequence. From the preliminary random number sequence, group it with a fixed length to obtain several groups of middle-bit sequences. Interpret each group of middle-bit sequences as a 64-bit integer, and these 64-bit integers constitute the pseudo-random number sequence.
[0026] Furthermore, the method for iteratively updating the states of the cells includes:
[0027] Create an empty list mb and an empty string mp; the empty list is used to store the sequence of the states of the cells in each iteration; the empty string is used to store the concatenated bit sequence; for each iteration, calculate and update the new state of each cell at the next moment according to the current state of the cell and the cell transition rule, the new states of all cells form a new state sequence, add the new state sequence to the empty list mb, convert the new state sequence into a binary string, i.e., a bit sequence, and concatenate the binary string to the empty string mp;
[0028] Divide the bit sequence obtained in each iteration into several windows of length w, and calculate each window 's disorder index ; and perform a weighted sum of the disorder indices calculated for several windows to obtain the comprehensive random index of the bit sequence obtained in each iteration;
[0029] ; where is the total length of the bit sequence within the window , is the number of times 0 appears in the bit sequence within the window , is the number of times 1 appears in the bit sequence within the window , is the external source influence index;
[0030] External source influence index The acquisition method includes:
[0031] Define a set composed of random numbers, denoted as the random set, and record the number of occurrences of any random number in the random set ; based on this, calculate the external source influence index ;
[0032] Preset a random measurement threshold, calculate the comprehensive random index of the currently generated bit sequence every fixed number of times. If the currently calculated comprehensive random index is lower than the random measurement threshold, continue to perform the iteration. If the currently calculated comprehensive random index has reached or exceeded the random measurement threshold, stop the iteration. The empty string mp is the preliminary random number sequence.
[0033] Furthermore, the method for finding the minimum spanning tree includes:
[0034] Based on the comprehensive node graph, construct a flow network and create two special nodes s and t. Node s represents the source point of the flow network, and node 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), and add the new source edge e1 to the set of edges in 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), and add the new sink edge e2 to the set of edges in 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 as well, and set its capacity to the reciprocal of the weight . Based on the flow network, construct a hierarchical 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. Among the maximum flows, all the edges with a flow of 1 form a spanning tree, which is the minimum spanning tree of the comprehensive node graph.
[0035] Furthermore, the method of constructing a hierarchical network based on the flow network and using the hierarchical network to find the maximum flow that can be transmitted from the source point s to the sink point t includes:
[0036] Start from the source point s and perform a breadth-first search to layer all reachable nodes. The source point s is the 0th layer. For each node v, record its layer. Only when the current layer is 1 greater than the layer of the adjacent node, add its edge to the hierarchical network.
[0037] Start from the source point s and search for a blocking flow along the direction of increasing layer. When unable to move forward, backtrack to the previous layer and continue the search. Each time a blocking flow is found, increase the total flow according to the flow of the blocking flow. When searching for a blocking flow, preferentially select the edge with a smaller weight.
[0038] For the forward edge passed by the blocking flow, reduce its remaining capacity. For the reverse edge passed by the blocking flow, increase its remaining capacity. When unable to find a blocking flow anymore, reconstruct the hierarchical network. Based on the updated hierarchical network, repeat the breadth-first search for layering until unable to construct a new hierarchical network starting from the source point s, and then stop. At this time, the maximum flow that can be transmitted from the source point s to the sink point t is found.
[0039] Furthermore, the method of encoding and converting the monitoring data of the corresponding Internet of Things device includes:
[0040] Take the original monitoring data of the Internet of Things device as plaintext data, and group the plaintext data into 64-bit data blocks; based on the key obtained from the node corresponding to the current Internet of Things device, select 56 effective key bits from the 64-bit key, and divide the 56 effective key bits into two parts: the first 28 bits and the last 28 bits; and perform 16 rounds of shift iterations on the two parts of the first 28 bits and the last 28 bits; for each round of shift iteration; perform a left shift operation on the two parts of the first 28 bits and the last 28 bits, that is, in the 1st, 2nd, 9th, and 16th rounds, shift left by 1 bit respectively, and in other rounds of shift iteration, shift left by 2 bits. Merge the shifted first 28 bits and the last 28 bits back into 56 bits, and according to the preset compression permutation table PC2, select 48 bits from the recombined 56 bits as the sub-key. After 16 rounds of shift iteration, generate 16 48-bit sub-keys;
[0041] 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; obtain the sorted data block; use the sub-key to perform permutation encryption on the sorted data block to obtain the encoded monitoring data.
[0042] Further, the method of using the sub-key to perform permutation encryption on the sorted data block includes:
[0043] Divide the sorted data block into two 32-bit parts L0 and R0 on the left and right; perform 16 rounds of encryption iteration on L0 and R0 based on the 16 48-bit sub-keys; for each round of encryption iteration, use any one of the 16 48-bit sub-keys K1 to expand R0 to 48-bit data, perform an exclusive OR operation on the expanded 48-bit data and K1, divide the result of the exclusive OR operation into 8 6-bit data blocks, and perform a 32-bit permutation on the 8 6-bit data blocks to obtain a preliminary encoded block. Repeat 16 rounds and merge the preliminary encoded blocks into 64 bits, denoted as the 64-bit preliminary encoded block; according to the IP permutation table, rearrange the bit order of the 64-bit preliminary encoded block, that is, obtain the encoded ciphertext data block, and splice all the ciphertext data blocks, that is, the encoded monitoring data.
[0044] A dynamic key generation and coding conversion method for heterogeneous Internet of Things communication, which is implemented based on the dynamic key generation and coding conversion system for heterogeneous Internet of Things communication, includes: Step 1, collect the monitoring data and topological structure of the Internet of Things device;
[0045] Step 2, construct a comprehensive node graph based on the monitoring data and topological structure of the Internet of Things device; the nodes in the comprehensive node graph correspond to the Internet of Things devices;
[0046] 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;
[0047] Step 4: Based on the keys allocated to the nodes, encode and convert the monitoring data of the corresponding Internet of Things devices to obtain the encoded monitoring data;
[0048] 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.
[0049] The technical effects and advantages of the dynamic key generation and encoding conversion system and method for heterogeneous Internet of Things communication of the present invention:
[0050] The present invention significantly improves the flexibility and adaptability of data encoding conversion, can effectively meet the encoding requirements of different types of data. The dynamic encoding mechanism adopted by the system greatly improves the confidentiality of data transmission, making it more difficult for data to be cracked and tampered with during the transmission process, 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 during data transmission, effectively saving network bandwidth resources; The adaptive encoding mechanism of the system can automatically adjust the encoding parameters according to the changes in the communication environment, achieving the optimization of transmission efficiency while ensuring data integrity; In addition, the system also has strong error correction ability, and can ensure the accurate transmission of data even in the case of poor channel quality, significantly improving the reliability of the communication system. At the same time, the encoding scheme of the system 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. Description of the Drawings
[0051] Figure 1 It is a schematic diagram of the dynamic key generation and encoding conversion system for heterogeneous Internet of Things communication of the present invention;
[0052] Figure 2 It is a schematic diagram of the dynamic key generation and encoding conversion method for heterogeneous Internet of Things communication of the present invention. Detailed Embodiments
[0053] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0054] Embodiment 1
[0055] Please refer to Figure 1 As shown, the dynamic key generation and encoding conversion system for heterogeneous Internet of Things communication in this embodiment includes:
[0056] A data acquisition module, which is used to acquire the monitoring data and topology structure of Internet of Things devices;
[0057] A graph construction module, which constructs a comprehensive node graph based on the monitoring data and topology structure of Internet of Things devices; the nodes in the comprehensive node graph correspond to Internet of Things devices;
[0058] A key dynamic generation module, which is used to dynamically generate a pseudo-random number sequence and allocate the pseudo-random number sequence to each node of the comprehensive node graph to obtain the keys corresponding to each node;
[0059] An encoding module, which performs encoding conversion on the monitoring data of the corresponding Internet of Things device based on the key allocated to the node to obtain the encoded monitoring data;
[0060] A planning module, which 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; communicate the encoded monitoring data using the determined optimal path, and each module is connected by wired and / or wireless means to achieve data transmission between modules.
[0061] Arrange various monitoring devices such as sensors and metering instruments on-site to collect the operation data of the devices, including temperature, pressure, flow rate, and power; this is the monitoring data; obtain the device layout and connection conditions through on-site survey or by referring to design documents, and draw the topology structure; the topology structure describes the positional relationship and connection method of each Internet of Things device.
[0062] The monitoring devices transmit the collected data to the data acquisition terminal or the on-site control station by wired or wireless means to form the original monitoring data.
[0063] The methods for constructing the comprehensive node graph include:
[0064] Traverse all Internet of Things devices, abstract each Internet of Things device as a node, and add it to the node set V; traverse the communication links between Internet of Things devices, if there is a communication link between two Internet of Things devices, find the corresponding two nodes in the node set V, add an undirected edge between these two nodes, and add it to the edge set E; for each undirected edge , define its weight ; obtain the preliminary weighted undirected graph G=(V, E); perform joint optimization on the preliminary weighted undirected graph to obtain the comprehensive node graph;
[0065] ; where is the physical distance between the two nodes corresponding to the undirected edge , is the bandwidth of the communication link corresponding to the undirected edge ; Is an undirected edge The delay of the corresponding communication link; Is an undirected edge The vertical height difference between the corresponding two nodes, Is the height influence adjustment coefficient, which takes into account the layout of industrial field devices at different floors or heights, Is the channel congestion degree, with a value range of [0, 1], Is the congestion influence adjustment coefficient; it reflects the real-time load status of the communication link; Is the link reliability coefficient, Is the reliability influence adjustment coefficient, which takes into account the influence of communication quality fluctuations in the industrial environment; 、 And Are the weight terms corresponding to the distance, bandwidth, and delay factors.
[0066] Channel congestion degree ; where, Is the balance weight coefficient, Is the current channel traffic, Is the channel maximum capacity, Is the current queue length, Is the maximum queue length;
[0067] ; where, Is the number of successfully transmitted data packets (the number of data packets that successfully reach the destination within a statistical period), Is the total number of data packets sent (the number of all data packets sent out within the same period), Is the number of correctly received data bits (the number of data bits confirmed to be correct after verification at the receiving end), Is the total number of data bits sent, Is the number of real-time response times (the number of responses completed within a specified time threshold), Is the total number of requests; 、 And Are the non-linear adjustment exponents, which are used to adjust the sensitivity of each index; Is the preset time decay rate, Is the current time point, Is the reference time point (the time point of a certain network reset); the above parameters are obtained through the SNMP protocol of switches and routers, and are statistically counted in real time during data transmission, and the statistical results are updated regularly.
[0068] The steps for joint optimization include:
[0069] Step 1. For the preliminary weighted undirected graph, for each node in it Calculate its comprehensive score ; Sort all nodes in descending order according to a comprehensive score to obtain a sorted node sequence;
[0070] ; Among them, , and are scoring weight coefficients, is the degree of node (the number of nodes directly connected to node ), is the betweenness centrality of node , is the set composed of the neighbor nodes of node , is the number of edges actually existing between the neighbor nodes representing node , is the sum of the degrees of all nodes in, and are adjustment parameters 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, thus more comprehensively describing the closeness of nodes and their neighbors.
[0071] Step 2: Take out the node v1 with the highest comprehensive score from the sorted node sequence and regard v1 as a central node;
[0072] 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 the 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 the edges in P(u, w) to the new weighted undirected graph G'.
[0073] 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, where each element in the matrix represents the weight of the directed edge between the corresponding 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);
[0074] Step 5: Repeat Step 4 until all nodes have been processed as central nodes and then stop. The finally obtained newly weighted undirected graph is the comprehensive node graph. In the comprehensive node graph, for any two nodes, there are multiple different paths connecting them, thus improving the fault tolerance and reliability of the communication paths.
[0075] The methods for generating a pseudo-random number sequence include:
[0076] Define a two-dimensional grid space, where each grid in the two-dimensional grid space represents a cell. Define a cell transition rule for the cells. The cell transition rule consists 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.
[0077] Set the scale of the two-dimensional grid space (for example, 1000 cells), define a binary array to store the current state of each cell, set the state of the middle cell (for example, the 500th cell) in the two-dimensional grid space to 1, and set the states of the remaining cells to 0;
[0078] Set the left neighbor cell of the first cell as the last cell, and set the right neighbor cell of the last cell as the first cell; and iteratively update the states of the cells. After the iteration ends, a preliminary random number sequence is obtained.
[0079] Create an empty list mb and an empty string mp; the empty list is used to store the sequence composed of the states of the cells in each iteration; the empty string is used to store the concatenated bit sequence; for each iteration, calculate and update the new states of each cell at the next moment according to the current state of the cell and the cell transition rule. The new states of all cells form 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 to the empty string mp.
[0080] Divide the bit sequence obtained in each iteration into several windows with a length of w, and calculate the disorder index of each window respectively ; and perform a weighted sum of the disorder indices calculated for several windows to obtain the comprehensive random index of the bit sequence obtained in each iteration;
[0081] ; where is the total length of the bit sequence within window , is window The number of occurrences of 0 in the inner bit sequence, is the window The number of occurrences of 1 in the inner bit sequence, is the external source influence index.
[0082] External source influence index The acquisition methods include:
[0083] Define a set composed of random numbers (including repeated random numbers), denoted as the random set, and record the number of occurrences of any random number in the random set Based on this, calculate the external source influence index ; ;
[0084] Preset a random measurement threshold. Specifically, through a series of randomness tests provided by, for example, NIST SP 800-22, according to the requirements in the test standard, set a threshold that can pass most randomness tests; every fixed number of times (such as every 1000 iterations), calculate the comprehensive randomness index of the currently generated bit sequence. If the currently calculated comprehensive randomness index is lower than the random measurement threshold, it means that the randomness of the generated bit sequence is not enough, and continue to execute the iteration to generate a longer bit sequence. If the currently calculated comprehensive randomness index has reached or exceeded the random measurement threshold, stop the iteration. 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.
[0085] Group the preliminary random number sequence with a fixed length (such as 64 bits) to obtain several groups of middle segment bit sequences, and interpret each group of middle segment bit sequences as a 64-bit integer. These 64-bit integers constitute a pseudo-random number sequence.
[0086] Divide the obtained pseudo-random number sequence into equal-length segments, traverse each node in the comprehensive node graph, and during the traversal, assign the segment as the key of the currently traversed node to the node. If the length of the key is not enough, repeat using the pseudo-random sequence.
[0087] The methods for finding the minimum spanning tree include:
[0088] Based on the comprehensive node graph, construct a flow network and create two special nodes s and t; 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 in the flow network, and 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 in the flow network, and 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 as well, and set its capacity to the reciprocal of the weight . The new sink edges, new source edges, and the original undirected edges in the flow network are all edges of the flow network.
[0089] 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. Specifically, starting from the source point s, perform a breadth-first search (BFS) to layer all reachable nodes. The source point s is the 0th layer. For each node v, record its layer. Only when the current layer is 1 greater than the layer of the adjacent node, add its edge to the hierarchical network.
[0090] Starting from the source point s, search for a blocking flow along the direction of increasing layer (a blocking flow refers to a path from the source point to the sink point along which the total network flow can be increased). More specifically, a blocking flow refers to a path in the current hierarchical network where the flow cannot be increased any further; when unable to move forward, backtrack to the previous layer and continue the search. Each time a blocking flow is found, increase the total flow by the flow of the blocking flow (the flow of the blocking flow refers to a flow volume from the source point to the sink point in the network, initially 0). When searching for a blocking flow, edges with smaller weights will be preferred.
[0091] For the forward edges (edges in the same direction as the flow) passed by the blocking flow, reduce their residual capacity; that is, the flow that can still be increased on the corresponding edge; for the reverse edges (edges in the opposite direction to the flow) passed by the blocking flow, increase their residual capacity; the reduction and increase amplitudes depend 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 be 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.
[0092] When it is no longer possible to continue finding the blocked flow, reconstruct the hierarchical network. Based on the updated hierarchical network, repeat the breadth-first search for layering until it is no longer possible to construct a new hierarchical network starting from the source node s. At this point, the maximum flow that can be transmitted from the source node s to the sink node 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:
[0093] They connect all nodes, they correspond to the edges with the smallest weights in the original graph, and they form an acyclic connected subgraph; this spanning tree is the minimum spanning tree of the integrated 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.
[0094] The ways to perform encoding conversion on the monitoring data corresponding to the IoT devices include:
[0095] Take the original monitoring data of the IoT device as the plaintext data, and group the plaintext data into 64-bit (8-byte) data blocks; based on the key obtained from the node corresponding to the current IoT device, select 56 valid key bits from the 64-bit key, and divide the 56 valid key bits into two parts: the first 28 bits and the last 28 bits; and perform 16 rounds of shift iterations on the two parts of the first 28 bits and the last 28 bits; for each round of shift iteration; perform a left shift operation on the two parts of the first 28 bits and the last 28 bits, that is, in the 1st, 2nd, 9th, and 16th rounds, shift left by 1 bit respectively, and in other rounds of shift iterations, shift left by 2 bits. Recombine the left-shifted first 28 bits and the last 28 bits into 56 bits, and according to the preset compression permutation table PC2 (with a total of 48 elements, ranging from 1 to 56), select 48 bits from the recombined 56 bits as the sub-key. After 16 rounds of shift iterations, generate 16 48-bit sub-keys.
[0096] Perform an initial permutation on the 64-bit data block, that is, according to a preset IP permutation table (with a total of 64 elements, ranging from 1 to 64, indicating how to rearrange the bit order in the 64-bit plaintext data block), rearrange the bit order in the data block; obtain the sorted data block; use the sub-key to perform permutation encryption on the sorted data block. Specifically, divide the sorted data block into two 32-bit parts L0 and R0 on the left and right; perform 16 rounds of encryption iteration on L0 and R0 based on 16 48-bit sub-keys; for each round of encryption iteration, use any one of the 16 48-bit sub-keys K1 to expand R0 into 48-bit data, perform an exclusive OR operation on the expanded 48-bit data and K1, divide the result of the exclusive OR operation into 8 6-bit data blocks, and perform a 32-bit permutation on the 8 6-bit data blocks to obtain a preliminary encoded block. Repeat 16 rounds and merge the preliminary encoded blocks into 64 bits, denoted as a 64-bit preliminary encoded block; according to the IP permutation table, rearrange the bit order of the 64-bit preliminary encoded block, that is, obtain the encrypted ciphertext data block, and splice all the ciphertext data blocks, that is, the monitored data after encoding.
[0097] Based on the minimum spanning tree, construct a routing table for each node. The routing table records the optimal next-hop node from this node to other nodes; for example, for node A, if data needs to be sent to node D, the next hop is node B; at each node, group the encrypted monitored data into data packets; add appropriate header information to each data packet, such as the destination node ID, sequence number, etc.
[0098] For each data packet to be sent, look up the next hop in the routing table according to the destination node, and send the data packet to the corresponding next-hop node. After receiving the data packet, the intermediate node 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; taking into account multiple aspects such as path optimization and encrypted transmission, it provides an efficient, secure and reliable data transmission guarantee for the IoT monitoring system.
[0099] In this embodiment, the flexibility and adaptability of data encoding conversion are significantly improved, enabling effective response to the encoding requirements of different types of data. The dynamic encoding mechanism adopted by the system greatly enhances the confidentiality of data transmission, making it more difficult for data 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 during data transmission, effectively saving network bandwidth resources. The adaptive encoding mechanism of the system can automatically adjust the encoding parameters according to changes in the communication environment, achieving the optimization of transmission efficiency while ensuring data integrity. In addition, the system has strong error correction capabilities, ensuring the accurate transmission of data even in the case of poor channel quality, significantly improving the reliability of the communication system. At the same time, the encoding scheme of the system 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.
[0100] Embodiment 2
[0101] Please refer to Figure 2 As shown, for the parts not described in detail in this embodiment, refer to the description content of Embodiment 1. A method for dynamic key generation and encoding conversion for heterogeneous Internet of Things communication is provided, including:
[0102] Step 1: Collect the monitoring data and topological structure of Internet of Things devices;
[0103] Step 2: Based on the monitoring data and topological structure of Internet of Things devices, construct a comprehensive node graph; the nodes in the comprehensive node graph correspond to Internet of Things devices;
[0104] Step 3: Dynamically generate a pseudo-random number sequence and assign the pseudo-random number sequence to each node in the comprehensive node graph to obtain the keys corresponding to each node;
[0105] Step 4: Based on the keys assigned to the nodes, perform encoding conversion on the monitoring data of the corresponding Internet of Things devices to obtain the encoded monitoring data;
[0106] 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 and secure data transmission.
[0107] Embodiment 3
[0108] This embodiment publicly provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the operation mode of the above-provided method for dynamic key generation and encoding conversion for heterogeneous Internet of Things communication.
[0109] Since the electronic device introduced in this embodiment is the electronic device used to implement the dynamic key generation and coding conversion method for heterogeneous Internet of Things communication in the embodiments of the present application, based on the dynamic key generation and coding conversion method for heterogeneous Internet of Things communication introduced in the embodiments of the present application, those skilled in the art can understand the specific implementation manners and various variations of the electronic device in this embodiment. Therefore, the specific implementation of how this electronic device implements the method in the embodiments of the present application will not be described in detail herein. As long as those skilled in the art implement the electronic device used for the dynamic key generation and coding conversion method for heterogeneous Internet of Things communication in the embodiments of the present application, it falls within the scope of protection of the present application.
[0110] The above formulas are all dimensionless and take their numerical values for calculation. The formulas are obtained by collecting a large amount of data for software simulation to obtain a formula that is closest to the actual situation. The preset parameters and threshold selection in the formulas are set by those skilled in the art according to the actual situation.
[0111] The above description is only a preferred implementation manner of the present invention. The protection scope of the present invention is not limited to the above embodiments. Any technical solutions falling within the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for those ordinary users in the technical field, several improvements and refinements made without departing from the principle of the present invention should also be regarded as within the protection scope of the present invention.
Claims
1. A dynamic key generation and encoding conversion system for heterogeneous Internet of Things communication, characterized in that Including: A data acquisition module, which is used to acquire the monitoring data and topology structure of Internet of Things devices; A graph construction module, which constructs a comprehensive node graph based on the monitoring data and topology structure of Internet of Things devices; the nodes in the comprehensive node graph correspond to Internet of Things devices; A key dynamic generation module, which is used to dynamically generate a pseudo-random number sequence and allocate the pseudo-random number sequence to each node of the comprehensive node graph to obtain the keys corresponding to each node; An encoding module, which performs encoding conversion on the monitoring data of the corresponding Internet of Things device based on the key allocated to the node to obtain the encoded monitoring data; A planning module, which 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; communicate the encoded monitoring data using the determined optimal path, and each module is connected by wired and / or wireless means to achieve data transmission between modules; The method of performing encoding conversion on the monitoring data of the corresponding Internet of Things device includes: Taking the original monitoring data of the Internet of Things device as plaintext data and grouping the plaintext data into 64-bit data blocks; Based on the key obtained from the node corresponding to the current Internet of Things device, selecting 56 effective key bits from the 64-bit key, and dividing the 56 effective key bits into two parts: the first 28 bits and the last 28 bits; and performing 16 rounds of shift iterations on the two parts of the first 28 bits and the last 28 bits; for each round of shift iteration; performing a left shift operation on the two parts of the first 28 bits and the last 28 bits. For the 1st, 2nd, 9th, and 16th rounds, shift left by 1 bit respectively, and for other rounds of shift iterations, shift left by 2 bits. Merge the left-shifted first 28 bits and the last 28 bits back into 56 bits, and select 48 bits from the re-merged 56 bits as the sub-key according to the preset compression permutation table PC2. After 16 rounds of shift iterations, generate 16 48-bit sub-keys; Performing an initial permutation on the 64-bit data block, and rearranging the bit order in the data block according to the preset IP permutation table; obtaining the sorted data block; using the sub-key to perform permutation encryption on the sorted data block to obtain the encoded monitoring data.
2. The dynamic key generation and coding conversion system for heterogeneous Internet of Things communication according to claim 1, wherein The method of constructing the comprehensive node graph includes: Traversing all Internet of Things devices, abstracting each Internet of Things device as a node and adding it to the node set V; traversing the communication links between Internet of Things devices. If there is a communication link between two Internet of Things devices, find the corresponding two nodes in the node set V, add an undirected edge between these two nodes, and add it to the edge set E; For each undirected edge , define its weight ; obtain the preliminary weighted undirected graph G=(V, E); perform joint optimization on the preliminary weighted undirected graph to obtain the comprehensive node graph; ; wherein, is an undirected edge and is the physical distance between the two corresponding nodes, is an undirected edge and is the bandwidth of the communication link corresponding thereto; is an undirected edge and is the delay of the communication link corresponding thereto; is an undirected edge and is the vertical height difference between the two corresponding nodes, is the height influence adjustment coefficient, is the channel congestion degree, is the congestion influence adjustment coefficient; is the link reliability coefficient, is the reliability influence adjustment coefficient; , and are the weights of the corresponding items; Channel congestion degree ; where is the balance weight coefficient, is the current channel traffic, is the channel maximum capacity, is the current queue length, is the maximum queue length; ; where is the number of successfully transmitted data packets, is the total number of data packets sent, is the number of correctly received data bits, is the total number of data bits sent, is the number of real-time response times, is the total number of requests; , and are non-linear adjustment exponents; 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 communication according to claim 2, characterized in that, The steps of performing joint optimization include: Step 1. For the initially weighted undirected graph, for each node therein calculate its comprehensive score ; sort all the nodes in descending order according to a comprehensive score to obtain a sorted node sequence; ; among them, , and are the scoring weight coefficients, is the degree of node ; is the betweenness centrality of node ; is the set composed of the neighbor nodes of node ; is the number of edges actually existing between the neighbor nodes representing node ; is the sum of the degrees of all nodes in; and are adjustment parameters; Step 2: Take out 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 the 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 pair of nodes (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 the 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 have been processed as central nodes and stop. The finally obtained new weighted undirected graph is the comprehensive node graph.
4. The dynamic key generation and coding conversion system for heterogeneous Internet of Things communication according to claim 3, characterized in that, The ways of generating the pseudo-random number sequence include: Define a two-dimensional grid space, where each grid in the two-dimensional grid space represents a cell. Define cell transition rules for the cells. The cell transition rules are 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 set the states of the other cells to 0; Set the left neighbor cell of the first cell to the last cell, and set the right neighbor cell of the last cell to the first cell; and iteratively update the states of the cells. After the iteration ends, obtain a preliminary random number sequence. Group the preliminary random number sequence with a fixed length to obtain several groups of middle-bit sequences. Interpret each group of middle-bit sequences as a 64-bit integer. These 64-bit integers form the pseudo-random number sequence.
5. The dynamic key generation and coding conversion system for heterogeneous Internet of Things communication according to claim 4, wherein The ways of iteratively updating the states of the cells include: Create an empty list mb and an empty string mp; the empty list is used to store the sequence composed of the states of the cells in each iteration; the empty string is used to store the spliced bit sequence; for each iteration, calculate and update the new state of each cell at the next moment according to the current state of the cell and the cell transition rules. The new states of all cells form a new state sequence. Add the new state sequence to the empty list mb, convert the new state sequence into a binary string to obtain a bit sequence, and splice the binary string into the empty string mp; Divide the bit sequence obtained in each iteration into several windows of length w, and calculate each window 's disorder index ; and perform weighted summation on the disorder indices calculated for several windows to obtain the comprehensive random index of the bit sequence obtained in each iteration; ; wherein, is the total length of the bit sequence within the window , is the number of occurrences of 0 in the bit sequence within the window , is the number of occurrences of 1 in the bit sequence within the window , is the external source influence index; External source influence indicator The acquisition methods include: Define a set composed of random numbers, denoted as the random set, and record any random number in the random set The number of occurrences ; Based on this, calculate the external source influence index ; Preset a random measurement threshold. Calculate the comprehensive random index of the currently generated bit sequence every fixed number of times. If the currently calculated comprehensive random index is lower than the random measurement threshold, continue to execute the iteration. If the currently calculated comprehensive random index has reached or exceeded the random measurement threshold, stop the iteration. The empty string mp is the preliminary random number sequence.
6. The dynamic key generation and encoding conversion system for heterogeneous Internet of Things communication according to claim 5, characterized in that, The ways of finding the minimum spanning tree include: Based on the comprehensive node graph, construct a flow network and create two special nodes s and t; 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, and 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, and 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 of the flow network as well, and set its capacity to the reciprocal of the weight . Based on the flow network, construct a hierarchical network, use the hierarchical network to find the maximum flow that can be transmitted from the source point s to the sink point t. Among the maximum flow, all the 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 coding conversion system for heterogeneous Internet of Things communication according to claim 6, characterized in that The method of constructing a hierarchical network based on a flow network and finding the maximum flow that can be transmitted from the source node s to the sink node t includes: Starting from the source node s, perform a breadth-first search to layer all reachable nodes. The source node s is the 0th layer. For each node v, record its layer. Only when the current layer is 1 greater than the layer of the adjacent node, add its edge to the hierarchical network. Starting from the source node s, search for a blocking flow along the direction of increasing layer. When unable to continue moving forward, backtrack to the previous layer and continue the search. Each time a blocking flow is found, increase the total flow according to the flow of the blocking flow. When searching for a blocking flow, preferentially select edges with smaller weights. For the forward edges passed by the blocking flow, reduce their residual capacities; for the reverse edges passed by the blocking flow, increase their residual capacities. When unable to continue finding a blocking flow, reconstruct the hierarchical network. Based on the updated hierarchical network, repeat the breadth-first search for layering until unable to construct a new hierarchical network starting from the source node s. At this time, the maximum flow that can be transmitted from the source node s to the sink node t is found.
8. The dynamic key generation and coding conversion system for heterogeneous Internet of Things communication according to claim 7, characterized in that, The method of performing permutation encryption on the sorted data blocks using sub-keys includes: Divide the sorted data blocks into two 32-bit parts, L0 and R0, on the left and right. Perform 16 rounds of encryption iteration on L0 and R0 based on 16 48-bit sub-keys. For each round of encryption iteration, use any one of the 16 48-bit sub-keys, K1, to expand R0 into a 48-bit data. Perform an exclusive OR operation on the expanded 48-bit data and K1. Divide the result of the exclusive OR operation into 8 6-bit data blocks, and perform a 32-bit permutation on the 8 6-bit data blocks to obtain a preliminary encoding block. Repeat 16 rounds and merge the preliminary encoding blocks into 64 bits, denoted as a 64-bit preliminary encoding block. According to the IP permutation table, rearrange the bit order of the 64-bit preliminary encoding block to obtain the encrypted ciphertext data block. Concatenate all the ciphertext data blocks to obtain the encoded monitoring data.
9. A method for dynamic key generation and coding conversion in heterogeneous Internet of Things communication, which is implemented based on the dynamic key generation and coding conversion system for heterogeneous Internet of Things communication according to any one of claims 1 to 8, characterized in that, It includes: Step 1: Collect the monitoring data and topological structure of the Internet of Things devices. Step 2: Based on the monitoring data and topological structure of the Internet of Things devices, construct a comprehensive node graph. The nodes in the comprehensive node graph correspond to the Internet of Things devices. Step 3: Dynamically generate a pseudo-random number sequence and allocate the pseudo-random number sequence to each node in the comprehensive node graph to obtain the keys corresponding to each node. Step 4: Based on the keys allocated to the nodes, perform encoding conversion on the monitoring data of the corresponding Internet of Things devices to obtain the encoded monitoring data. Step 5: Search for a 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