Nothing Special   »   [go: up one dir, main page]

CN118631421B - Block chain-based data migration method and system for dynamic nodes of Internet of things - Google Patents

Block chain-based data migration method and system for dynamic nodes of Internet of things Download PDF

Info

Publication number
CN118631421B
CN118631421B CN202411092514.4A CN202411092514A CN118631421B CN 118631421 B CN118631421 B CN 118631421B CN 202411092514 A CN202411092514 A CN 202411092514A CN 118631421 B CN118631421 B CN 118631421B
Authority
CN
China
Prior art keywords
node
cluster
dynamic
block
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202411092514.4A
Other languages
Chinese (zh)
Other versions
CN118631421A (en
Inventor
彭凯
胡佳星
金雨涵
徐博
熊欢
魏岚
肖世达
胡雪岩
郑小军
胡梦兰
韩旭
廖彤昕
林�源
廖玺
夏维
何建文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hubei Chutianyun Co ltd
Huazhong University of Science and Technology
Original Assignee
Hubei Chutianyun Co ltd
Huazhong University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hubei Chutianyun Co ltd, Huazhong University of Science and Technology filed Critical Hubei Chutianyun Co ltd
Priority to CN202411092514.4A priority Critical patent/CN118631421B/en
Publication of CN118631421A publication Critical patent/CN118631421A/en
Application granted granted Critical
Publication of CN118631421B publication Critical patent/CN118631421B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a block chain-based data migration method and system for dynamic nodes of the Internet of things, wherein the method comprises the following steps: based on storage resource distribution in a mobile Internet of things system, dividing all fixed nodes and dynamic nodes participating in the same blockchain into a plurality of initial clusters; and updating block allocation in the clusters after the dynamic nodes synchronize the missing blocks based on a dynamic block allocation algorithm, so as to minimize the query cost of the nodes and the clusters. By means of the scheme, the block migration cost and the block access cost are balanced, and the total cost of data migration of the dynamic nodes of the mobile Internet of things is effectively reduced.

Description

Block chain-based data migration method and system for dynamic nodes of Internet of things
Technical Field
The invention belongs to the technical field of blockchains, and particularly relates to a blockchain-based data migration method and system for dynamic nodes of the Internet of things.
Background
With the development of mobile communication technology, more and more internet of things devices can access to the internet of things system through a wireless network. The mobile internet of things is used as an important component of the internet of things, and can provide support for industrial digitization, treatment intellectualization and life intellectualization. The blockchain can record the transaction and the equipment state in the mobile Internet of things equipment, so that the safety and the credibility of the equipment are enhanced, and the intelligent and automatic analysis of the data is realized. The mobile internet of things based on the blockchain technology can better provide services for people, for example, wireless medical equipment can be used for acquiring and analyzing patient health data in real time, and the data is stored in the blockchain, so that confidentiality and sharing of medical data are realized. The blockchain technology is added into the mobile Internet of things, so that new technical support and application can be provided for the fields of Internet of vehicles, smart retail, mobile content distribution and the like, and innovative development and value creation of the mobile Internet of things are promoted.
The collaborative storage can improve the expandability of the blockchain network in the traditional Internet of things system, reduce the threshold of the Internet of things equipment joining the blockchain network, but cannot cope with continuously-changing mobile Internet of things equipment. The mobile device has the characteristic of mobile wireless communication, can be accessed into a blockchain network at any time and any place, and cannot be stably stored cooperatively in a certain cluster. The application of collaborative storage in a mobile internet of things environment presents new challenges, and the unstable nature of mobile devices presents difficulties for node clusters, particularly requiring that nodes within the cluster each be responsible for storing a portion of block data. When the mobile device is in different positions, the mobile device can only interact with adjacent clusters, so that the clusters need to be frequently added in the moving process, the unreasonable cluster selection can cause extremely high block access cost, and a new burden is brought to the clusters. Second, the mobile device may be offline at any time, i.e., exit the blockchain network, and upon re-entry into the network, synchronization of lost blocks during offline periods may be involved. When a mobile device is within a cluster, it needs to share its own storage resources, which involves replacing the blocks it stores. Meanwhile, the mobile device joins the cluster, so that the storage resources of the cluster can be expanded, and the access cost of the fixed device in the cluster is reduced.
At present, aiming at the data migration problem of the mobile internet of things node, most of the data migration problem is to directly select the nearest cluster for joining based on the data access time delay, and only part of the cost problem of the mobile node migration is considered in the mode, so that the cost of the data migration of the mobile internet of things dynamic node is still higher.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a block chain-based data migration method and system for dynamic nodes of the internet of things, which are used for solving the problem that the current data migration cost of the dynamic nodes of the internet of things is still high.
In a first aspect of an embodiment of the present invention, there is provided a blockchain-based data migration method for dynamic nodes of the internet of things, including:
dividing all fixed nodes and dynamic nodes participating in the same blockchain into a plurality of initial clusters based on storage resource distribution in a mobile Internet of things system;
establishing an optimized objective function in the dynamic node migration process, and setting dynamic node storage resource constraint and cluster storage block chain account book constraint corresponding to the optimized objective function;
based on the optimized objective function and the constraint condition, after the dynamic node moves and leaves the original cluster range, selecting a cluster with the lowest current position migration cost for the dynamic node through a dynamic node synchronization algorithm, and updating a block lacking by the dynamic node in the moving process;
based on the optimization objective function and the constraint condition and based on the dynamic block allocation algorithm, after the dynamic node synchronizes the missing blocks, the block allocation in the cluster is updated, and the query cost of the node and the cluster is minimized.
In a second aspect of the embodiment of the present invention, there is provided a blockchain-based data migration system for dynamic nodes of the internet of things, including:
The cluster dividing module is used for dividing all fixed nodes and dynamic nodes participating in the same blockchain into a plurality of initial clusters based on storage resource distribution in the mobile internet of things system;
the optimization constraint module is used for establishing an optimization objective function in the dynamic node migration process and setting dynamic node storage resource constraint and cluster storage block chain account book constraint corresponding to the optimization objective function;
The block synchronization module is used for selecting a cluster with the lowest current position migration cost for the dynamic node after the dynamic node moves and leaves the original cluster range through a dynamic node synchronization algorithm based on the optimization objective function and the constraint condition, and updating a block lacking by the dynamic node in the moving process;
And the block allocation module is used for updating the block allocation in the cluster after the dynamic nodes synchronize the missing blocks based on the optimization objective function and the constraint condition and based on the dynamic block allocation algorithm, so that the query cost of the nodes and the cluster is minimized.
In a third aspect of the embodiments of the present invention, there is provided an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to the first aspect of the embodiments of the present invention when the computer program is executed by the processor.
In a fourth aspect of the embodiments of the present invention, there is provided a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method provided by the first aspect of the embodiments of the present invention.
In the embodiment of the invention, based on the dynamic node synchronization algorithm and the dynamic block allocation algorithm, the most suitable cluster is added after the nodes of the Internet of things move, the required cost when the mobile nodes synchronously lose blocks is minimized, the migration cost of the mobile node blocks is optimized and balanced, the total access cost of the cluster blocks is reduced, and the problem of high data migration cost of the dynamic nodes of the Internet of things is effectively solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings described below are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
Fig. 1 is a schematic flow chart of a block chain-based data migration method for dynamic nodes of the internet of things according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of cluster division according to an embodiment of the present invention;
Fig. 3 is a schematic diagram of an internet of things dynamic node data migration process according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a block chain-based data migration system for dynamic nodes of the internet of things according to an embodiment of the present invention;
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more comprehensible, the technical solutions in the embodiments of the present invention are described in detail below with reference to the accompanying drawings, and it is apparent that the embodiments described below are only some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the term "comprising" and other similar meaning in the description of the invention or the claims and the above-mentioned figures is intended to cover a non-exclusive inclusion, such as a process, method or system, apparatus comprising a series of steps or elements, without limitation to the listed steps or elements. Furthermore, "first" and "second" are used to distinguish between different objects and are not used to describe a particular order.
Referring to fig. 1, a flow chart of a block chain-based data migration method for an internet of things dynamic node according to an embodiment of the present invention includes:
S101, dividing all fixed nodes and dynamic nodes participating in the same blockchain into a plurality of initial clusters based on storage resource distribution in a mobile Internet of things system;
The Internet of things system comprises various Internet of things devices, and is divided into mobile devices and fixed devices, wherein the mobile devices are vehicle-mounted devices, mobile robots, unmanned aerial vehicles and the like, and the fixed devices are sensors, cameras, industrial intelligent gateways, intelligent home and the like. The mobile device needs to communicate with other devices through a nearby base station or local area network, and needs to cooperate with other fixed devices to achieve corresponding functions. The fixed device needs to respond to the mobile device's instructions and may process, store, or forward the received mobile device's data to other systems. When information is transferred between the mobile device and the fixed device, the mobile device and the fixed device can be considered to participate in the same blockchain network in the same mobile internet of things system and cooperatively store blockchains.
At a certain moment when the mobile Internet of things system is stable, a plurality of initial clusters are partitioned according to the storage resource distribution of the equipment in the system through cluster partitioning. The cluster dividing process comprises the following steps: counting storage resources of all nodes (fixed and dynamic) and communication delay parameters among the nodes, dividing all the nodes into a plurality of groups based on a communication delay threshold constraint (communication delay among the nodes is not greater than a set value), selecting a single group or a plurality of groups as an initial cluster center according to the capacity of the storage resources, clustering all the initial groups into a plurality of clusters by using a clustering algorithm with the fitness between the groups and the cluster center as a standard, and in the process of dividing the clusters, each cluster following necessary constraint conditions, namely, the storage resources of a single cluster meet the basic storage resources required by storing the whole block chain.
As shown in fig. 2, the initial cluster of partitions is composed of both fixed devices and mobile devices, such as cluster C 1、C2、C3, and cannot be composed of only mobile devices. The mobile device has the characteristic of mobile wireless communication, can leave or access to the cluster block chain network at any time, and can cooperatively store in a certain cluster unstably. When the mobile device is in the cluster, the storage resources of the mobile device are required to be shared so as to expand the storage resources of the cluster, and the access cost of the fixed device in the cluster is reduced. The initial cluster always meets the minimum storage resource requirement and can store a complete piece of blockchain data even if all mobile nodes leave the cluster.
Specifically, the set of blocks in a blockchain network is represented asThe size of block b i is s i and the length of the blockchain continues to increase. For a mobile node, when the mobile node leaves the blockchain network in the moving process, the release of some blocks is missed, and for the newly added blocks in the moving process of the node, the newly added blocks are defined as a set
According to the operation characteristics of the mobile Internet of things equipment, the fixed equipment in the mobile Internet of things system is used as a fixed node, the opposite mobile equipment is used as a mobile node, a node cluster consists of the fixed node and the mobile node together, and storage resources of the cluster are storage resources of all nodes. Clusters are represented asWhereinV k represents a fixed node in the cluster and v m j represents a mobile node in the cluster; the total storage resource of the cluster isThe storage resource of node v k is r j and the storage resource of mobile node v m j is represented as
The mobile node and the fixed node in the system can communicate with each other, and the mobile node only provides service for the fixed node in the communication range. The set of nodes that interconnect with the mobile node is denoted V m and V m is a subset of cluster C. Time delay for communication between mobile node v m j and fixed node v j in clusterAnd (3) representing.
Optionally, acquiring communication time delay between a dynamic node and a fixed node in the mobile internet of things system, and calculating average communication time delay between the dynamic node and the fixed node in a preset time period; when the location of the dynamic node exceeds the predetermined delay range and remains within the current cluster, the average communication delay is recalculated to evaluate the current dynamic node state.
The process of node cross-cluster migration is as follows: after the mobile node v m j moves, updating the state of the nearby nodes in real time, selecting the nearby clusters to join after exiting the last cluster, and adding the nearby clusters to the latest blockAnd synchronizing. After joining the new cluster C k, the corresponding block is allocated by the cluster and stored.
S102, establishing an optimization objective function in a dynamic node migration process, and setting dynamic node storage resource constraint and cluster storage block chain account book constraint corresponding to the optimization objective function;
wherein the dynamic node block synchronous migration cost is expressed as
The cluster block access cost gain is expressed as
The dynamic node storage resource constraint is expressed asTo ensure that the dynamic node can store the cluster allocated blocks;
The constraint of the cluster storage block chain account book is expressed as To ensure that no dynamic node cluster can still recover the complete blockchain;
Where S i represents the block data size of the new block B i, B represents the block data set, t jk represents the communication delay between the jth node and the kth node, x ik represents the number of copies (0-1) of the block B i stored in the fixed node v k, 0 represents that the block B i is not stored in the node v k, 1 represents that the block B i is stored in the node v k, Representing the smallest communication latency between the dynamic node v m j and all the fixed nodes v k in the cluster that store block b i,For the average dwell time of all clusters before the dynamic node,For the reduced access cost after the migration of the cluster accepting mobile node V m, V j denotes a fixed node, V m denotes a set of nodes interconnected with a dynamic node,Representing the migration cost of the dynamic node v m j to acquire and store the block B i, r m is the storage resource of the mobile node v m, x ij is the number of copies of the fixed node v j to store the block B i, C k represents the kth cluster, B m represents the set of blocks stored in the last cluster by the mobile node v m j,Representing the set of blocks to be stored allocated by the cluster to the mobile node v m j, and B u represents the migration block actually required to be received by the mobile node v m j
S103, based on the optimized objective function and the constraint condition, after the dynamic node moves and leaves the original cluster range, selecting a cluster with the lowest current position migration cost for the dynamic node through a dynamic node synchronization algorithm, and updating a block lacking by the dynamic node in the moving process;
The dynamic node synchronization algorithm is used for selecting the cluster with the lowest dynamic node migration cost under the dynamic node migration optimization objective function and constraint conditions.
Specifically, monitoring the communication state of the dynamic nodes in real time, and judging whether the proportion of the number of the current cluster nodes to the number of the adjacent nodes in the communication range is smaller than a preset value or not, and whether the shortest communication time delay between the dynamic nodes and the original cluster nodes exceeds a preset threshold value or not;
if the proportion of the number of the nodes of the current cluster to the number of the adjacent nodes is smaller than a preset value or the shortest communication time delay between the dynamic node and the original cluster node exceeds a preset threshold value, the dynamic node exits the original cluster and updates the proportion of the to-be-selected cluster and the adjacent nodes;
and adding the dynamic node to the cluster with the lowest time delay according to the average time delay from the dynamic node to all the clusters to be selected, and synchronizing the blocks lacking in the dynamic node.
When the proportion eta of the number of the current cluster to the number of the adjacent nodes in the communication range is reduced to a certain degree, the dynamic node v m j is indicated to be only capable of communicating with a very small number of nodes in the current cluster, and at the moment, the mobile node is easy to lose contact with the cluster and should exit the cluster; when the node is shortest to the current clusterWhen the number is greatly increased, the node v m j is far away from the cluster, and has high communication delay with all nodes in the cluster, so that the node v m j should exit the cluster. Sudden drop of a node is the most extreme case of exiting the cluster, when it isWill drop to 0 andThen it is infinite.
From the neighboring fixed nodes, a set of clusters CLU m around the new location of the mobile node V m j can be determined, as well as a set of nodes V m in each cluster with which it can communicate, the set of nodes corresponding toThe larger the number of nodes with which communication is possible. When only one cluster exists in the CLU m and the corresponding eta is 1, the dynamic node v m j is completely in the coverage area of the cluster, and the cluster is added. When there are multiple clusters in CLU m, the average delay of the mobile node to node group G cen of each cluster is calculatedCluster C j with the lowest latency is selected for joining. G cen is a node group with more storage resources in the cluster, and lower communication latency may make the node v m query and sync block cost lower.
Sequentially synchronizing blocksAnd calculates migration costs from the set of neighboring nodes corresponding to cluster C k Selecting the lowest cost way to obtain the block. As shown in fig. 3, when performing block synchronization on a mobile node (i.e., a dynamic node), a block may be acquired from a node adjacent to a cluster. After the nodes synchronize blocks lost during offline, the nodes formally join the cluster, cooperatively store the blockchain data and participate in the blockchain network.
S104, based on the optimization objective function and the constraint condition and based on a dynamic block allocation algorithm, after the dynamic node synchronizes the missing blocks, updating the block allocation in the cluster, and minimizing the query cost of the node and the cluster.
The dynamic block allocation algorithm is used for updating block allocation in the cluster after the dynamic node joins the new cluster, and the query cost is minimized.
Specifically, updating the requirements of the original nodes in the cluster added by the dynamic nodes on all blocks, calculating the requirements of the dynamic nodes on all blocks, and comprehensively determining the priority of the new block;
Calculating migration cost and storage benefit of the new storage block selected by the dynamic node based on the priority;
and selecting the blocks with the storage benefits larger than the weighted migration cost for storage so as to finish the block updating of the mobile node.
Optionally, determining whether to migrate the new block according to a ratio of an average residence time of the dynamic node in the cluster to a storage migration cost of the new block.
A block can serve multiple nodes in the vicinity, and the needs of neighboring nodes after placement of the block can also be satisfied, so that the needs are related to multiple nodes in the vicinity. The farther a node is from the node where the block is placed, the higher the block access cost, and the greater the storage requirement; otherwise, the block is already stored in the vicinity of the node, and the node's demand for the block becomes lower. The demand level of a node for a block is related not only to the node itself and to the demand of nearby nodes, but also to the blocks already placed in the cluster. The degree of demand d ij for block b i by node v i is defined as: d m is the requirement of the dynamic node v m on the block b i, when x ij =0, the requirement d ij includes the weights of the node itself and the other nodes on the block, the lowest requirement is the weight ω ij, at this time, the other nodes all have the backup blocks b i, and the requirement of the node on the block storage itself is the lowest. Each node needs to maintain a hierarchical set V jh for the other nodes, representing the set of nodes in cluster C k that meet the hierarchical latency requirement from other nodes to V i. Each set V jh has a weight of a h, which represents the importance of V jh to node V i, so that nodes around the node can be partitioned, and more weight is given to adjacent nodes without paying attention to all nodes in the cluster. When x ij =1, the node is shown to have placed the block, and the requirement d ij is reduced to 0.
The demand of the original node of the cluster is only represented by a weight omega i, and the weight omega i of the block is related to three factors of the access frequency f ij of the node to the block, the relevance gamma ij and the block generation time weight tau i. Specifically, the weight of block b i on node v i is defined as
The access frequency of node v i to block b i is f ij, which is the ratio of the number of times a node accesses that block to the average number of times all nodes in the cluster access all blocks. Blocks with high access frequency f ij need to be focused on, and more resources should be allocated; the correlation gamma ij between a node and a block is determined by the transactions contained in the block, and when a block contains a plurality of transactions related to a certain node, the correlation between the block and the node is considered to be stronger; in addition, since the blocks are continuously generated, the importance of the history blocks with longer generation time is gradually reduced, and the newly identified blocks need to have larger weight values. When the block existence time is t, estimating the time weight of the block according to an exponential decay mode, and defining the time weight asWhere F 0 is the initial time weight at block generation,Is an attenuation adjustment factor. The way in which the exponential decay is evaluated can ensure that after a certain time the value of the term will be close to 0. I.e. there should be an additional weight assigned to the newly identified block, whereas the weight for the history block should not be determined by this term, but still mainly by the access frequency f ij.
For the weight difference between blocks b i and b i', representing the direct memory yield of v m j replacing block b i' and storing b i, b i' represents the stored block in node v m j, ω i' represents the weight of stored block b i', b i represents the non-stored but to-be-stored block of v m j,The migration cost generated for block b i is obtained and stored for v m. The migration cost calculation formula is as followsS i denotes a block data size of the new block b i,Representing the communication delay of the dynamic node v m.
The longer the average residence time of a dynamic node in a cluster, the smaller the specific gravity of the migration cost, but when the node residence time is shorter, the migration cost must be considered, so the migration cost and the v m j average residence time are combinedConsider, in the ratio of the twoIt is selected whether to migrate block b i.
Selecting storage benefitsGreater than weighted migration costIs stored in block b i. When the weight difference of the block is replacedGreater than the migration cost q ij yields the greatest benefit to the cluster and minimal loss to the mobile node. Weight difference when the block is replacedLess than the migration cost q ij, the block b i is not worth replacing with b i by a node. And the block b i with lower priority has smaller profit to the cluster and larger loss to the mobile node, so the block replacement is stopped, and the dynamic node block allocation and updating process is completed.
In this embodiment, based on a dynamic node synchronization algorithm, the cluster which is most suitable to be added after the node moves is determined, and the required cost when the mobile node loses the block in synchronization is minimized.
Meanwhile, the cluster selection problem of the mobile node when moving to a plurality of cluster boundaries is considered, the most suitable cluster is selected by comprehensively considering the adjacent resources of the mobile node and the distance from the cluster center, the blocks lost by the nodes are synchronized, the blocks stored by the mobile node are dynamically adjusted by considering the residence time of the nodes, and the block migration cost and the block access cost are balanced.
It should be understood that the sequence number of each step in the above embodiment does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not be construed as limiting the implementation process of the embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a blockchain-based data migration system of a dynamic node of the internet of things, which includes:
The cluster dividing module 410 is configured to divide all the fixed nodes and the dynamic nodes participating in the same blockchain into a plurality of initial clusters based on storage resource distribution in the mobile internet of things system;
optionally, the dividing all the fixed nodes and the dynamic nodes participating in the same blockchain into a plurality of initial clusters further includes:
Acquiring communication time delay between a dynamic node and a fixed node in a mobile Internet of things system, and calculating average communication time delay between the dynamic node and the fixed node in a preset time period;
When the location of the dynamic node exceeds the predetermined delay range and remains within the current cluster, the average communication delay is recalculated to evaluate the current dynamic node state.
The optimization constraint module 420 is configured to establish an optimization objective function in the migration process of the dynamic node, and set dynamic node storage resource constraint and cluster storage block chain ledger constraint corresponding to the optimization objective function;
Specifically, the optimization objective function comprises a dynamic node block synchronous migration cost and a cluster block access cost gain;
wherein the dynamic node block synchronous migration cost is expressed as
The cluster block access cost gain is expressed as
The dynamic node storage resource constraint is expressed asTo ensure that the dynamic node can store the cluster allocated blocks;
The constraint of the cluster storage block chain account book is expressed as To ensure that no dynamic node cluster can still recover the complete blockchain;
wherein S i represents the block data size of the new block B i, B represents the block data set, t jk represents the communication delay between the jth node and the kth node, x ik represents the number of copies of the fixed node v k memory block B i, Representing the smallest communication latency between the dynamic node v m j and all the fixed nodes v k in the cluster that store block b i,For the average dwell time of all clusters before the dynamic node,For the reduced access cost after the migration of the cluster accepting mobile node V m, V j denotes a fixed node, V m denotes a set of nodes interconnected with a dynamic node,Representing the migration cost of the dynamic node v m j to acquire and store the block B i, r m is the storage resource of the mobile node v m, x ij is the number of copies of the fixed node v j to store the block B i, C k represents the kth cluster, B m represents the set of blocks stored in the last cluster by the mobile node v m j,Representing the set of blocks to be stored allocated by the cluster to the mobile node v m j, and B u represents the migration block actually required to be received by the mobile node v m j
The block synchronization module 430 is configured to select, based on the optimization objective function and the constraint condition, a cluster with the lowest migration cost at the current position for the dynamic node after the dynamic node moves and leaves the original cluster range by using a dynamic node synchronization algorithm, and update a block lacking in the dynamic node in the moving process;
wherein, the block synchronization module 430 includes:
The judging unit is used for monitoring the communication state of the dynamic nodes in real time and judging whether the proportion of the number of the current cluster nodes to the number of the adjacent nodes in the communication range is smaller than a preset value or not, and whether the shortest communication time delay between the dynamic nodes and the original cluster nodes exceeds a preset threshold value or not;
The updating unit is used for exiting the original cluster by the dynamic node and updating the proportion of the cluster to be selected and the adjacent nodes if the proportion of the number of the nodes of the current cluster to the number of the adjacent nodes is smaller than a preset value or the shortest communication time delay between the dynamic node and the original cluster node exceeds a preset threshold value;
and the distribution unit is used for adding the dynamic node to the cluster with the lowest time delay according to the average time delay from the dynamic node to all the clusters to be selected and synchronizing the blocks lacking in the dynamic node.
The block allocation module 440 is configured to update the intra-cluster block allocation after the dynamic node synchronizes the missing blocks based on the optimization objective function and the constraint condition and based on the dynamic block allocation algorithm, and minimize the query cost of the node and the cluster.
Wherein the block allocation module 440 includes:
The setting unit is used for updating the requirements of the original nodes in the cluster added by the dynamic nodes on all the blocks, calculating the requirements of the dynamic nodes on all the blocks, and comprehensively setting the priority of the new block;
The computing unit is used for computing the migration cost and the storage benefit of the new storage block selected by the dynamic node based on the priority;
And the selection unit is used for selecting the blocks with the storage benefits larger than the weighted migration cost to store so as to finish the block updating of the mobile node.
Optionally, determining whether to migrate the new block according to a ratio of an average residence time of the dynamic node in the cluster to a storage migration cost of the new block.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and module may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. The electronic equipment is used for data migration of the dynamic nodes of the Internet of things. As shown in fig. 5, the electronic apparatus 5 of this embodiment includes: the memory 510, the processor 520, and the system bus 530, the memory 510 including an executable program 5101 stored thereon, it will be understood by those skilled in the art that the electronic device structure shown in fig. 5 is not limiting of the electronic device and may include more or fewer components than illustrated, or may combine certain components, or a different arrangement of components.
The following describes the respective constituent elements of the electronic device in detail with reference to fig. 5:
The memory 510 may be used to store software programs and modules, and the processor 520 performs various functional applications and data processing of the electronic device by executing the software programs and modules stored in the memory 510. The memory 510 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data created according to the use of the electronic device (such as cache data), and the like. In addition, memory 510 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
An executable program 5101 containing network request methods on a memory 510, the executable program 5101 may be partitioned into one or more modules/units stored in the memory 510 and executed by a processor 520 to implement internet of things dynamic node data migration and the like, the one or more modules/units may be a series of computer program instruction segments capable of performing specific functions describing execution of the computer program 5101 in the electronic device 5. For example, the computer program 5101 may be divided into functional modules such as a cluster dividing module, an optimization constraint module, a block synchronization module, and a block allocation module.
Processor 520 is a control center of the electronic device that utilizes various interfaces and lines to connect various portions of the overall electronic device, perform various functions of the electronic device and process data by running or executing software programs and/or modules stored in memory 510, and invoking data stored in memory 510, thereby performing overall condition monitoring of the electronic device. Optionally, processor 320 may include one or more processing units; preferably, the processor 520 may integrate an application processor that primarily handles operating systems, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 520.
The system bus 530 is used to connect various functional components inside the computer, and CAN transfer data information, address information, and control information, and the types of the system bus may be, for example, a PCI bus, an ISA bus, and a CAN bus. Instructions from processor 520 are transferred to memory 510 via a bus, memory 510 feeds back data to processor 520, and system bus 530 is responsible for data and instruction interaction between processor 520 and memory 510. Of course, the system bus 530 may also access other devices, such as a network interface, display device, etc.
In an embodiment of the present invention, the executable program executed by the process 520 included in the electronic device includes:
dividing all fixed nodes and dynamic nodes participating in the same blockchain into a plurality of initial clusters based on storage resource distribution in a mobile Internet of things system;
establishing an optimized objective function in the dynamic node migration process, and setting dynamic node storage resource constraint and cluster storage block chain account book constraint corresponding to the optimized objective function;
based on the optimized objective function and the constraint condition, after the dynamic node moves and leaves the original cluster range, selecting a cluster with the lowest current position migration cost for the dynamic node through a dynamic node synchronization algorithm, and updating a block lacking by the dynamic node in the moving process;
based on the optimization objective function and the constraint condition and based on the dynamic block allocation algorithm, after the dynamic node synchronizes the missing blocks, the block allocation in the cluster is updated, and the query cost of the node and the cluster is minimized.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system, apparatus and module may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (9)

1. The data migration method for the dynamic nodes of the Internet of things based on the blockchain is characterized by comprising the following steps of:
dividing all fixed nodes and dynamic nodes participating in the same blockchain into a plurality of initial clusters based on storage resource distribution in a mobile Internet of things system;
establishing an optimized objective function in the dynamic node migration process, and setting dynamic node storage resource constraint and cluster storage block chain account book constraint corresponding to the optimized objective function;
the optimization objective function comprises a dynamic node block synchronous migration cost and a cluster block access cost gain;
wherein the dynamic node block synchronous migration cost is expressed as
The cluster block access cost gain is expressed as
The dynamic node storage resource constraint is expressed asTo ensure that the dynamic node can store the cluster allocated blocks;
The constraint of the cluster storage block chain account book is expressed as To ensure that no dynamic node cluster can still recover the complete blockchain;
wherein S i represents the block data size of the new block B i, B represents the block data set, t jk represents the communication delay between the jth node and the kth node, x ik represents the number of copies of the fixed node v k memory block B i, Representing the smallest communication latency between the dynamic node v m j and all the fixed nodes v k in the cluster that store block b i,For the average dwell time of all clusters before the dynamic node,For the reduced access cost after the migration of the cluster accepting mobile node V m, V j denotes a fixed node, V m denotes a set of nodes interconnected with a dynamic node,Representing the migration cost of the dynamic node v m j to acquire and store the block B i, r m is the storage resource of the mobile node v m, x ij is the number of copies of the fixed node v j to store the block B i, C k represents the kth cluster, B m represents the set of blocks stored in the last cluster by the mobile node v m j,Representing the set of blocks to be stored allocated by the cluster to the mobile node v m j, and B u represents the migration block actually required to be received by the mobile node v m j
Based on the optimized objective function and the constraint condition, after the dynamic node moves and leaves the original cluster range, selecting a cluster with the lowest current position migration cost for the dynamic node through a dynamic node synchronization algorithm, and updating a block lacking by the dynamic node in the moving process;
based on the optimization objective function and the constraint condition and based on the dynamic block allocation algorithm, after the dynamic node synchronizes the missing blocks, the block allocation in the cluster is updated, and the query cost of the node and the cluster is minimized.
2. The method of claim 1, wherein the dividing all fixed nodes and dynamic nodes participating in the same blockchain into a plurality of initial clusters further comprises:
Acquiring communication time delay between a dynamic node and a fixed node in a mobile Internet of things system, and calculating average communication time delay between the dynamic node and the fixed node in a preset time period;
When the location of the dynamic node exceeds the predetermined delay range and remains within the current cluster, the average communication delay is recalculated to evaluate the current dynamic node state.
3. The method according to claim 1, wherein the step of selecting the cluster with the lowest current location migration cost for the dynamic node after the dynamic node moves and leaves the original cluster range by the dynamic node synchronization algorithm, and the step of updating the block missing from the dynamic node during the moving process includes:
Monitoring the communication state of the dynamic nodes in real time, and judging whether the proportion of the number of the current cluster nodes to the number of the adjacent nodes in the communication range is smaller than a preset value or not, and whether the shortest communication time delay between the dynamic nodes and the original cluster nodes exceeds a preset threshold value or not;
if the proportion of the number of the nodes of the current cluster to the number of the adjacent nodes is smaller than a preset value or the shortest communication time delay between the dynamic node and the original cluster node exceeds a preset threshold value, the dynamic node exits the original cluster and updates the proportion of the to-be-selected cluster and the adjacent nodes;
and adding the dynamic node to the cluster with the lowest time delay according to the average time delay from the dynamic node to all the clusters to be selected, and synchronizing the blocks lacking in the dynamic node.
4. The method of claim 1, wherein updating the intra-cluster block allocation after the dynamic node synchronizes the missing blocks based on the dynamic block allocation algorithm, minimizing the query cost of the node and the cluster comprises:
updating the requirements of the original nodes in the cluster added by the dynamic nodes on all the blocks, calculating the requirements of the dynamic nodes on all the blocks, and comprehensively determining the priority of the new blocks;
Selecting the migration cost and the storage benefit of the new storage block by the dynamic node based on the priority calculation;
and selecting the blocks with the storage benefits larger than the weighted migration cost for storage so as to finish the block updating of the mobile node.
5. The method of claim 4, wherein calculating migration costs and storage benefits for dynamic node selection to store new blocks based on the priorities further comprises:
And judging whether to migrate the new block according to the ratio of the average residence time of the dynamic node in the cluster to the storage migration cost of the new block.
6. The utility model provides a thing networking dynamic node data migration system based on blockchain which characterized in that includes:
The cluster dividing module is used for dividing all fixed nodes and dynamic nodes participating in the same blockchain into a plurality of initial clusters based on storage resource distribution in the mobile internet of things system;
the optimization constraint module is used for establishing an optimization objective function in the dynamic node migration process and setting dynamic node storage resource constraint and cluster storage block chain account book constraint corresponding to the optimization objective function;
the optimization objective function comprises a dynamic node block synchronous migration cost and a cluster block access cost gain;
wherein the dynamic node block synchronous migration cost is expressed as
The cluster block access cost gain is expressed as
The dynamic node storage resource constraint is expressed asTo ensure that the dynamic node can store the cluster allocated blocks;
The constraint of the cluster storage block chain account book is expressed as To ensure that no dynamic node cluster can still recover the complete blockchain;
wherein S i represents the block data size of the new block B i, B represents the block data set, t jk represents the communication delay between the jth node and the kth node, x ik represents the number of copies of the fixed node v k memory block B i, Representing the smallest communication latency between the dynamic node v m j and all the fixed nodes v k in the cluster that store block b i,For the average dwell time of all clusters before the dynamic node,For the reduced access cost after the migration of the cluster accepting mobile node V m, V j denotes a fixed node, V m denotes a set of nodes interconnected with a dynamic node,Representing the migration cost of the dynamic node v m j to acquire and store the block B i, r m is the storage resource of the mobile node v m, x ij is the number of copies of the fixed node v j to store the block B i, C k represents the kth cluster, B m represents the set of blocks stored in the last cluster by the mobile node v m j,Representing the set of blocks to be stored allocated by the cluster to the mobile node v m j, and B u represents the migration block actually required to be received by the mobile node v m j
The block synchronization module is used for selecting a cluster with the lowest current position migration cost for the dynamic node after the dynamic node moves and leaves the original cluster range through a dynamic node synchronization algorithm based on the optimization objective function and the constraint condition, and updating a block lacking by the dynamic node in the moving process;
And the block allocation module is used for updating the block allocation in the cluster after the dynamic nodes synchronize the missing blocks based on the optimization objective function and the constraint condition and based on the dynamic block allocation algorithm, so that the query cost of the nodes and the cluster is minimized.
7. The system of claim 6, wherein the block synchronization module comprises:
the judging unit is used for monitoring the communication state of the dynamic nodes in real time and judging whether the proportion of the number of the current cluster nodes to the number of the adjacent nodes in the communication range is smaller than a preset value or not, and whether the communication time delay between the dynamic nodes and the original cluster nodes exceeds a preset threshold value or not;
The updating unit is used for exiting the original cluster by the dynamic node and updating the proportion of the cluster to be selected and the adjacent nodes if the proportion of the number of the nodes of the current cluster to the number of the adjacent nodes is smaller than a preset value or the communication delay between the dynamic node and the node of the original cluster exceeds a preset threshold value;
and the distribution unit is used for adding the dynamic node to the cluster with the lowest time delay according to the average time delay from the dynamic node to all the clusters to be selected and synchronizing the blocks lacking in the dynamic node.
8. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, performs the steps of a blockchain-based method of data migration of dynamic nodes of the internet of things as claimed in any of claims 1 to 5.
9. A computer readable storage medium storing a computer program, wherein the computer program when executed implements the steps of a blockchain-based method for data migration of dynamic nodes of the internet of things as claimed in any one of claims 1 to 5.
CN202411092514.4A 2024-08-09 2024-08-09 Block chain-based data migration method and system for dynamic nodes of Internet of things Active CN118631421B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411092514.4A CN118631421B (en) 2024-08-09 2024-08-09 Block chain-based data migration method and system for dynamic nodes of Internet of things

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411092514.4A CN118631421B (en) 2024-08-09 2024-08-09 Block chain-based data migration method and system for dynamic nodes of Internet of things

Publications (2)

Publication Number Publication Date
CN118631421A CN118631421A (en) 2024-09-10
CN118631421B true CN118631421B (en) 2024-10-29

Family

ID=92610261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411092514.4A Active CN118631421B (en) 2024-08-09 2024-08-09 Block chain-based data migration method and system for dynamic nodes of Internet of things

Country Status (1)

Country Link
CN (1) CN118631421B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291295A (en) * 2020-08-11 2021-01-29 佛山赛思禅科技有限公司 High-safety mobile office network based on multi-identification network system
CN117424912A (en) * 2023-12-14 2024-01-19 湖北省楚天云有限公司 Block chain-based method, system and medium for storing cluster data of nodes of Internet of things

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109033405B (en) * 2018-08-03 2020-09-08 华为技术有限公司 Method and apparatus for maintaining blockchain, server, and computer-readable storage medium
AU2022274234A1 (en) * 2021-05-11 2023-12-07 Strong Force Vcn Portfolio 2019, Llc Systems, methods, kits, and apparatuses for edge-distributed storage and querying in value chain networks
CN117395264A (en) * 2022-07-05 2024-01-12 腾讯科技(深圳)有限公司 Block chain-based data processing method, equipment and readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291295A (en) * 2020-08-11 2021-01-29 佛山赛思禅科技有限公司 High-safety mobile office network based on multi-identification network system
CN117424912A (en) * 2023-12-14 2024-01-19 湖北省楚天云有限公司 Block chain-based method, system and medium for storing cluster data of nodes of Internet of things

Also Published As

Publication number Publication date
CN118631421A (en) 2024-09-10

Similar Documents

Publication Publication Date Title
US10990561B2 (en) Parameter server and method for sharing distributed deep learning parameter using the same
CN110618870B (en) Working method and device for deep learning training task
CN102244685B (en) Distributed type dynamic cache expanding method and system for supporting load balancing
US9703610B2 (en) Extensible centralized dynamic resource distribution in a clustered data grid
US9218220B2 (en) Elastic and scalable publish/subscribe service
CN108021451B (en) Self-adaptive container migration method in fog computing environment
CN110086888B (en) Multi-cluster dynamic load method and device based on RabbitMQ and electronic equipment
CN102273167A (en) Method and system for data management in peer-to- peer network
CN109639773B (en) Dynamically constructed distributed data cluster control system and method thereof
CN111367657A (en) Computing resource collaborative cooperation method based on deep reinforcement learning
CN103559319B (en) The cache synchronization method and equipment of distributed cluster file system
CN113342510B (en) Water and power basin emergency command cloud-side computing resource cooperative processing method
CN101741907A (en) Method and system for balancing server load and main server
CN111274036A (en) Deep learning task scheduling method based on speed prediction
Zhao et al. Lightgraph: Lighten communication in distributed graph-parallel processing
CN109063041A (en) The method and device of relational network figure insertion
CN115878729B (en) Node block storage allocation optimization method and system based on alliance chain
CN118631421B (en) Block chain-based data migration method and system for dynamic nodes of Internet of things
CN108875035A (en) The date storage method and relevant device of distributed file system
CN118227337B (en) Method and device for processing storage system by key value
EP3632086B1 (en) Server system for processing a virtual space
CN108153759A (en) A kind of data transmission method of distributed data base, middle tier server and system
CN104426774A (en) High-speed routing lookup method and device simultaneously supporting IPv4 and IPv6
CN111770152B (en) Edge data management method, medium, edge server and system
CN108833531A (en) A kind of data placement method based on consumption of data center and network energy consumption

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant