A data sharing incentive method based on DAG structure blockchain empowerment in fog computing
By introducing a DAG-structured blockchain and an improved Conflux consensus mechanism into fog computing, combined with a Stankovsky game incentive mechanism, the security and reliability issues of data sharing in fog computing are solved, achieving efficient resource allocation and improved data quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-06
- Publication Date
- 2026-03-27
AI Technical Summary
Existing data sharing strategies cannot provide sufficient security and reliability in fog computing. Malicious devices may distort data, and blockchain methods based on single-chain structures suffer from low business throughput, high block formation costs, and high consensus latency, resulting in poor data quality obtained by devices.
A DAG-structured blockchain is adopted, combined with an improved Conflux consensus mechanism and a two-stage Stankovsky game incentive mechanism. By having fog nodes and devices collaboratively form blocks, a mixed-integer linear programming problem is established. Greedy search and iterative resource allocation and pricing algorithms are used to optimize the efficiency of fog nodes and devices.
It improved network security and blockchain throughput, reduced resource consumption, enhanced the security and reliability of data sharing, optimized the revenue of fog nodes and devices, and improved data quality.
Smart Images

Figure CN115170190B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of blockchains and relates to a data sharing incentive method based on a DAG structure blockchain in fog computing. BACKGROUND
[0002] In order to alleviate the burden of traditional cloud computing data centers, fog computing emerges as a complementary solution to support geographically distributed, delay-sensitive and QoS (Quality of Service, QoS) aware Internet of Things applications. Fog computing is initially proposed by Cisco, aiming to extend cloud computing to the edge of the network. The term fog is used because fog is a cloud close to the ground, that is, computing from the core to the edge, supporting refinement and better applications or services. Among them, the transmission data storage and local data analysis are executed on the fog nodes, and the permanent storage and global analysis are executed on the cloud. Fog computing owns computing, storage and network resources, which can support new services and applications, and users can access services and applications by renting facilities and resources provided by fog nodes.
[0003] It is predicted that the number of smart connected devices (such as smartphones, wearable devices, self-driving cars / drones, etc.) will grow exponentially to 75 billion by 2025, and a large amount of data will be generated by these devices. Data is becoming more and more closely related to people's lives, and its potential value is increasingly prominent. Data is no longer a symbol in a storage medium, but an important resource. After mining and analyzing seemingly unrelated data, its value can be greatly improved. Effective sharing of data is the basic link to fully utilize data. Fog computing provides a platform for data sharing between mobile devices. Existing data sharing strategies improve the quality of data to some extent, but cannot provide sufficient security and reliability. Malicious devices can distort the understanding of data or spread misleading knowledge. Although the data sharing method based on single-chain structure blockchain can eliminate the influence of malicious devices to a great extent, it is accompanied by too low business throughput, too high block cost and higher consensus delay while improving security. Lower blockchain system throughput will also lead to low data quality obtained by devices, such as insufficient freshness and obtaining outdated information.
[0004] Based on the above problems, the application designs a method to encourage users to actively participate in positive data sharing. First, the blockchain based on the directed acyclic graph structure is integrated into the fog network, and an improved Conflux consensus mechanism is proposed, which can improve the network security and the throughput of the blockchain. Secondly, in order to better utilize network resources and reduce the impact of resource consumption caused by the proof of work (Power of Work, PoW) on the deployment of the blockchain in the fog network, an incentive mechanism for device and fog node cooperation is proposed, and a two-stage Steinberg model is established to maximize the benefit function of the fog node and the block device, and the benefits of both the fog node and the device are optimized. Then, the resource allocation and pricing problem between the fog nodes is modeled as a mixed integer linear programming problem, and a resource allocation and pricing algorithm (Computing Resource Provider, CRP) based on greedy search and iteration is proposed to reduce the resource sharing cost of the fog node and improve the income of the fog node. SUMMARY
[0005] Therefore, the purpose of the application is to provide a data sharing incentive method enabled by DAG structure blockchain in fog computing.
[0006] To achieve the above purpose, the application provides the following technical solutions:
[0007] A data sharing incentive method enabled by DAG structure blockchain in fog computing, the method comprising the following steps:
[0008] S1: a directed acyclic graph (DAG) structure blockchain block system model based on fog computing;
[0009] S2: an improved Conflux consensus mechanism;
[0010] S3: an incentive mechanism based on a two-stage Steinberg game;
[0011] S4: a resource allocation and pricing algorithm based on greedy search and iteration.
[0012] Optionally, in the S2, an improved Conflux consensus protocol, i.e. an ordering protocol, is proposed, which converts the structure of DAG into a linear chain to process all transactions on the branches; it is divided into two processes, dynamic weight distribution and greedy traversal; in the improved Conflux consensus mechanism, dynamic weight is used to reflect the real-time account state, including throughput; before greedy traversal, the mechanism assigns a corresponding dynamic weight to each vertex.
[0013] Optionally, in the S2, a greedy traversal algorithm is proposed to confirm the main chain; a breadth-first search strategy is adopted, starting from the genesis block, and the weight values of the vertices are compared level by level; for multiple vertices at the same level, the vertex with the maximum weight value is selected as the starting point of the next level, and the traversal is performed in turn, and finally the main chain is determined.
[0014] To determine the order of transactions on the blockchain, first, the main chain is determined according to the dynamic weight distribution and greedy search traversal, and each block on the main chain is responsible for an Epoch, and the blocks that can be reached by this block belong to this Epoch; then, different Epochs are sorted, and the blocks in the same Epoch are sorted according to the preference relationship, and if there is no partial order relationship among the blocks in the same Epoch, the blocks are sorted according to the size of the Hash.
[0015] Optionally, in the S3, the fog node obtains income by sharing computing resources, and the device obtains additional computing resources from the fog node to mine blocks and obtain returns; the resource allocation and pricing algorithm CRP sets the price of each unit of computing resources, and the block device decides the amount of resources purchased from the CRP according to the price;
[0016] Let x i represent the computing needs of device i∈N, i.e. the amount of computing resources purchased from the CRP, and also consider the initial computing capacity l i of device i; the total computing capacity of the block device is:
[0017]
[0018] The block device i has a relative computing capacity relative to the total computing capacity of all devices, and its expression is as follows:
[0019]
[0020] Where x -i represents the computing needs of other block devices except device i; users compete with each other to solve the PoW puzzle in the block game and obtain the corresponding block reward; the probability of the success of the block of user i is represented as:
[0021]
[0022] Where t i represents the block size mined by user i, i.e. the number of transactions contained in the block; Isolated probability; in the traditional single-chain structure, the isolated probability of a block is the probability that a user i finds a valid block and is discarded because the block contains more transactions and the verification delay is longer, resulting in not being the first block; the block chain with DAG structure is different from the traditional single-chain block chain in that the blocks on the side chain are also considered valid, and there is no isolated probability of blocks in the improved consensus mechanism; the principle of confirming the block order first and then confirming the transaction order is adopted, and only the first transaction is recognized when there is a double-spend or conflict transaction, and the rest is discarded, and there is a data validity probability Assuming Poisson distribution, The reward obtained by the user for successfully mining a block is rewritten as:
[0023]
[0024] The block reward consists of a fixed reward R and a variable reward r;
[0025] In the interaction process between CRP and chunking device, CRP determines the price according to the user's request, and the chunking device responds to the price by deciding the size of the computing resources to be purchased; these two events occur continuously; therefore, the interaction between CRP and chunking device can be formalized as a Stackelberg game with a leader and multiple followers, where the leader is CRP and the followers are chunking devices.
[0026] Optionally, in the S4, the user can always determine the optimal purchase quantity after the CRP gives the resource pricing, and by setting the resource configuration between the fog nodes, the resource request of each user is allocated to the fog nodes, so that the cost of the CRP is minimized; setting the price of each unit of computing resource affects the number of computing resources purchased by the user, so that the revenue of the CRP is maximized; the revenue function of the CRP is defined as follows, subject to the following constraints:
[0027]
[0028] s.t.C1:p>0
[0029] C2:
[0030] C3:
[0031] C4:h i.j ∈{0,1} (5)
[0032] Wherein, the constraint condition C2 indicates that when the fog node shares the computing resource to the users, it cannot be overloaded, the constraint condition C3 determines that the computing resource requested by a user is provided by only one fog node, the constraint condition C4 indicates the mapping relationship between the user and the fog node, in the CRP subgame, the CRP realizes the profit maximization by determining the price of the computing resource and selecting the fog node running the user offloaded task, since p>0, h i.j ∈{0,1}, the profit maximization problem of the CRP is a nonlinear integer programming problem and cannot be directly solved, the resource allocation and pricing algorithm of the greedy search and iteration is proposed to solve the profit optimization problem of the CRP, and the problem includes two subproblems: the resource allocation problem based on the optimal purchase resource amount of the user and the resource pricing problem under the given resource configuration.
[0033] The beneficial effects of the present application are:
[0034] Other advantages, objects, and features of the present application will be apparent to those skilled in the art from the following specification, which is to be taken in conjunction with the accompanying drawings, or can be learned from the practice of the application. The objects and other advantages of the present application can be achieved and attained by the structure particularly pointed out in the specification. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to make the objects, technical solutions and advantages of the present application clearer, the preferred detailed description of the present application will be combined with the drawings, wherein:
[0036] Figure 1 For a directed acyclic graph-based blockchain structure;
[0037] Figure 2 For a directed acyclic graph structure blockchain chunking system model in fog computing;
[0038] Figure 3 For a two-stage Stakolberg game model. DETAILED DESCRIPTION
[0039] The embodiments of the present application will be described in detail below with specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the disclosure of the specification. The present application can also be implemented or applied in different specific embodiments, and the details in the specification can be modified or changed based on different views and applications without departing from the spirit of the present application. It should be noted that the diagrams provided in the following examples only illustrate the basic concept of the present application in a schematic manner, and the following examples and features in the examples can be combined with each other without conflict.
[0040] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0041] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0042] Figure 1 This paper describes a blockchain data structure based on a directed acyclic graph (DAG), where the basic unit is the block, and each block contains different transactions. Green blocks constitute the main chain, blue blocks constitute the side chains, and gray blocks are unverified blocks. Before being added to the chain, each new block is bound to two previous blocks (parent block and referenced block) using the Proof-of-Work (PoW) algorithm to form a DAG blockchain structure. Let H(·) represent the hash function, and the process of executing the PoW algorithm to form a block can be described as follows:
[0043] output = H(parent block hash || referenced block hash || nonce) ≤ target (6)
[0044] The block target is predefined, and the nonce is a random number. If the output of the hash function satisfies the requirement of a minimum length with a prefix of zero, it means that the user has found a valid nonce and has the right to produce a block. A DAG-based blockchain structure consists of the following elements:
[0045] Vertex: A block is called a vertex. Tips refers to vertices with an in-degree of 0.
[0046] Edge: Represents the reference relationship between two vertices. For example, after a user creates block G, the prehash is filled with the hash values of two Tips (parent block hash and referenced block hash).
[0047] Parent edge (solid line): The parent edge, also known as the voting edge, points to the current main chain ( Figure 1Tips (the green chain in the middle). Since users select the main chain based on the improved Conflux mechanism, the parent edge can be seen as the current block verifying the pointed-to Tip, equivalent to a vote of approval. Except for the genesis block, each block has one and only one parent edge, for example... Figure 1 From D to C, E to B;
[0048] Reference edge (dashed line): The reference edge points to the current sidechain ( Figure 1 Tips for the blue chain: Each block can have multiple reference edges, representing the chronological order in which the blocks were created, such as from E to C;
[0049] Epoch: In this parent tree, a main chain is selected from the genesis block to the leaf blocks. The selection of the main chain uses an improved Conflux consensus algorithm. Each block on the main chain is responsible for one Epoch, and the blocks reachable by this block belong to this Epoch.
[0050] Figure 2 This paper describes a DAG-based blockchain block-forming system in fog computing. The first box shows the process of adding transactions to the DAG-based blockchain structure. Some terminal devices are equipped with sensors to collect information about their surroundings. Transactions here refer to the exchange of information between devices, such as data summaries, data interest packets, and data request packets in data sharing. Devices act as users, collecting transactions and participating in the competition to package blocks to earn rewards. The consensus mechanism used in this structure retains the security advantages of Proof-of-Work (PoW), requiring hash work to prove the creation of any block.
[0051] In this network, a group of devices, denoted as N = {1,...,N}, collects transactions and acts as block-forming devices (also called users), participating in the competition to package blocks and earn rewards. Since most devices have limited resources and cannot directly perform proof-of-work, the application of DAG-based blockchains in the Internet of Things (IoT) is somewhat limited. Therefore, multiple fog nodes, denoted as M = {1,...,M}, collectively form a computing resource provider, working collaboratively to provide computing resources to block-forming devices for a fee. Block-forming devices can access fog nodes to obtain computing resources and earn rewards by mining blocks. The second box shows the DAG-based blockchain structure. Devices and fog nodes collaborate to generate blocks, forming a DAG-structured blockchain.
[0052] Figure 3A two-stage Stackelberg game model is described. In the interaction between the CRP and the block assemblies, the CRP determines the price based on user requests, and the block assemblies respond to the price by deciding the amount of computing resources they purchase. These two events occur sequentially. Therefore, the interaction between the CRP and the block assemblies can be formalized as a Stackelberg game with one leader and multiple followers, where the leader is the CRP and the followers are the block assemblies. This game consists of two subgames, divided into two stages: 1) In stage 1, the leader, i.e., the CRP, determines the price p per unit of computing resource and decides the resource allocation based on the user's resource purchase amount; 2) In stage 2, the users, knowing the CRP's price, decide their optimal amount of computing resources to purchase.
[0053] Using backward induction, formulate the following optimization problem for leaders and followers:
[0054] Phase Two: User Resource Purchasing Strategy: Given the CRP pricing and the purchasing strategies of other users, users determine their computing service needs to maximize their expected revenue. User revenue is defined as:
[0055]
[0056] The user's subgame problem can be written as follows:
[0057] Problem 1 (User Subgame):
[0058]
[0059] Phase One CRP Resource Strategy: CRP revenue is obtained by subtracting service costs from the computing service fees charged to users. Service costs are related to the energy consumed by fog nodes running hash functions and the data transfer costs between users and assigned fog nodes. Different fog nodes have different energy consumption per unit of computing resources. Data transfer costs are determined by the distance between the user and the fog node. For executing user i's task, the service cost of the fog node is defined as:
[0060] c i =h i,j (a j x i +ηd i,j (9)
[0061] Where h i,j When user i's task is assigned to fog node j, h ∈{0,1} i,j =1; otherwise h i,j =0; User i's task is assigned to one and only one fog node. CRP determines price and resource allocation within the policy space to maximize revenue. The revenue of CRP is defined as:
[0062]
[0063] Problem 2 (Subgames of CRP):
[0064]
[0065] Problem 1 and Problem 2 together constitute a Stackelberg game. The goal of the game is to find a Stackelberg equilibrium. At this equilibrium, neither the leader nor the follower wants to change their strategies. A Stackelberg equilibrium can be defined as:
[0066] Definition 1: p * and x * Let CRP and the user's optimal strategy be represented respectively. If (p) * ,x * (p) satisfies the following two conditions, * ,x * ) is the Stackelberg equilibrium point:
[0067] u csp (p * ,x * )≥u csp (p,x * )and in
[0068] 1. Analyze the user's subgame.
[0069] After the CRP sets the unit price of computational resources, all users dynamically adjust their resource purchasing strategies to compete with other users for maximum profit until a Nash equilibrium is reached. The users' resource purchasing strategies are modeled as a non-cooperative game (NCG), g = {N, {x} i} i∈N ,{u i} i∈N The description is as follows:
[0070] Players: Each user is a player, and there are N users in this network;
[0071] Action: User i selects the resource purchase strategy x i ;
[0072] Utility function: User i's personal benefit u i (x i ,x -i ,p).
[0073] Next, we proved the existence and uniqueness of Nash equilibrium in non-cooperative games among users.
[0074] Theorem 1: NCGg={N,{x i} i∈N ,{u i} i∈N A Nash equilibrium exists.
[0075] Proof: The policy space set is defined as x i ∈[x - ,x - ], where x - The minimum resource purchase amount for a user, x - This represents the maximum amount of computing resources that CRP can provide. As can be seen from Equation 7, u i In [x - ,x - The expression is continuous. Next, we need to find the expression for x in equation 7. i The first and second derivatives are as follows:
[0076]
[0077]
[0078] because So u i Regarding x i The second derivative of u is less than 0. i It's about x i A convex function. NCGg={N,{x i} i∈N ,{u i} i∈N There exists a Nash equilibrium.
[0079] Q.E.D.
[0080] Theorem 2: NCGg={N,{x i} i∈N ,{u i} i∈N The Nash equilibrium of} is unique.
[0081] Proof: Based on the first derivative (12), by setting the first derivative to 0, we can obtain the optimal response function for user i.
[0082]
[0083] By solving the above equation, we have The best strategy for user i Expressed as follows:
[0084]
[0085] where Function F i (x) is positive, monotonic, scalable, and a standard function. Thus, g = {N, {x i} i∈N , {u i} i∈N} has a unique Nash equilibrium solution.
[0086] Theorem 3: The unique Nash equilibrium of user i in g is:
[0087]
[0088] Proof: By the first order derivative of equation (15) with respect to x i is 0, we have:
[0089]
[0090] For convenience, we have:
[0091]
[0092] The sum of equation (15) for all users is as follows:
[0093]
[0094]
[0095] Therefore, Substituting (16) into (18) gives:
[0096]
[0097] By simple transformation of the above equation, the Nash equilibrium of user i is:
[0098]
[0099] Based on the results of the non-cooperative game of users in the second stage, the leader, i.e., the CRP, optimizes the resource pricing strategy in the first stage to maximize the profit defined in equation (9). Substituting equation (20) into equation (8) gives:
[0100]
[0101] where,
[0102] Theorem 4: The above Stackelberg game has a unique equilibrium point (x* * where x * * are the optimal strategies of the user and CRP, respectively.
[0103] Proof: According to Theorem 1, when the price of each unit of computing resource is determined by the CRP, the user can always reach a Nash equilibrium. Analyzing the revenue function (21) of the CRP, the first and second order derivatives with respect to the variable p are calculated.
[0104]
[0105]
[0106] Because It is shown that the objective function is a strictly convex function with respect to p, and there exists an optimal price p * that maximizes the revenue of the CRP, and there exists a Stackelberg equilibrium (x * , p * ).
[0107] From the above analysis based on the Stackelberg game between the user and the CRP, it can be seen that the user can always determine the optimal purchase quantity after the CRP sets the resource pricing. By setting the resource configuration between the fog nodes, the resource requests of each user are allocated to the fog nodes, so that the cost of the CRP is minimized; setting the price of each unit of computing resource affects the number of computing resources purchased by the user, so that the revenue of the CRP is maximized. Therefore, how to determine the resource pricing and resource configuration of the CRP is very important. The revenue function of the CRP is defined as follows, which needs to satisfy the following constraint conditions:
[0108]
[0109] s.t.C1:p>0
[0110] C2:
[0111] C3:
[0112] C4:h i.j ∈{0,1} (24)
[0113] where constraint C2 means that the fog nodes cannot be overloaded when they share computing resources to users; constraint C3 determines that a user's request for computing resources is provided by only one fog node; and constraint C4 represents the mapping relationship between users and fog nodes. In the CRP subgame, the CRP maximizes its revenue by determining the price of computing resources and selecting fog nodes to run the users' offloaded tasks. Since p > 0, h i.j ∈{0,1}, the CRP's revenue maximization problem is a nonlinear integer programming problem that cannot be solved directly. Therefore, a resource allocation and pricing algorithm based on greedy search and iteration is proposed to solve the CRP's revenue optimization problem. The problem includes two subproblems: a resource allocation problem based on the optimal resource purchase amount of users and a resource pricing problem given the resource configuration.
[0114] The resource configuration problem determines which fog node allocates resources to which users according to the resource price and the users' resource purchase strategy, because different computing resource configurations determine different service costs of fog nodes. When the resource pricing of the CRP is given, the CRP's revenue problem is converted into an integer programming problem. Therefore, a resource configuration algorithm based on a greedy search method is proposed. First, a computing resource request list is created where According to the above formula (22), is the optimal resource purchase strategy of user i given the price of each unit of computing resources. Next, a revenue matrix V of N x M is created according to the interaction between fog nodes and users, N users, and M fog nodes. The goal of the resource configuration algorithm is to select an element from each row of the matrix V to maximize the sum of elements under the constraint C3.
[0115]
[0116]
[0117] On the basis of the V matrix, a cost-performance ratio matrix W is constructed, where the elements of the matrix are
[0118]
[0119] According to the mapping between fog nodes and users, a resource configuration matrix H of N x M is created, initialized as a 0 matrix
[0120]
[0121] If fog node j provides computing resources to user i, h ij = 1, otherwise h ij = 0. After the relevant matrices are constructed, a greedy strategy is used to select a largest element w N×M from the matrix W ijThis means selecting the user i with the highest cost-effectiveness and pairing it with the fog node j. Next, we analyze two cases: if the fog node j has resources c... j If the purchase demand of user i is greater than or equal to that of user i, then the computing resources required by user i will be provided by fog node j, and h will be used to purchase the cloud. ij Set to 1 and matrix W N×M Set the i-th row to 0. Update the remaining resources c of the fog node. j ,c' j =c j -x i Update the set of unserved users N' = (1,2,...,i'). If the resources of fog node j are less than the purchase demand of user i, it means that the current fog node j cannot provide enough resources for user i, and w ij Setting it to 0 means the resource configuration matrix H, remaining fog node resources, and unserved user sets do not need to be updated. This process continues until... Once the search is complete, meaning a resource provider has been found for all users, an element is selected from each row of matrix V to maximize the sum of the elements under constraint C3.
[0122] Resource pricing determines resource prices based on a specific resource allocation scheme. Given a resource price, a greedy search algorithm is used to determine the resource allocation scheme H, exploring an optimal resource price that maximizes CRP revenue. At this point, CRP revenue is related to the price per unit of computing resource and the quantity of computing resources sold. Excessively high prices will discourage users from purchasing computing resources; when the price exceeds a certain value p... max At that time, all users purchased 0 computing resources.
[0123] Given a resource allocation matrix H, h i,j Given the information, the optimization problem can be simplified to:
[0124]
[0125] stC1:p max >p>0 (29)
[0126] in τ i Let represent the fog node providing services to user i. The revenue function in the above equation is a convex function of resource prices given a resource allocation scheme. Therefore, a golden ratio search is used to find the optimal price p. This algorithm searches for the optimal price by iteratively narrowing the search range. First, the search range [left, right] is set to [σ, p]. max] In each iteration, the algorithm updates the search range with the golden ratio. Specifically, two points in the range are calculated, and by comparing the profits of the CRP at the left and right prices, it is determined whether the optimal price is [left, left + 0.618 * (right - left)] or [left + 0.382 * (right - left), right]. The search range reduction process continues until the interval of the search range is less than a predefined threshold δ. The algorithm outputs the middle value of the final search range as the price.
[0127] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solutions of the present application can be modified or replaced equivalently without departing from the purpose and scope of the technical solutions, which should be covered in the scope of the claims of the present application.
Claims
1.A method for data sharing incentive with DAG structure blockchain empowerment in fog computing, characterized in that: The method comprises the following steps: S1: a fog computing-based directed acyclic graph (DAG) structure block chain block system model; S2: an improved Conflux consensus mechanism; S3: an incentive mechanism based on a two-stage Steinberg game; S4: a resource allocation and pricing algorithm based on greedy search and iteration; In the S2, an improved Conflux consensus protocol, that is, an ordering protocol, is proposed, which converts the structure of the DAG into a linear chain, thereby processing transactions on all forks; the process is divided into two processes, dynamic weight distribution and greedy traversal; in the improved Conflux consensus mechanism, the dynamic weight is used to reflect the real-time ledger state, including the throughput; before greedy traversal, the mechanism assigns a corresponding dynamic weight to each vertex; In the S2, a greedy traversal algorithm is proposed to confirm the main chain; a breadth-first search strategy is used, starting from the genesis block, and the weight values of the vertices are compared level by level; for multiple vertices at the same level, the vertex with the maximum weight value is selected as the starting point of the next level, and the vertices are traversed in turn, and finally the main chain is determined; To determine the order of transactions on the block chain, first, the main chain is determined according to the dynamic weight distribution and greedy search traversal, and each block on the main chain is responsible for an Epoch, and the blocks that can be reached by the block belong to the Epoch; then, different Epochs are sorted, and the blocks in the same Epoch are sorted according to the preference relationship, and if there is no partial order relationship between the blocks in the same Epoch, the blocks are sorted according to the Hash size; In the S3, the fog nodes obtain income by sharing computing resources, and the devices obtain additional computing resources from the fog nodes to mine blocks and obtain returns; the resource allocation and pricing algorithm (CRP) sets the price of each unit of computing resource, and the block forming device decides the amount of resources purchased from the CRP according to the price; Let the computation required by a device denote the amount of computing resources purchased from the CRP, while taking into account the initial computing capacity of the device ; the total computing capacity of a chunked device is: (1) Chunking device There is a relative computing power with respect to the total computing power of all devices, expressed as follows: (2) wherein , represents the computational requirement of other block devices except the device ; users compete with each other to solve the PoW problem in the block game and obtain the corresponding block reward; the user The probability of block success is represented as: (3) wherein representing a user the size of the mined block, i.e. the number of transactions contained in the block; representing the isolated probability; in the traditional single chain structure, the isolated probability of a block is After finding an effective block, due to the large number of transactions contained in the block, the verification delay is long, which leads to the probability of being discarded instead of the first block; the block chain with DAG structure is different from the traditional single chain block chain, which considers the block on the side chain as effective, and there is no isolated probability of the block in the improved consensus mechanism; the principle of confirming the block order first and then confirming the transaction order is adopted, only the first transaction is recognized, and the rest is discarded, and there is a data effective probability , assuming that it is subject to Poisson distribution, ; the reward obtained by the user for successfully mining a block is rewritten as: (4) The chunk reward consists of a fixed reward and a variable reward In the interaction process between the CRP and the block forming device, the CRP determines the price according to the user's request, and the block forming device responds to the price by deciding the size of the computing resources to be purchased; the two events occur continuously; therefore, the interaction between the CRP and the block forming device can be formalized as a Stackelberg game with a leader and multiple followers, wherein the leader is the CRP and the follower is the block forming device; In the S4, the user can always determine the optimal purchase quantity after the CRP sets the resource pricing, and by setting the resource configuration between the fog nodes, the resource request of each user is allocated to the fog nodes, so that the cost of the CRP is minimized; setting the price of each unit of computing resource affects the number of computing resources purchased by the user, so that the income of the CRP is maximized; the revenue function of the CRP is defined as follows, and the following constraint conditions are met: (5) where the constraints indicate that the fog nodes cannot be overloaded when they share computing resources to users; constraints decide that a user's requested computing resource is provided by only one fog node; constraints indicate the mapping relationship between users and fog nodes; in the CRP subgame, the CRP maximizes its revenue by deciding the price of computing resources and selecting the fog nodes to run the users' offloaded tasks; since , the CRP's revenue maximization problem is a nonlinear integer programming problem that cannot be solved directly; a greedy search and iterative resource allocation and pricing algorithm is proposed to solve the CRP's revenue optimization problem; this problem includes two subproblems: a resource allocation problem based on the user's optimal purchase of resource quantity and a resource pricing problem given the resource configuration.
Citation Information
Patent Citations
Optimization task unloading method based on network delay and resource management
CN111010434A
Block chain of directed acyclic graph structure and implementation method thereof
CN113516557A