Reliable data sharing method for UAV ad hoc network based on lightweight blockchain
By cached blocks and encoded, combining the BDQN model and drone interaction mechanism, the storage overhead and reliability problems of drone blockchain are solved, and efficient and reliable data sharing is achieved.
Patent Information
- Application Number
- CN202310066217.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-16
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2043-01-16
AI Technical Summary
The prior art is difficult to take into account the reliability of data storage when reducing the storage overhead of drones deploying blockchain nodes, resulting in unavailability of data stored on the blockchain.
The passed blocks are verified by cache consensus and their block volume data are erased and encoded, and only the corresponding data blocks in the encoding matrix are stored, and the combination of cache replacement actions is predicted using the BDQN model, and the target block is obtained or restored by interacting with other drones.
It significantly reduces the overhead of data storage for drones on chain, improves the reliability of data storage, and ensures real-time and efficient data access.
Smart Images

Figure CN116319998B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of unmanned aerial vehicles, and in particular relates to a method for reliable sharing of unmanned aerial vehicle self-organizing network data based on a lightweight blockchain. Background Art
[0002] Drone technology originated in the military field and is often used for intelligence reconnaissance, target search and tracking, ground attack and other purposes. In recent years, with the continuous changes and developments in the size, shape and functions of drones, drone technology has been expanded to the civilian field. Compared with a single drone, the UAVNET (Unmanned Aerial Vehicle NET) composed of multiple drones can share data through multi-hop forwarding of other drone nodes without relying on the Ground Control Station (GCS), so as to achieve collaborative task decision-making, collision avoidance and other purposes. It has the characteristics of strong anti-destruction and high execution efficiency, and has been widely used in cargo delivery, environmental protection, disaster response and so on. Among them, the network architecture of UAVNET is as follows: Figure 1 shown.
[0003] Due to the limited coverage of a single drone and the single mission it performs, drone clusters need to collaborate with each other during mission execution and have a need for data sharing. For example, in forest exploration missions, drone clusters need to collect a large amount of image data and share it between clusters for map synthesis. Blockchain technology, as a distributed data sharing technology, can be applied to drone cluster data sharing. Compared with deploying blockchain on centralized facilities such as ground base stations and cloud servers, directly deploying blockchain in drone clusters can avoid the risk of single point failures and give full play to the advantages of blockchain.
[0004] However, traditional blockchain solutions use a full backup data storage model, which requires storing the same ledger data on each node, resulting in a large storage overhead; due to the limited storage capacity of drones, directly storing large amounts of shared data will quickly exhaust limited storage resources.
[0005] In response to the above problems, three strategies for reducing blockchain storage overhead have been proposed in related technologies: (1) Light node strategy, which assumes that there are drones with stronger capabilities in UAVNET as full nodes to store complete block data, and the remaining drones as light nodes only need to store the header information of all blocks. However, when performing tasks, light nodes need to rely on a small number of full nodes to provide complete block data. If these full nodes are destroyed, the drones will be unable to access the data. In addition, since light nodes do not need to store blockchain data, the cost of joining the cluster is lower than that of full nodes. With the continuous addition of light node drones, the drone network will gradually become centralized. In addition, drone nodes in ad-hoc (peer-to-peer) networks are usually of equal capabilities, and there may not be drones that meet the capabilities of full nodes. Therefore, this method is difficult to apply in actual environments. (2) Pruning strategy, which permanently deletes some historical blockchain data on drone nodes from the local and only retains the block header information, thereby reducing the storage overhead of the blockchain. However, when the task to be executed requires pruned historical data, this approach will cause the drone to be unable to use the data. (3) Sharding strategy, which divides blockchain nodes into different shards and also divides the data storage responsibilities. Nodes under different shards only need to maintain part of the data in their respective shards, thereby reducing the storage overhead of the entire drone cluster. However, since the number of data backups in sharding technology is far less than that of traditional full backup solutions, it leads to poor data storage reliability.
[0006] Most of the existing drone self-organizing network data sharing solutions based on lightweight blockchain use a pruning strategy or a light node strategy to solve the problem that drone nodes cannot bear the blockchain data storage overhead. For example, Singh et al. proposed an ODOB scheme in "Odob: One drone one blockbased lightweight blockchain architecture for internet of drones", which uses a single block to identify and store the information of each drone. The drone adds new data by directly modifying the block information to which it belongs. However, since the data part is not included in the calculation of the block hash, the basic property of blockchain data that cannot be tampered with is destroyed, so drone data still faces data security risks.
[0007] For another example, Wang et al. proposed an AirBC scheme in “Airbc: A lightweight reputation-based blockchain scheme for resource-constrained uanet”, which reduces the storage overhead of the blockchain on drone devices through a block data pruning strategy. Specifically, when all transactions in a block are referenced by subsequent block transactions, all transaction data in the block are pruned to free up storage space. This idea is consistent with the strategy of pruning based on the UTXO (Unspent Transaction Output) model in Bitcoin, but in reality there is no correlation between drone data similar to currency transactions, so there is no need for citation. In addition, this scheme requires a drone to act as a full node for storing all blockchain data. If a full node fails or temporarily leaves the cluster, other nodes within the communication range of the full node cannot access and recover the pruned data, resulting in reduced data availability.
[0008] In summary, although the existing technical solutions have reduced the storage overhead of deploying blockchain nodes on drones to varying degrees, it is difficult to take into account the reliability of data storage, resulting in the unavailability of data stored on the blockchain. Summary of the invention
[0009] In order to solve the above problems existing in the prior art, the present invention provides a method for reliable sharing of drone self-organizing network data based on lightweight blockchain.
[0010] The technical problem to be solved by the present invention is achieved through the following technical solutions:
[0011] A method for reliable sharing of data in a drone self-organizing network based on a lightweight blockchain is applied to drones in a drone self-organizing network; the drone self-organizing network realizes data sharing based on blockchain, and the method comprises:
[0012] When a block is verified by consensus, the block is cached in a cache area of a preset size, and the block header of the block is stored locally; the block body data of the block is erasure coded according to the erasure code encoding parameters notified by the ground control station to obtain a coding matrix; the corresponding coded data block is selected from the coding matrix and stored locally;
[0013] When the drone is a block-generating drone, it collects the status data of all drones in the network; based on the collected status data, it uses the pre-trained BDQN model to simulate the Markov process to predict the combination of cache replacement actions of each drone; and broadcasts the combination;
[0014] When the drone obtains the combination, it selectively replaces the blocks in the cache area according to the cache replacement action corresponding to itself in the combination;
[0015] When the on-chain data that the drone wants to access is located in the target block, and the target block is not in the cache space, the target block is acquired or restored by interacting with other drones.
[0016] Optionally, when the on-chain data that the drone wants to access is located in a target block and the target block is not in the cache space, acquiring or recovering the target block by interacting with other drones includes:
[0017] When the on-chain data that the drone wants to access is located in the target block, and the target block is not in the cache space, a data access request is broadcasted so that other drones that have the target block cached can feed back the target block;
[0018] When the data access request times out and is not responded to, broadcast a data recovery request so that other drones can feedback their respective stored coded data blocks;
[0019] According to the encoded data blocks stored by itself and fed back by other drones, the target block is restored using the erasure code decoding rules.
[0020] Optionally, the size of the cache area does not exceed 100 MB.
[0021] Optionally, the BDQN model includes: a feature extraction network, a state value network, a first action branch network, a second action branch network and an action decision network;
[0022] The feature extraction network is used to extract drone state features from a state data matrix; wherein the state data matrix is constructed by the block-generating drone based on the collected state data;
[0023] The state value network is used to calculate the state value matrix according to the state characteristics of the drone;
[0024] The first action branch network is used to calculate first prediction information representing the swap-out block height of all drones in the network according to the drone state characteristics;
[0025] The second action branch network is used to calculate second prediction information representing the height of the swapped-in block of all drones in the network according to the drone state characteristics;
[0026] The action decision network is used to decide the optimal combination of cache replacement actions of all drones in the network based on the state value matrix, the first prediction information and the second prediction information using a predefined global reward function.
[0027] Optionally, the global reward function is:
[0028]
[0029] Among them, α is the preset weight factor, N is the number of drones in the drone ad hoc network, and HT i Indicates the drone id i The number of cache hits, where the cache hit means that the data to be accessed by the drone is stored locally; Indicates the drone id i The state parameter at time t, RCES t+1 Indicates the drone id i The state parameters at time t+1 are: Where E i Indicates the drone id i Current power consumption, RD i Indicates the drone id i The current average latency for accessing on-chain data, C i Indicates the drone id i Current storage cost; R(s t+1 ,s t |a t ) represents the state s of the UAV ad hoc network at time t t The cache replacement action combination a is executed t After that, at time t+1, it switches to state s t+1 The benefits brought by a single drone id i The state s is defined as s i ={RD i ,HT i ,CB i ,E i ,C i} i∈N , where CB i Indicates the drone id i The height set of the current locally stored block, a single drone id i The cache replacement action is defined as a i =(A1 i ,A2 i ) i∈N , where A1 i Indicates the drone id i The current swapped out block height, A2 i Indicates the drone id i The current swap-in block height.
[0030] Optionally, the block header of the blockchain is stored locally by the drone in a chained manner;
[0031] The block header of the blockchain includes: the previous block hash, the current block hash, the block generation time and the Merkle root hash;
[0032] The block body of the blockchain includes: transaction hash, transaction generation time, transaction initiator ID, transaction data, and digital signature of transaction data; wherein, the transaction is data encapsulated in the form of a transaction and needs to be shared within the drone self-organizing network.
[0033] Optionally, the block-generating drone uses the Keccak algorithm as a hash algorithm used when generating blocks.
[0034] Optionally, the data length output by the hash algorithm is 224 bits.
[0035] Optionally, the block-generating drone uses a ZSS short signature algorithm as a signature algorithm used when generating blocks.
[0036] Optionally, performing erasure coding on the block volume data of the block according to the erasure coding parameters notified by the ground control station to obtain a coding matrix includes:
[0037] Reed-Solomon encoding is performed on the block body data of the block according to the erasure code encoding parameters notified by the ground control station to obtain a coding matrix.
[0038] In the reliable sharing method of drone self-organizing network data based on lightweight blockchain provided by the present invention, the drone caches the blocks that have passed the consensus verification into the cache space instead of directly storing them locally. Then, the drone encodes the block body data of the blocks that have passed the consensus verification by erasure coding, and selects its own corresponding data blocks from the coding matrix for local storage, thereby significantly reducing its storage overhead for on-chain data and achieving lightweight storage. When the drone is a block-producing drone, it collects the status data of all drones in the network, and uses the BDQN model to simulate the Markov process based on the collected status data to predict the combination of cache replacement actions of each drone. Then, all drones that have obtained the combination selectively replace the blocks in the cache area according to the cache replacement actions corresponding to themselves, realizing an efficient cache replacement algorithm that adaptively learns the optimal cache strategy, which can ensure the hit rate of the on-chain data cached locally to be accessed by the drone, and improve the efficiency of the drone in accessing the on-chain data. When the on-chain data that a drone wants to access is located in the target block and the target block is not in its cache space, it can obtain or restore the target block by interacting with other drones, effectively reducing the occurrence of unavailability of data stored on the blockchain and improving the reliability of data storage.
[0039] In summary, the present invention improves the storage capacity of the drone's on-chain data while adapting to the limited storage resources of the drone, ensuring the reliability of data storage, and also meeting the requirements of real-time access to drone cluster data.
[0040] The present invention will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is the network architecture of UAVNET;
[0042] Figure 2 It is a flow chart of a method for reliable sharing of drone self-organizing network data based on lightweight blockchain provided by an embodiment of the present invention;
[0043] Figure 3 This is a schematic diagram of the process of consensus verification of blocks by drone self-organizing network;
[0044] Figure 4 It is a schematic diagram of the structure of the blockchain in an embodiment of the present invention;
[0045] Figure 5 It is a structural diagram of the existing BDQN (Branching Deep Q-Network) model;
[0046] Figure 6 is a schematic structural diagram of an improved BDQN model in an embodiment of the present invention;
[0047] Figure 7 is a flow chart of a drone accessing on-chain data in an embodiment of the present invention;
[0048] Figure 8 is a schematic diagram of two functional modules deployed in a drone according to an embodiment of the present invention;
[0049] Fig. 9 It is the result of comparing the total storage overhead of the drone cluster of the embodiment of the present invention with that of three existing solutions;
[0050] Fig.10 It is the result of comparing the average storage overhead of drone nodes of the embodiment of the present invention with that of three existing solutions;
[0051] Fig.11 It is the result of comparing the average block storage overhead of the embodiment of the present invention with that of three existing solutions;
[0052] Fig.12 It is the result of comparing the number of storable blocks of the embodiment of the present invention with that of three existing solutions;
[0053] Fig.13, shows the average storage overhead of the drone nodes under different RS parameters in the embodiment of the present invention as the block height increases;
[0054] Fig.14 , which shows the average storage overhead of the drone nodes under different RS parameters in the embodiment of the present invention as the cluster size continues to increase;
[0055] Fig.15 It is the result of comparing the average data access latency of the embodiment of the present invention with that of the existing erasure coding scheme;
[0056] Fig.16 This is the result of comparing the success rate of drone cluster data access of the embodiment of the present invention with that of two existing solutions. DETAILED DESCRIPTION
[0057] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.
[0058] In order to reduce the storage overhead of blockchain nodes deployed on drones while taking into account the reliability of data storage, an embodiment of the present invention provides a reliable data sharing method for drone ad hoc networks based on lightweight blockchain. The method is applied to drones in a drone ad hoc network, which realizes data sharing based on blockchain. Figure 2 As shown, the reliable sharing method of drone self-organizing network data based on lightweight blockchain provided by the embodiment of the present invention includes the following steps:
[0059] S10: When a block is verified by consensus, the block is cached to a cache area of a preset size, and the block header of the block is stored locally; the block body data of the block is erasure coded according to the erasure code encoding parameters notified by the ground control station to obtain a coding matrix; the corresponding coded data block is selected from the coding matrix and stored locally.
[0060] The size of the cache area is preferably no larger than 100 MB, but is certainly not limited thereto.
[0061] Each drone in the drone ad hoc network is installed with blockchain software, such as UChain software, and each drone is a consensus node of the blockchain. Figure 3 As shown in the figure, according to the Raft consensus protocol, a leader node will be elected as the block-producing node in each time window; the drones in the drone ad hoc network encapsulate the data that needs to be shared, such as various sensors and instructions, into the format of transaction data, and transmit them to the block-producing drones in the time window through wireless channels. This process corresponds to Figure 3When the block-generating drone receives the transaction data submitted by the drone in the network, it will verify whether the signature information is correct based on the data content in the transaction and the public key corresponding to the transaction initiator ID; if the verification is successful, the block-generating drone will broadcast the confirmation message to the network. This part of the process corresponds to Figure 3 The verification and replication phase in the network; after receiving the confirmation message, the drones in the network vote together to confirm. This part of the process corresponds to Figure 3 When the block-producing drone node receives confirmation from more than half of the drones, it sends a confirmed message to the drones in the network. The drones store the blocks that have passed the consensus verification locally in the manner of step S10. This part of the process corresponds to Figure 3 Notification & Storage Phase.
[0062] Among them, the block header of the blockchain is stored locally by the drone in a chain manner. The data volume of the block header part is usually a few hundred bytes, so the storage overhead is almost negligible.
[0063] For example, in one implementation, see Figure 4 As shown, the block header of the block stored locally by the drone includes: the hash H of the previous block (Block n-1 ), current block hash H(Block), block generation time TimeStamp and Merkel root hash Merkel_Root. The block body of the block stored locally by the drone includes: transaction hash H(T X4 ), transaction generation time TimeStamp, UID (transaction initiator ID), transaction data Data, and digital signature Signature of transaction data; It can be understood that the transaction mentioned here is the data that needs to be shared within the drone self-organizing network and is encapsulated in the form of a transaction.
[0064] In a specific example, the size of the storage space occupied by each data content stored in the block can be as shown in Table 1:
[0065] Table 1
[0066]
[0067] Before the drone swarm takes off, the ground control station will cluster the drone swarm according to the mission requirements, assign an identity number to each drone, and generate system parameters. in is the additive cyclic group of order q obtained from the generator P, For Multiplicative cyclic groups of the same order; e is a pair of bilinear maps defined as The arrow represents the function of e; H represents the hash algorithm, which is defined as H:{0,1} * →{0,1} β , the arrow represents the function of H, * indicates that the length of data input to the hash algorithm is indefinite, and β indicates the length of data output by the hash algorithm. e and q are parameters used in the signature algorithm, and H is a parameter used in the hash algorithm.
[0068] Optionally, in one implementation, the block-generating drone may use the Keccak algorithm as the hash algorithm used when generating blocks. At this time, the data length β output by the hash algorithm may be configured to be 224 bits, but is not limited thereto.
[0069] The Keccack algorithm is a SHA-3 algorithm (third-generation secure hash algorithm) with lower computational overhead and higher computational efficiency. It is suitable for deployment on drones to adapt to the lightweight storage scenario of drones.
[0070] Optionally, in one implementation, the block-generating drone may use the ZSS short signature algorithm as the signature algorithm used when generating blocks.
[0071] The ZSS short signature algorithm has lower computational overhead while maintaining the same length as the widely adopted BLS short signature algorithm, and is suitable for deployment on drones to adapt to the lightweight storage scenario of drones.
[0072] The ground control station also generates a private key for each drone device As well as the public key xP, the drone saves its own private key information and the public key information of other drones in the local TPM (Trusted Platform Module), thereby avoiding the problem of key information leakage caused by the physical capture of the drone device.
[0073] It is understandable that the hash algorithm, short signature algorithm and encryption / decryption algorithm are not the inventive points of the embodiments of the present invention and are already very mature in the relevant technologies, so the embodiments of the present invention will not be elaborated in detail.
[0074] The ground control station will also set the erasure code encoding parameters (m, K, N) according to the current size of the drone cluster, where m represents the encoding code element symbols are all from the finite field GF (2 m ), K and N represent that the source data to be encoded is divided into K symbols and encoded into codewords of N symbol length.
[0075] Optionally, in one implementation, the UAV performs erasure coding on the block volume data of the block according to the erasure coding parameters notified by the ground control station to obtain a coding matrix, which may include:
[0076] According to the erasure code encoding parameters notified by the ground control station, the block body data of the block is Reed-Solomon encoded to obtain a coding matrix. Among them, Reed-Solomon encoding is also referred to as RS encoding.
[0077] Specifically, the drone encodes the block data according to the encoding parameters (K, N) and a generation matrix G notified by the ground control station. First, the block data is divided to construct a data matrix D = (D1, D2, D3, ..., D K ) T , perform matrix multiplication on the generated matrix G and D to obtain the encoding matrix C = (C1, C2, C3, ..., C N ) T , the encoding process is as follows:
[0078]
[0079] After obtaining the coding matrix, the drone finds its corresponding coding data block from it. For example, in the above formula, the number is id N The drone only needs to encode the data block C N Just store it locally.
[0080] It should also be noted that the erasure code is not limited to the Reed-Solomon code shown above, and other types of erasure codes can also be applied to the embodiments of the present invention.
[0081] S20: When the drone is a block-producing drone, collect the status data of all drones in the network; use the pre-trained BDQN model to simulate the Markov process to predict the combination of cache replacement actions of each drone based on the collected status data; and broadcast the combination.
[0082] In the embodiment of the present invention, the replacement process of the local cache data of the drone is modeled as an MDP (Markov decision process), and the definitions of state, action, and reward are given accordingly as follows:
[0083] (a) Define the state of a single drone as s i ={RD i ,HT i ,CB i ,E i ,C i} i∈N , so the state of all drones in the network s = ∪ i∈N s i .
[0084] Among them, RD i Indicates the drone id iThe current average latency for accessing on-chain data; HT i Indicates the drone id i The number of cache hits, where the so-called cache hit means that the data that the drone wants to access is stored locally; CB i Indicates the drone id i The height set of the block currently stored locally; E i Indicates the drone id i Current power consumption; C i Indicates the drone id i Current storage cost.
[0085] (b) Define a single drone id i The cache replacement action is defined as a i =(A1 i ,A2 i ) i∈N , so the combination of cache replacement actions of all drones in the network is a=∪ i∈N a i .
[0086] Among them, A1 i Indicates the drone id i The current swapped out block height, i.e. the drone id i The height of the block to be replaced in the current buffer; A2 i Indicates the drone id i The current swap block height, i.e. the drone id i The height of the new block to be swapped into the current buffer.
[0087] (c) Define a single drone id i Status parameters Therefore, the combination of cache replacement actions of all drones in the network is RCES = ∪ i∈N RCES i .
[0088] In related technologies, the network structure of the BDQN model is as follows: Figure 5As shown in the figure, the original algorithm of this model aims at the explosion problem of the combination space of multiple actions of a single agent. Different actions are divided into different branch networks for training, and all branches are connected by a shared module. Specifically, the state data is first input into a hidden layer with a dimension of 512*256 for feature extraction, and then the output is respectively input into the state value network (State value) with a dimension of 128 and the branch network (Advantages Dimension) of different actions. The branch networks of different actions will calculate the advantage function value of each action. Then, the Q value is calculated based on the output of each branch network and the output of the state value network, and finally the argmax function is used to decide the optimal action. The existing BDQN model reduces the size of the action space from exponential growth to linear growth, which can solve the problem of the explosion of the action combination of a single agent.
[0089] However, as the number of drones in the drone ad hoc network increases and the block height in the blockchain increases, the dimension of the above defined actions will become larger and larger; for example, when m drones have a blockchain height of n and a cache size of p, there will be (p·n) times when replacing their cache contents. m Combination of.
[0090] Therefore, in order to further solve the problem of a large number of combinations caused by a large number of drones, the embodiment of the present invention improves the network structure of the existing BDQN algorithm on the basis of the existing BDQN algorithm to make it suitable for a multi-agent environment to alleviate the adverse effects brought about by the large number of combinations mentioned above.
[0091] For details, see Figure 6 As shown, the BDQN model used in the embodiment of the present invention includes: a feature extraction network ( Figure 6 Shared representation in ), state value network ( Figure 6 State value in), the first action branch network ( Figure 6 Advantages Dimension1 in the second action branch network ( Figure 6 Advantages Dimension2 in ) and the action decision network ( Figure 6 Advantages Dimension 1).
[0092] Among them, the feature extraction network is used to extract the state features of the drone from the state data matrix; here, the state data matrix is constructed by the block-producing drone based on the collected state data. The state value network is used to calculate the state value matrix based on the drone state features. The first action branch network is used to calculate the first prediction information of the swap-out block height of all drones in the representation network based on the drone state features. The second action branch network is used to calculate the second prediction information of the swap-in block height of all drones in the representation network based on the drone state features. The action decision network is used to decide the optimal combination of cache replacement actions for all drones in the network based on the state value matrix, the first prediction information and the second prediction information using a predefined global reward function.
[0093] Among them, the global reward function used in the action decision network is:
[0094]
[0095] In this function, α is the preset weight factor, N is the number of drones in the drone ad hoc network, Indicates the drone id i The state parameter at time t, RCES t+1 Indicates the drone id i The state parameter at time t+1; R(s t+1 ,s t |a t ) represents the state s of the UAV self-organizing network at time t t The cache replacement action combination a is executed t After that, at time t+1, it switches to state s t+1 The benefits brought by this, and the explanations of other parameters can be found above.
[0096] based on Figure 6 It can be understood that in the embodiment of the present invention, the data of multiple agents are input into the BQDN network as state data, and two branch networks are used to calculate the cache replacement actions of all drones instead of a single drone action. That is, the first action branch network calculates the height of all drones swapping out blocks, and the second action branch network calculates the height of all drones swapping in blocks, and finally uses the argmax function to obtain the optimal action. In addition, the structure and Figure 5 The same as in.
[0097] It is understandable that the drone will upload its own status data to the leading drone in the current time window. When the leading drone collects the status data of all drones, it integrates these status data into a status data matrix and inputs the matrix into Figure 6In the network structure shown in , a combination of cache replacement actions of each drone is obtained. Then, the leading drone broadcasts the cache replacement actions to be performed by each drone in the next time window to the entire network, so that each drone replaces the blocks in the cache area according to its corresponding action. The specific replacement method is shown in the subsequent step S30.
[0098] S30: When the drone obtains the above combination, it selectively replaces the blocks in the cache area according to the cache replacement action corresponding to itself in the combination.
[0099] It is understandable that, for the leading drone that predicts the combination, when the combination is output from the BQDN, it can perform block replacement according to the cache replacement action corresponding to itself in the combination. For other drones, when they receive the combination broadcast by the leading drone, they can perform block replacement according to the cache replacement action corresponding to themselves in the combination.
[0100] S40: When the on-chain data that the drone wants to access is located in the target block, and the target block is not in the cache space, the target block is acquired or restored by interacting with other drones.
[0101] For details, see Figure 7 As shown in the figure, when the drone wants to access the on-chain data, it first determines whether the target block B containing the on-chain data is stored in the cache space. H ; If it exists, the data on the chain is read directly from the cache space; if it does not exist, the drone can first broadcast a data access request to cache the target block B H Other drones feedback target block B H ; If the data access request broadcast by the drone times out and is not responded to, the drone can further broadcast a data recovery request to enable other drones to feedback their locally stored coded data blocks; then, the drone uses the erasure code decoding rules to restore the target block based on its own locally stored coded data blocks and the feedback of other drones, thereby obtaining the on-chain data that it wants to access from the restored target block. It can be understood that the data content of the target block restored here is the same as when it was initially verified by consensus.
[0102] It is understandable that drones work in an open environment and may malfunction at any time due to natural or human factors, such as collisions with birds, interference from electronic pulses, etc. In addition, some drones may leave the group when executing drone cluster tasks, such as returning home due to low battery, task scheduling, etc. The above factors lead to the dynamic change of drone topology. Therefore, even if there are drones that cache the target blocks in the network, there may be packet loss and other phenomena that lead to increased access delays or even inaccessibility of data. Therefore, a data recovery mechanism is set in the embodiment of the present invention to effectively reduce the occurrence of unavailability of data stored on the blockchain.
[0103] In a specific example, assuming that drone id2 performs RS encoding on the block data of block B according to the erasure code encoding parameters of N=5 and K=3, the encoding matrix C=(C1, C2, C3, C4, C5) is obtained. T , then id2 selects the coded data block C2 as the block body data and stores it locally. When the data that id2 wants to access is in block B, and block B in id2's cache space has been replaced, id2 first issues a data access request; assuming that the request times out and is not responded to by any other drone in time, id2 continues to issue a data recovery request, and thus receives coded data blocks C1 and C5 from drones id1 and id5 respectively. At this point, id2 holds C2 locally, plus the received C1 and C5, for a total of 3 coded data blocks, which meets the threshold K for recovering data. Therefore, id2 generates the inverse matrix G of the matrix -1 Take out the row data corresponding to C1, C2 and C5, and perform matrix multiplication on them with C1, C2 and C5 to restore the original C = (C1, C2, C3, C4, C5) T Then, id2 verifies the recovered data based on the block header information. If the hash values are consistent, the data is successfully recovered.
[0104] In the reliable sharing method of drone self-organizing network data based on lightweight blockchain provided by the embodiment of the present invention, the drone caches the blocks that have passed the consensus verification into the cache space instead of directly storing them locally. Then, the drone encodes the block body data of the blocks that have passed the consensus verification by erasure coding, and selects the corresponding data blocks from the coding matrix for local storage, thereby significantly reducing its storage overhead for on-chain data and achieving lightweight storage. When the drone is a block-producing drone, it collects the status data of all drones in the network, and uses the BDQN model to simulate the Markov process based on the collected status data to predict the combination of cache replacement actions of each drone. Then, all drones that have obtained the combination selectively replace the blocks in the cache area according to the cache replacement actions corresponding to themselves, realizing an efficient cache replacement algorithm for adaptive learning of the optimal cache strategy, which can ensure the hit rate of the on-chain data cached locally for the drone to access, and improve the efficiency of the drone accessing the on-chain data. When the on-chain data that the drone wants to access is located in the target block, and the target block is not in its cache space, it can obtain or restore the target block by interacting with other drones, effectively reducing the unavailability of data stored on the blockchain and improving the reliability of data storage. In summary, it can be seen that the embodiments of the present invention improve the storage capacity of the drone's on-chain data while adapting to the limited storage resources of the drone, ensuring the reliability of data storage, and also meeting the real-time data access requirements of the drone cluster.
[0105] In practical applications, such as Figure 8 As shown in , two functional modules, LightStore, a data storage module, and SmartCache, a data cache module, can be deployed on the drone. LightStore is used to implement the function of step S10, VContainer is a submodule dedicated to storing block headers, Encoder is an RS encoding module, and the corresponding Decoderd represents an RS decoding module. SmartCache is used to implement the functions of steps S20 and S30; Figure 8 B0, B 17 …is a data block stored in SmartCache. The SmartCache module is responsible for caching complete block data to improve access efficiency; different from traditional cache replacement algorithms with fixed rules such as LRU (Least Recently Used), LFU (Least Frequently Used), and FIFO (First In First Out), this module dynamically caches specific block data after consensus confirmation based on the strategy learned by the deep reinforcement learning algorithm.
[0106] In order to prove the superiority of the embodiment of the present invention, the traditional blockchain solution, ODOB solution, AirBC solution, sharding blockchain solution and light node solution are used for comparative experiments with the solution of the embodiment of the present invention. The above-mentioned comparative solutions are the latest research results of lightweight drone blockchain. Among them, the traditional blockchain solution can be found in S.Nakamoto, "Bitcoin: A peer-to-peer electronic cash system," Decentralized Business Review, p.21260, 2008. The ODOB solution and the AirBC solution have been mentioned in the background technology. The sharding blockchain solution can be found in M.Zamani, M.Movahedi, and M.Raykova, "Rapidchain: Scaling blockchain via fullsharding," in Proceedings of the 2018ACM SIGSAC conference on computer and communications security, 2018, pp.931–948. For the light node solution, see Y. Tan, J. Liu, and N. Kato, “Blockchain-based key management for heterogeneous flying ad hoc network,” IEEE Transactions on Industrial Informatics, vol. 17, no. 11, pp. 7629–7638, 2020.
[0107] The following comparison indicators were tested during the experiment:
[0108] UAV onboard blockchain data storage overhead: The embodiment of the present invention pursues lightweight UAV onboard storage overhead. Therefore, key indicators including the total storage overhead of the UAV cluster, the average storage overhead of the UAV node, the average block storage overhead and the UAV storage capacity are compared with various comparison schemes, which objectively reflects the superiority of the embodiment of the present invention in terms of storage overhead and storage capacity.
[0109] UAV data access latency: The embodiment of the present invention pursues the low latency requirement of the UAV data solution. This is because the high real-time performance of data access needs to be ensured when executing the UAV cluster task. A large data access latency will make it difficult for the UAV to quickly access the data required for task execution, which ultimately leads to a significant reduction in the task execution efficiency of the entire UAV cluster. Therefore, the data access latency of the embodiment of the present invention was tested.
[0110] Robustness of drone data storage system: The embodiment of the present invention pursues highly reliable drone shared data storage, which means that even if some drones fail due to natural factors (such as bird strikes) or human factors (such as electromagnetic attacks) during flight, other normal drones can still efficiently access shared data on the blockchain to ensure successful mission execution. Therefore, under the same storage overhead and different drone failure probabilities, the drone data access success rate of the embodiment of the present invention and the comparative solution was tested.
[0111] The experimental results are as follows:
[0112] (1) Drone onboard blockchain data storage overhead
[0113] See also Fig. 9 and Fig.10 As shown, in the full copy storage mode, since each drone needs to store the same blockchain ledger data, the total storage overhead of the drone cluster and the average storage overhead of the drone node will increase sharply with the increase of the block height. The ODOB and AirBC solutions prune the blockchain data, so their storage overhead is also significantly lower than the full copy. However, as mentioned above, since only a small number of full nodes with stronger capabilities save the complete blockchain data after pruning, this solution reduces the data availability of the drone cluster. The total storage overhead and average storage overhead of the embodiment of the present invention increase slowly with the increase of the block height, reducing the storage overhead by about 85% compared with the full copy mode and reducing the storage overhead by about 53% compared with AirBC.
[0114] In addition, experiments were conducted to examine the impact of changes in the number of cluster nodes, testing the average storage overhead of blocks and the storage capacity of the cluster under different storage schemes. Fig.11 As shown in the figure, as the number of nodes continues to increase, the average block storage overhead of the full copy storage mode increases linearly. Although the average block storage overhead of the ODOB and AirBC solutions is lower than that of the full copy mode, the average block storage overhead still gradually increases with the increase of node data. This is because these comparison schemes do not take into account the factor of node scale, which leads to poor scalability. The average block storage overhead of the embodiment of the present invention is only related to the coding coefficient and has nothing to do with the scale of the drone cluster, so it has better scalability. Fig.12As shown, it is assumed that the storage space of each drone device is 500MB and the size of a single block is 1MB. Since in the above comparison scheme, the storage capacity of the drone cluster is only positively correlated with the storage capacity of a single drone, no matter how large the cluster size is, the number of blocks that can be stored remains constant. Since the ODOB and AirBC schemes adopt a trimming strategy, the cluster storage capacity is stronger than the full copy method. The storage capacity of the embodiment of the present invention increases with the increase of the cluster size. In the case of 50 nodes, the storage capacity is about 4 times that of the AirBC scheme.
[0115] Then, by adjusting the RS encoding parameters, lower storage overhead and stronger storage capacity can be obtained. Define the proportional coefficient λ as the ratio of k to n. As the block height increases, the average storage overhead of the drone node under different λ is as follows: Fig.13 As shown in the experimental results, it can be seen that the average storage overhead of the drone node decreases as λ increases. This is because the larger λ is, the smaller the size of a single encoded data block is. Similarly, Fig.14 As shown in Figure 2, as the cluster size continues to increase, the storage capacity of the system also increases with λ.
[0116] (2) UAV data access latency
[0117] Although erasure coding technology has brought great advantages in storage overhead compared with existing solutions, it also causes large data access delays in wireless environments. Fig.15 As shown in the figure, the reading delays of different encoding parameters were set based on the existing erasure code technology in the UAV self-organizing network environment, where λ was set to 0.6, 0.7, and 0.8 respectively; from the experimental results, it can be seen that the average data access delay of the UAV will increase with the increase of λ. This is because the erasure code technology needs to obtain the erasure code encoded chunk data from at least K UAVs to read data. As λ increases, the threshold of data recovery will gradually increase. Therefore, more data transmission processes are required when the UAV reads data, which ultimately leads to a larger reading delay.
[0118] In order to solve the problem of high access latency caused by the original erasure coding scheme, the embodiment of the present invention designs a cache replacement algorithm based on reinforcement learning to reduce the negative impact of erasure coding technology. For the process of drone blockchain data access, the average access latency of drone data of the original erasure coding scheme and the embodiment of the present invention is compared. The results are as follows: Fig.15 As shown in . It can be seen from the experimental results that the average access delay of the drone cluster is reduced by about 77%-84% compared with the original erasure coding scheme that does not use the cache replacement algorithm, and is reduced by about 16-27% compared with the above cache replacement algorithm, which proves that the embodiment of the present invention achieves the effect of improving the cache hit rate and reducing the access delay.
[0119] (3) Robustness of UAV data storage system
[0120] In the experiment, it is assumed that there are 10 drones in the environment, and appropriate parameters are selected to keep the storage overhead of the three schemes consistent. Specifically, it is assumed that there are 1000 blocks in the current blockchain network, each of which is 1MB in size. λ is 0.5, so the total storage overhead is 2000MB. In order to ensure the same storage overhead, it is assumed that there are 2 full nodes in the light node scheme, and there are 5 shards in the sharding scheme, with 2 nodes in each shard. The experimental results are shown in Figure 2. Fig.16 shown.
[0121] It can be seen from the experimental results that as the failure rate of drone nodes increases, the data access success rate of drone clusters is constantly decreasing. Among them, the light node solution relies on the leader drone to provide routing and full-node data storage functions. If the leader drone fails, it will directly lead to the problem that other drones cannot access data, so its data access success rate is low. The sharding solution does not require full node support, so its data access success rate is higher than that of the light node solution. However, as the failure rate increases, when the failure rate of a single drone exceeds 50%, its data access success rate will be lower than that of the light node solution. This is because the number of drones in a single shard is small, and any single shard failure will cause the problem of inaccessible data. When the failure rate of drone nodes is low, the data access success rate of the embodiment of the present invention is close to that of the shards. As the failure rate of drone nodes increases, the data access success rate of the embodiment of the present invention is significantly higher than that of other comparative solutions. This is because only the number of coded data blocks that meet the threshold number needs to be accessed to restore the block, so a higher node failure rate can be tolerated.
[0122] An embodiment of the present invention also provides a drone device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus, and the memory is used to store computer programs; the processor is used to execute the program stored in the memory to implement the method steps described in any of the above-mentioned methods for reliable sharing of drone self-organizing network data based on lightweight blockchain.
[0123] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not represent that there is only one bus or one type of bus.
[0124] The communication interface is used for communication between the above electronic device and other devices.
[0125] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0126] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0127] The present invention also provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps described in any of the above-mentioned methods for reliable sharing of drone self-organizing network data based on lightweight blockchain are implemented.
[0128] Optionally, the computer-readable storage medium may be a non-volatile memory (NVM), such as at least one disk memory.
[0129] Optionally, the computer-readable memory may also be at least one storage device located away from the aforementioned processor.
[0130] In another embodiment of the present invention, a computer program product comprising instructions is also provided. When the computer is run on a computer, the computer executes the method steps described in any of the above-mentioned methods for reliable sharing of drone self-organizing network data based on lightweight blockchain.
[0131] It should be noted that, for the device / electronic device / storage medium / computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0132] The terms "first", "second", etc. are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the numbers used in this way are interchangeable where appropriate so that the embodiments of the disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure.
[0133] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification.
[0134] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art can understand and implement other changes to the disclosed embodiments by viewing the drawings and the disclosed content. In the description of the present invention, the term "comprising" does not exclude other components or steps, "one" or "an" does not exclude multiple situations, and the meaning of "multiple" is two or more, unless otherwise clearly and specifically limited. In addition, certain measures are recorded in different embodiments, but this does not mean that these measures cannot be combined to produce good results.
[0135] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices (equipment), or computer program products. Therefore, the present application may adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware, which are collectively referred to as "modules" or "systems" herein. Moreover, the present application may adopt the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program codes. The computer program is stored / distributed in a suitable medium, provided together with other hardware or as a part of hardware, or may adopt other distribution forms, such as by Internet or other wired or wireless telecommunication systems.
[0136] The present application is described with reference to the flowcharts and / or block diagrams of the methods, apparatuses (devices) and computer program products of the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0137] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0139] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A reliable sharing method for drone self-organizing network data based on lightweight blockchain, characterized in that: A drone used in a drone self-organizing network; the drone self-organizing network realizes data sharing based on blockchain, and the method includes: When a block is verified by consensus, the block is cached in a cache area of a preset size, and the block header of the block is stored locally; the block body data of the block is erasure coded according to the erasure code encoding parameters notified by the ground control station to obtain a coding matrix; the corresponding coded data block is selected from the coding matrix and stored locally; When the drone is a block-generating drone, it collects the status data of all drones in the network; based on the collected status data, it uses the pre-trained BDQN model to simulate the Markov process to predict the combination of cache replacement actions of each drone; and broadcasts the combination; When the drone obtains the combination, it selectively replaces the blocks in the cache area according to the cache replacement action corresponding to itself in the combination; When the on-chain data that the drone wants to access is located in the target block, and the target block is not in the cache space, the target block is acquired or restored by interacting with other drones.
2. The method according to claim 1, characterized in that When the on-chain data that the drone wants to access is located in the target block, and the target block is not in the cache space, the target block is acquired or recovered by interacting with other drones, including: When the on-chain data that the drone wants to access is located in the target block, and the target block is not in the cache space, a data access request is broadcasted so that other drones that have the target block cached can feed back the target block; When the data access request times out and is not responded to, broadcast a data recovery request so that other drones can feedback their respective stored coded data blocks; According to the encoded data blocks stored by itself and fed back by other drones, the target block is restored using the erasure code decoding rules.
3. The method according to claim 1 or 2, characterized in that: The size of the cache area does not exceed 100MB.
4. The method according to claim 1, characterized in that: The BDQN model includes: a feature extraction network, a state value network, a first action branch network, a second action branch network and an action decision network; The feature extraction network is used to extract drone state features from a state data matrix; wherein the state data matrix is constructed by the block-generating drone based on the collected state data; The state value network is used to calculate the state value matrix according to the state characteristics of the drone; The first action branch network is used to calculate first prediction information representing the swap-out block height of all drones in the network according to the drone state characteristics; The second action branch network is used to calculate second prediction information representing the height of the swapped-in block of all drones in the network according to the drone state characteristics; The action decision network is used to decide the optimal combination of cache replacement actions of all drones in the network based on the state value matrix, the first prediction information and the second prediction information using a predefined global reward function.
5. The method according to claim 4, characterized in that The global reward function is: Among them, α is the preset weight factor, N is the number of drones in the drone ad hoc network, and HT i Indicates the drone id i The number of cache hits, where the cache hit means that the data to be accessed by the drone is stored locally; Indicates the drone id i The state parameter at time t, RCES t+1 Indicates the drone id i The state parameters at time t+1 are: Where E i Indicates the drone id i Current power consumption, RD i Indicates the drone id i The current average latency for accessing on-chain data, C i Indicates the drone id i Current storage cost; R(s t+1 ,s t |a t ) represents the state s of the UAV ad hoc network at time t t The cache replacement action combination a is executed t After that, at time t+1, it switches to state s t+1 The benefits brought by a single drone id i The state s is defined as s i ={RD i ,HT i ,CB i ,E i ,C i } i∈N , where CB i Indicates the drone id i The height set of the current locally stored block, a single drone id i The cache replacement action is defined as a i =(A1 i ,A2 i ) i∈N , where A1 i Indicates the drone id i The current swapped out block height, A2 i Indicates the drone id i The current swap-in block height.
6. The method according to claim 1, characterized in that The block header of the blockchain is stored locally by the drone in a chained manner; The block header of the blockchain includes: the previous block hash, the current block hash, the block generation time and the Merkle root hash; The block body of the blockchain includes: transaction hash, transaction generation time, transaction initiator ID, transaction data, and digital signature of transaction data; wherein, the transaction is data encapsulated in the form of a transaction and needs to be shared within the drone self-organizing network.
7. The method according to claim 6, characterized in that The block-generating drone uses the Keccak algorithm as the hash algorithm used when generating blocks.
8. The method according to claim 7, characterized in that The data length output by the hash algorithm is 224 bits.
9. The method according to claim 6, characterized in that The block-generating drone uses the ZSS short signature algorithm as the signature algorithm used when generating blocks.
10. The method according to claim 1, characterized in that The erasure coding of the block volume data of the block according to the erasure coding parameters notified by the ground control station to obtain a coding matrix includes: Reed-Solomon encoding is performed on the block body data of the block according to the erasure code encoding parameters notified by the ground control station to obtain a coding matrix.
Citation Information
Patent Citations
Block chain domain name resolution-oriented erasure code low-overhead storage system and method
CN114047878A
Stateless block chain enabled task-oriented unmanned aerial vehicle network mutual authentication method
CN114630322A