Iot resource sharing method, device, system, electronic device and storage medium

By using blockchain and greedy algorithms to optimize resource sharing in the Internet of Things (IoT), the trust and security issues of resource-constrained devices in the IoT are solved, and the revenue of resource nodes is maximized and network performance is improved.

CN115695474BActive Publication Date: 2026-06-19BEIJING UNIV OF POSTS & TELECOMM +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING UNIV OF POSTS & TELECOMM
Filing Date
2022-10-13
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In the Internet of Things (IoT), resource-constrained devices cannot effectively share resources, resulting in low network resource utilization, trust issues, lack of willingness to participate, and insecure resource transactions.

Method used

By publishing the task set of resource request terminals on the blockchain, calculating the benefits brought by each node to each resource, and using greedy algorithms and task allocation algorithms to optimize the unloading strategy, resource sharing is achieved in combination with blockchain smart contracts.

Benefits of technology

It maximizes the benefits of resource nodes, improves IoT performance, ensures the security and reliability of resource sharing, and enhances network resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695474B_ABST
    Figure CN115695474B_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, system, electronic device, and storage medium for resource sharing in the Internet of Things (IoT). The method includes: publishing a task set of resource-requesting terminals in a blockchain, the task set including task descriptions and the total resource value rewarded by the terminals to resource-providing nodes; calculating the benefit of each task to each resource-providing node based on the task descriptions and the total resource value rewarded by the terminals; summing the benefits of each resource-providing node under each offloading strategy, and selecting the resource-providing node with the maximum sum of benefits as the current task offloading terminal, thus obtaining the task offloading strategy for the IoT terminals. This invention maximizes the benefits of resource nodes while ensuring the task execution efficiency of ordinary IoT nodes, fully utilizing social resources and improving IoT performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet of Things (IoT) technology, and in particular to an IoT resource sharing method, apparatus, system, electronic device, and storage medium. Background Technology

[0002] In the Internet of Things (IoT), numerous resource-constrained devices support emerging applications by offloading high-demand computing tasks to edge servers. Given the resource constraints of IoT access nodes, managing network resources and maximizing their utilization is crucial. Fully utilizing idle social resources and sharing resources within the IoT is an effective solution for maximizing resource utilization. However, in the unreliable distributed IoT environment, resource sharing on edge servers faces challenges such as a lack of trust between devices, insufficient willingness to participate, and insecure resource transactions. These issues hinder resource sharing among IoT devices and reduce IoT performance. Summary of the Invention

[0003] This invention provides a method, apparatus, system, electronic device, and storage medium for sharing Internet of Things (IoT) resources, in order to solve the problem of low IoT performance caused by the lack of full utilization of social resources in existing technologies.

[0004] This invention provides an Internet of Things (IoT) resource sharing method, comprising:

[0005] The task set of resource requesting terminals is published on the blockchain. The task set includes a task description and the total resource value that the terminal rewards to resource providing nodes.

[0006] Calculate the benefits that the task brings to each resource-providing node based on the task description and the total resource value rewarded by the terminal to the resource-providing nodes;

[0007] The benefits of each resource provider node under each unloading strategy are summed, and the resource provider node in the unloading strategy corresponding to the maximum sum of benefits is taken as the unloading terminal of the current task.

[0008] According to an Internet of Things (IoT) resource sharing method provided by the present invention, the step of calculating the benefits brought to the resource-providing nodes by the task based on the task description and the total resource value rewarded to the resource-providing nodes by the terminal includes:

[0009] The task is to provide resource nodes re q Benefits

[0010]

[0011] Where I p,k p is the total resource value that the terminal rewards the resource-providing nodes. q,kF provides the first resource value for a node class that uses resources per unit time. p,k The second resource value of the blockchain used to trigger the smart contract to complete the task and record the transaction. Provides the time required for resource-type nodes to complete their tasks.

[0012] According to an IoT resource sharing method provided by the present invention, when the resource-providing node is a terminal resource sharing node, the method for calculating the time required for the resource-providing node to complete the task is as follows:

[0013]

[0014] in The transmission time includes both input data and return data. To account for transmission delay to the terminal, This is for calculating terminal latency.

[0015] According to the IoT resource sharing method provided by the present invention, the resource-providing node is an edge server, and the method for calculating the time required for the resource-providing node to complete the task is as follows:

[0016]

[0017] in, To reduce transmission latency to the edge server, Waiting latency for edge servers Calculate latency for edge servers.

[0018] According to an IoT resource sharing method provided by the present invention, the step of summing the benefits of each resource-providing node under each offloading strategy and taking the resource-providing node in the offloading strategy corresponding to the maximum sum of benefits as the current task offloading terminal includes:

[0019] Let X = {X1, X2, ... X} n}, where X i For IoT terminals d i The unloading strategies are then input into the target optimization model.

[0020] Solve the objective optimization model to obtain the resource-providing node corresponding to the maximum benefit;

[0021] Objective optimization model:

[0022]

[0023]

[0024]

[0025]

[0026]

[0027]

[0028]

[0029]

[0030] Among them, constraint C1 guarantees that the decision variables of the task are binary; constraint C2 guarantees that the computation of the task satisfies the time delay constraint; constraint C3 guarantees that a task can be assigned to at most one resource provider node for execution; C4 guarantees that the resource value occupied by the execution of resource provider nodes does not exceed the total resource value rewarded by the terminal to resource provider nodes; C5 guarantees that IoT terminal resources can provide services to at most one user in a time period; C6 guarantees that the expected benefit of the blockchain consensus node is greater than zero; C7 guarantees that the number of selected blockchain consensus nodes is the preset number v.

[0031] According to an Internet of Things (IoT) resource sharing method provided by the present invention, solving the objective optimization model includes:

[0032] The target optimization model is solved using a greedy algorithm-based task allocation algorithm and a task allocation and edge resource scheduling algorithm to obtain the resource providing node corresponding to the maximum benefit.

[0033] The present invention also provides an Internet of Things collaborative resource sharing device, comprising:

[0034] The publishing module is used to publish the task set of resource requesting terminals in the blockchain. The task set includes a task description and the total resource value that the terminal rewards to resource providing nodes.

[0035] The calculation module is used to calculate the benefits that the task brings to each resource-providing node based on the task description and the total resource value of the terminal reward given to the resource-providing nodes;

[0036] The output module is used to sum the benefits of each resource providing node and use the resource providing node with the maximum benefit as the current task unloading terminal.

[0037] This invention also provides an Internet of Things (IoT) collaborative resource sharing system, comprising:

[0038] Device layer, edge service layer, and blockchain;

[0039] The resource requesting terminals and resource providing terminals in the device layer, and the resource providing terminals in the edge service layer constitute the consensus nodes in the blockchain;

[0040] The resource requesting terminal in the device layer publishes a task to the blockchain, and the resource providing terminal in the device layer and / or edge service layer determines the current task unloading terminal based on the task description and the total resource value of the terminal reward to the resource providing node.

[0041] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the above-described Internet of Things resource sharing methods.

[0042] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described Internet of Things resource sharing methods.

[0043] The IoT resource sharing method, apparatus, system, electronic device, and storage medium provided by this invention publish a set of tasks from resource requesting terminals in a blockchain. The task set includes a task description and the total resource value awarded by the terminal to resource providing nodes. The benefits of each task to each resource providing node are calculated based on the task description and the total resource value awarded by the terminal. The benefits of each resource providing node under each offloading strategy are summed, and the resource providing node with the maximum sum of benefits is selected as the current task offloading terminal. This yields the task offloading strategy for IoT terminals, maximizing the benefits of resource nodes while ensuring the task execution efficiency of ordinary IoT nodes, fully utilizing social resources, and improving IoT performance. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0045] Figure 1 This is a flowchart illustrating the IoT resource sharing method provided by the present invention;

[0046] Figure 2 This is a flowchart of the consensus incentive points list construction process provided by the present invention;

[0047] Figure 3 This is a schematic diagram of the structure of the IoT collaborative resource sharing device provided by the present invention;

[0048] Figure 4 This is a schematic diagram of the architecture of the Internet of Things resource sharing system provided by the present invention;

[0049] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0051] like Figure 1 As shown, the IoT resource sharing method provided by the present invention includes:

[0052] Step 101: Publish the task set of resource requesting terminals in the blockchain. The task set includes, but is not limited to, task descriptions and the total resource value that the terminal rewards to resource providing nodes.

[0053] In this embodiment of the invention, it should be noted that in edge computing scenarios, because different resource nodes may deploy the same application, ordinary IoT terminal nodes may have multiple options when offloading tasks. Generally, IoT terminal nodes tend to offload to nearby resource nodes. Ordinary IoT terminals hope to complete task execution efficiently with minimal cost. Resource-providing nodes, on the other hand, aim to share resources externally as much as possible to generate revenue and utilize idle resources. Resource-sharing nodes include edge servers and other terminal nodes with idle resources. The purpose of this invention is to enable as many resource nodes as possible to participate in sharing their idle resources, as this effectively improves the utilization rate of idle social resources, realizes resource value, and provides end-users with more options, making terminal node business execution more efficient. Furthermore, the increased number of nodes strengthens the security of the blockchain system.

[0054] Step 102: Calculate the benefit that the task brings to each resource-providing node based on the task description and the total resource value awarded to resource-providing nodes by the terminal;

[0055] Step 103: Sum the benefits of each resource provider node under each unloading strategy, and take the resource provider node with the maximum sum of benefits as the unloading terminal for the current task.

[0056] In this embodiment of the invention, after obtaining the current task unloading terminal, task calculation and resource allocation of the Internet of Things resource sharing system can be realized.

[0057] The IoT resource sharing method provided by this invention publishes a set of tasks from resource requesting terminals in a blockchain. The task set includes a task description and the total resource value awarded by the terminal to resource-providing nodes. Based on the task description and the total resource value awarded by the terminal to resource-providing nodes, the benefit of each task to each resource-providing node is calculated. The benefits of each resource-providing node under each offloading strategy are summed, and the resource-providing node with the maximum sum of benefits is selected as the current task offloading terminal. This yields the task offloading strategy for IoT terminals, maximizing the benefits of resource nodes while ensuring the task execution efficiency of ordinary IoT nodes, fully utilizing social resources, and improving IoT performance.

[0058] Based on the above embodiments, in this embodiment, the benefits brought by the task to the resource-providing node are calculated according to the task description and the total resource value rewarded by the terminal to the resource-providing node, including:

[0059] The task is to provide resource nodes re q Benefits

[0060]

[0061] Where I p,k p is the total resource value that the terminal rewards the resource-providing nodes. q,k F provides the first resource value for a node class that uses resources per unit time. p,k The second resource value of the blockchain used to trigger the smart contract to complete the task and record the transaction. Provides the time required for resource-type nodes to complete their tasks.

[0062] F p,k It is positively correlated with the size of the task data volume and can be calculated as follows:

[0063]

[0064] in This refers to the amount of data for the task.

[0065] For IoT resource nodes: during a task allocation process, if d i The assigned task set is When terminal d p Unload the task to d i Execution involves tasks. d i Each application can serve at most one task, which can be arbitrary A i,k There can be at most one t p,k Correspondingly, d i Benefits RR di for

[0066]

[0067] For edge servers: Consider that an application on an edge server can match multiple terminal tasks. If the assigned task set is... Its elements are applications (Apps). k A set of tasks to be executed. Let... For s j Application App k The computation task set contains tasks. s j Benefits It can be calculated as

[0068]

[0069] In this embodiment of the invention, if the resource-providing node is a terminal resource-sharing node, the method for calculating the time required for the resource-providing node to complete the task is as follows:

[0070]

[0071] in The transmission time includes both input data and return data. To account for transmission delay to the terminal, This is for calculating terminal latency.

[0072] Analysis terminal d p Computation task t p,k Unload to IoT terminal resource node d i The time required to complete the task computation. Due to the limited service capacity of IoT resource terminals, when a computing terminal is currently engaged in a computing task, to ensure task execution performance, no further computing tasks are considered for it. Therefore, there is no queuing delay for task execution at IoT resource nodes. Overall latency of terminal resource services.

[0073]

[0074] in The transmission time includes both input and return data; computation task t p,k In terminal d p With node d i Transmission time cost It can be calculated as

[0075]

[0076] in and These are terminal nodes d.p to d i and d i to d p Data transfer rate between them. For d p and d i The distance between d and C is the signal propagation speed. Typically, the data returned after an IoT task completes is small, therefore the network transmission latency for this part can be ignored; only the distance from d is considered. p to d i The time it takes to send raw IoT data, therefore The calculation can be simplified as follows:

[0077]

[0078] For d p to d i computational task t p,k d i Resources will be provided to only one terminal node at a time, and its computation latency will be affected by d. i The computation latency is determined by the application configuration.

[0079]

[0080] Among them, A i,k For d i The computing power, A i,k =0 indicates that the application is not configured.

[0081] In this embodiment of the invention, if the resource provider node is an edge server, the method for calculating the time required for the resource provider node to complete the task is as follows:

[0082]

[0083] in, To reduce transmission latency to the edge server, Waiting latency for edge servers Calculate latency for edge servers.

[0084] Edge servers possess more computing resources, allowing a single application to serve multiple users. (User d) l Select mode 1, and assign task t l,k Offload to edge server j Place.

[0085] The edge server is configured near the base station. Assuming the edge server and base station are in the same location, the data transmission latency between them is zero. The transmission latency of the terminal task is:

[0086]

[0087] The waiting time of a task at the edge server mainly consists of two parts: the remaining processing time of the currently executing task. Processing time of all tasks in the queue

[0088] The time cost for an edge server to perform a computing task can be calculated as follows:

[0089]

[0090] in Apps assigned to computing tasks k The proportion of resources.

[0091] Based on the content of any of the above embodiments, in this embodiment of the invention, the benefits of each resource-providing node under each unloading strategy are summed, and the resource-providing node in the unloading strategy corresponding to the maximum sum of benefits is taken as the current task unloading terminal, including:

[0092] Let X = {X1, X2, ... X} n}, where X i For IoT terminals d i The unloading strategies are then input into the target optimization model.

[0093] Solve the objective optimization model to obtain the resource-providing node corresponding to the maximum benefit;

[0094] Objective optimization model:

[0095]

[0096]

[0097]

[0098]

[0099]

[0100]

[0101]

[0102]

[0103] Among them, constraint C1 guarantees that the decision variables of the task are binary; constraint C2 guarantees that the computation of the task satisfies the time delay constraint; constraint C3 guarantees that a task can be assigned to at most one resource provider node for execution; C4 guarantees that the resource value occupied by the execution of resource provider nodes does not exceed the total resource value rewarded by the terminal to resource provider nodes; C5 guarantees that IoT terminal resources can provide services to at most one user in a time period; C6 guarantees that the expected benefit of the blockchain consensus node is greater than zero; C7 guarantees that the number of selected blockchain consensus nodes is the preset number v.

[0104] Ω in the optimization model M +Ω R Expandable to:

[0105]

[0106] in The total blockchain resource usage value generated by executing all tasks in task set T can be represented by reward points, which are generated together with the blockchain. Same, that is Therefore, the extended P1 is obtained as

[0107]

[0108] stC1,C2,C3,C4,C5,C6,C7

[0109] Problem P1 can be decomposed into a two-level optimization problem, including a global variable Min that appears in all constraints, and a local decision variable X that appears only in some constraints and the objective. Therefore, problem P1 can be decomposed into two subproblems: the primal problem and the master problem.

[0110] Primal's problem: Given a fixed variable Min, we get...

[0111]

[0112] stC1,C2,C3,C4,C5

[0113] Master Question:

[0114]

[0115] stC5,C6

[0116] By selecting a fixed set of consensus nodes to make the minimum decision, the Primal problem is a task matching problem, which involves matching suitable resources to each IoT terminal task. Decomposing the original problem into the Primal problem and the Master problem does not affect the optimal solution of the original problem.

[0117] In this embodiment of the invention, solving the target optimization model includes: solving the target optimization model using a task allocation algorithm based on a greedy algorithm and a task allocation and edge resource scheduling algorithm to obtain the resource providing node corresponding to the maximum benefit.

[0118] 1) Task allocation algorithm based on greedy algorithm

[0119] Given the decision variable Min, which represents the set of consensus nodes, the set of service resource nodes can be determined. At this point, P2′ can be written as...

[0120]

[0121] stC1,C2,C3,C4,C5

[0122] The Primal problem is considered as a task assignment problem with conditional constraints, aiming to maximize benefits. To solve this problem, it is defined as a weighted bipartite graph G. Min =(T,U,E) Min ), where nodes in T represent task sets, t i,k ∈T. U is the set of resource-sharing nodes, U = RE\Min. E Min Let u be the set of edges if and only if u j (u j ∈U) satisfies the constraints edge (t) i,k ,u j )∈E Min Side e i =(t i,k ,u j The weight of ) is And mark the type of task e corresponding to the edge. i,k To solve this problem, a task allocation algorithm as shown in Algorithm 1 in Table 1 is proposed.

[0123] Table 1. Flowchart of the task allocation algorithm based on greedy strategy

[0124]

[0125]

[0126] 2) Edge resource scheduling algorithm oriented towards task allocation

[0127] The solution to Algorithm 1 is used to solve the master problem. The task allocation and edge resource scheduling mechanism is designed as shown in Table 2.

[0128] Table 2. Algorithm flow for task allocation and edge resource scheduling

[0129]

[0130]

[0131] This invention provides an IoT resource sharing method that introduces blockchain technology into IoT edge computing scenarios to address the lack of complete mutual trust among edge nodes during resource sharing. It comprehensively considers the resource requirements of both IoT and blockchain tasks, studying task allocation and resource scheduling to ensure the effectiveness of various task executions while maximizing overall system efficiency. The method incorporates offloading, network, and latency models, and designs greedy algorithm-based task allocation and edge resource scheduling algorithms to address the objective optimization problem, resulting in a highly secure and high-performance architecture and mechanism.

[0132] In this embodiment of the invention, the benefits can be reflected through blockchain points incentives. By designing a blockchain points incentive ranking method, the optimal setting of blockchain consensus nodes can be achieved, while incentivizing more nodes to participate in blockchain consensus and ensuring the long-term stable operation of the blockchain network.

[0133] The consensus incentive points list construction process, such as Figure 2 As shown.

[0134] The rewards earned by each resource node participating in consensus will be accumulated, updated by the blockchain smart contract, and used to form a consensus incentive points list to guide the next selection of consensus nodes and resource nodes.

[0135] Step 1: Begin;

[0136] Step 2: Complete the initialization of the blockchain network environment and set an initial incentive of 0 for each participating node;

[0137] Step 3: The blockchain network receives requests from users, packages them into blockchain transactions, and initiates task allocation contracts.

[0138] Step 4: Call the edge resource scheduling algorithm for task allocation to complete task allocation, and resource sharing nodes realize off-chain resource sharing to complete task execution;

[0139] Step 5: Blockchain consensus nodes complete blockchain consensus and realize on-chain storage of transaction information;

[0140] Step 6: Issue consensus incentive points to consensus nodes and call the smart contract to update the incentive list;

[0141] Step 7: Determine if any node integral exceeds E. If yes, proceed to step 8; otherwise, proceed to step 10.

[0142] Step 8: The blockchain consortium distributes rewards to the node;

[0143] Step 9: Update the rewarded node's points. The updated points are the existing points minus E.

[0144] Step 10: Set a random seed based on the updated points to select the next consensus node;

[0145] Step 11: Determine if the network is running normally. If yes, proceed to step 3; otherwise, proceed to step 12.

[0146] Step 12: End.

[0147] In this invention, a consensus incentive points list is constructed to quantify the positive contributions of nodes to the transaction ecosystem, thereby incentivizing blockchain network nodes to actively and honestly participate in network consensus and promoting the healthy, secure, and stable operation of the blockchain network.

[0148] The IoT resource sharing device provided by the present invention is described below. The IoT resource sharing device described below and the IoT resource sharing method described above can be referred to in correspondence.

[0149] like Figure 3 As shown, the IoT resource sharing device provided by the present invention includes:

[0150] The publishing module 301 is used to publish the task set of resource requesting terminals on the blockchain. The task set includes a task description and the total resource value that the terminal rewards to the resource providing nodes.

[0151] Calculation module 302 is used to calculate the benefits that the task brings to each resource-providing node based on the task description and the total resource value of the terminal reward to the resource-providing nodes;

[0152] The output module 303 is used to sum the benefits of each resource providing node and use the resource providing node with the maximum benefit as the current task unloading terminal.

[0153] The IoT resource sharing device provided in this embodiment of the invention publishes a set of tasks from resource requesting terminals in a blockchain. The task set includes a task description and the total resource value rewarded by the terminal to resource providing nodes. Based on the task description and the total resource value rewarded by the terminal to resource providing nodes, the device calculates the benefit of each task to each resource providing node. The device sums the benefits of each resource providing node under each offloading strategy and selects the resource providing node with the maximum sum of benefits as the current task offloading terminal. This yields the task offloading strategy for IoT terminals, maximizing the benefits of resource nodes while ensuring the task execution efficiency of ordinary IoT nodes, fully utilizing social resources, and improving IoT performance.

[0154] The IoT resource sharing system provided by the present invention is described below. The IoT resource sharing system described below can be referred to in correspondence with the IoT resource sharing method and device described above.

[0155] like Figure 4 As shown, the IoT resource sharing system provided by the present invention includes:

[0156] Device layer, edge service layer, and blockchain;

[0157] Resource requesting terminals and resource providing terminals in the device layer, and resource providing terminals in the edge service layer constitute the consensus nodes in the blockchain;

[0158] Resource requesting terminals in the device layer publish tasks to the blockchain. Resource providing terminals in the device layer and / or edge service layer determine the current task unloading terminal based on the task description and the total resource value rewarded by the terminal to the resource providing nodes.

[0159] Based on the above embodiments, this invention provides a blockchain-enabled edge resource sharing architecture to achieve reliable interaction and collaboration of IoT edge resources supported by 6G networks. Based on this architecture, considering both the consensus task of blockchain and the computing task requirements of IoT terminals, a complete process for resource collaborative sharing is designed. Resource scheduling and task allocation algorithms are designed in typical edge resource collaboration scenarios, providing a layered parallel resource scheduling mechanism. This architecture combines blockchain and edge computing technologies to address issues such as lack of mutual trust, lack of participation, and insecure resource transactions during the sharing of massive edge device resources. It also enables automatic collaborative autonomy of edge resources based on blockchain smart contracts. The blockchain-enabled edge resource sharing architecture mainly includes two layers: an infrastructure layer and a blockchain layer. The infrastructure layer includes a device layer and an edge server layer. In the device layer, IoT devices such as smartphones, computers, smart cars, and wearable devices provide and collect raw environmental data or receive service tasks from users. IoT devices can process tasks independently or subscribe to services provided by resource nodes (edge ​​servers or IoT resource devices). IoT devices support D2D communication. In the edge server layer, edge servers (such as routers, switches, hubs, and IoT devices) are configured with communication, storage, and computing resources. They can participate in the resource sharing process and possess information processing and decision-making capabilities. Edge servers belong to different companies or individuals and provide services externally. Each edge server can process and control (manage) multiple IoT devices, receiving and processing tasks from IoT devices in a timely manner. In the blockchain-enabled edge resource collaborative sharing architecture, the infrastructure layer includes service resource sharing devices and resource requesting devices. This invention considers all devices in the infrastructure layer as potential resource sharing nodes, including edge servers and IoT resource devices (possessing certain idle resources that can provide resource services to the outside world).

[0160] The security of blockchain-enabled edge resource sharing architectures is analyzed, specifically including:

[0161] Denial-of-service attack: Malicious nodes send a large number of fake resource requests to the resource sharing platform, hoping to exhaust its computing resources by increasing the request processing volume, so that it cannot provide resource sharing services.

[0162] Resource forgery attack: Malicious resource nodes forge information about the resources they own and register it in the blockchain resource list to fraudulently obtain service benefits.

[0163] Resource transaction security: Malicious nodes attempt to refuse to complete payments by modifying transaction data or denying resource rental history.

[0164] Privacy breach: Attackers attempt to analyze transaction data in the blockchain to uncover the true identities of the parties involved in resource transactions.

[0165] In this embodiment of the invention, ordinary IoT nodes are required to publish the total available resource value to the task allocation contract for recording when submitting a service request (posting a task) to the blockchain network. If a malicious node intends to consume the blockchain network's resources by initiating a large number of requests, thereby reducing the processing speed of the requests or preventing their execution, it needs to have sufficient incentive points to ensure that its service is processed. Simultaneously, the execution of smart contracts in the blockchain network relies on widely distributed resource nodes. Requesting nodes need to provide corresponding resource values ​​to the network when initiating service requests. Generating a large number of service requests will consume the attacker's assets, further ensuring the security of resource sharing.

[0166] Malicious resource nodes attempting to gain benefits by declaring false resource information to the blockchain network are doomed to fail. Due to the inherent technical characteristics of blockchain, its recorded data is tamper-proof. Furthermore, in the proposed BERS architecture, blockchain-based resource transactions rely on smart contracts, ensuring that every resource transaction is stored in the blockchain ledger as a blockchain transaction, making resource transactions traceable and auditable. Malicious nodes attempting to deny or refuse transactions will be punished.

[0167] Resource information published or transaction information generated in a blockchain is not directly linked to end-user information; instead, it is mapped to off-chain data through blockchain accounts. Therefore, although public blockchains allow for widespread user access and provide each user with a copy of their data, it is impossible to obtain the actual identity information of the transacting parties through blockchain data. Furthermore, the flexible adjustment of consensus node selection allows for higher system security.

[0168] The performance of blockchain-enabled edge resource sharing architectures is analyzed, specifically including:

[0169] Consider a resource-sharing scenario with 3 edge servers, 10 IoT resource-sharing nodes, and 10 IoT request nodes. The IoT resource-sharing nodes and IoT request nodes are randomly distributed near the edge servers. The distance from these nodes to the edge servers is [20-800] meters. There are v consensus nodes, where v is in the range [3, 10]. The blockchain reward is set to 25 points as an incentive. The computing power of the edge servers is set in the range [2-10], and that of the IoT resource-sharing nodes is set in the range [0.3-2]. The bandwidth from the IoT request nodes to the edge servers is set to [0-500] KB / s, and the bandwidth from the IoT request nodes to the IoT resource-sharing nodes is set to [0, 1000] KB / s. The computational cost of a single application in the IoT resource-sharing nodes is set to [0-1] and in the edge servers to [0-6]. The consensus cost is set to [0-3] and [0-8], respectively. There are 5 types of tasks, and each IoT request node has [1-3] tasks that need to be unloaded. The number of CPU cycles for each task is set to [10-100], the amount of input data is set to [500-2000] KB, and the points payable for task execution are set to [20-100].

[0170] The execution time of the greedy task allocation algorithm increases with the number of tasks. The number of blockchain consensus nodes also affects the algorithm's execution time. When the number of tasks is small, the execution times are very similar. However, as the number of tasks increases, setting different numbers of consensus nodes in the system has a significant impact on the algorithm's execution. In a system with 13 IoT resource nodes, 3, 6, 9, and 12 consensus nodes were set up respectively. When the number of consensus nodes is 6, the greedy task allocation algorithm has the longest execution time, while when the number of consensus nodes is 12, the algorithm has the shortest execution time. This is because the number of consensus nodes affects the number of optional consensus nodes and the number of algorithm iterations. When the number of consensus nodes is 6, there are obviously more optional consensus nodes that meet the conditions. Similarly, when the number of consensus nodes is 12, in a system with 13 resource nodes, there are only 13 optional nodes. As the number of tasks increases, the overall efficiency score increases. It is worth noting that the fewer consensus nodes, the greater the system's efficiency score. As can be seen from the figure, when the number of consensus nodes is 3, the system's total efficiency score is optimal compared to other systems. Especially when the number of consensus nodes is 12, in a system with only 13 nodes, as the number of tasks increases, after a certain point, the overall benefit score remains unchanged. There are two main reasons for this. First, the more consensus nodes there are, the higher the cost of participating in consensus. Although the overall blockchain reward remains the same, the benefit score decreases. Second, the system needs to select some nodes to complete the consensus tasks. The more consensus nodes there are, the fewer IoT nodes sharing external resources, making it difficult to support all tasks within the network.

[0171] The IoT collaborative resource sharing system provided in this invention can realize IoT edge resource management, provide a secure and reliable resource trading platform, and enable secure collaboration between IoT entities. Furthermore, based on smart contract technology, resource nodes can supervise each other, providing secure, open, and transparent resource management and ensuring the security of resource sharing transactions.

[0172] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, communications interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute an IoT resource sharing method. This method includes: publishing a set of tasks from resource requesting terminals in a blockchain, the task set including task descriptions and the total resource value rewarded by the terminals to resource providing nodes; calculating the benefit brought by the task to each resource providing node based on the task descriptions and the total resource value rewarded by the terminals to resource providing nodes; summing the benefits of each resource providing node under each offloading strategy, and selecting the resource providing node with the maximum sum of benefits as the current task offloading terminal.

[0173] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0174] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the IoT resource sharing method provided by the above methods. The method includes: publishing a task set of resource requesting terminals in a blockchain, the task set including task descriptions and the total resource value rewarded by the terminals to resource providing nodes; calculating the benefit brought by the task to each resource providing node based on the task descriptions and the total resource value rewarded by the terminals to resource providing nodes; summing the benefits of each resource providing node under each offloading strategy, and selecting the resource providing node corresponding to the maximum sum of benefits as the current task offloading terminal.

[0175] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0176] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0177] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An Internet of Things resource sharing method, characterized by, include: The task set of resource requesting terminals is published on the blockchain. The task set includes a task description and the total resource value that the terminal rewards to resource providing nodes. Calculate the benefits that the task brings to each resource-providing node based on the task description and the total resource value rewarded by the terminal to the resource-providing nodes; The benefits of each resource provider node under each unloading strategy are summed, and the resource provider node in the unloading strategy corresponding to the maximum sum of benefits is taken as the unloading terminal of the current task. The calculation of the benefits brought to resource-providing nodes by the task based on the task description and the total resource value awarded to resource-providing nodes by the terminal includes: Task providing node for resources Benefits : ; in The total resource value provided by the terminal to the resource-providing node. Provides the first resource value for a node based on resource usage per unit time. The second resource value of the blockchain used to trigger the smart contract to complete the task and record the transaction. Provide the time required for resource-type nodes to complete their tasks. Here is the task description for task k of resource request terminal p, where p is the terminal ID, k is the task ID, q is the resource node ID, and comp is the computation delay ID. When the resource-providing node is a terminal resource-sharing node, the method for calculating the time required for the resource-providing node to complete the task is as follows: ; wherein a transmission time including both input data and backhaul data, a delay for transmission to the terminal, a delay for the terminal to calculate, i is a resource provider type terminal node number; The resource-providing node is an edge server, and the method for calculating the time required for the resource-providing node to complete the task is as follows: ; in, To reduce transmission latency to the edge server, Waiting latency for edge servers Calculate latency for edge servers. The task description identifies the k-th task that the l-th task request terminal unloads to the edge server, where wait is the waiting delay identifier and j is the edge server number identifier. 2.The IoT resource sharing method of claim 1, wherein, The process of summing the benefits of each resource-providing node under each unloading strategy, and using the resource-providing node in the unloading strategy corresponding to the maximum sum of benefits as the current task unloading terminal, includes: make ,in For IoT terminals The unloading strategies are then input into the target optimization model. Solve the objective optimization model to obtain the resource-providing node corresponding to the maximum benefit; Objective optimization model: ; Among them, constraints Ensure that the decision variables for the task are binary; constraints Ensure that the task's computation meets the time delay constraint; constraint Ensure that a task is assigned to at most one resource provider node for execution; Ensure that the resource value consumed by the execution of resource-providing nodes does not exceed the total resource value rewarded by the terminal to resource-providing nodes; Ensure that IoT terminal resources can provide services to a maximum of one user at a time. Ensure that the expected benefit of blockchain consensus nodes in forming blocks is greater than zero; Ensure that the number of selected blockchain consensus nodes is the preset number. ; For the overall benefit of consensus nodes, Overall revenue of resource-providing nodes For collaborative decision-making at the terminal, Here, k is the terminal index, k is the task number, and j is the resource node number. This represents the total number of IoT terminals. Number of resource nodes Let j be the purple cloud node. This represents the total number of executable task types. For the selected set of consensus nodes, D represents the actual time spent performing the task. Maximum tolerable time for task execution. Let ti,k be the node reward when it is handed over to resource node j for execution. Let mi be the expected reward. For the node with number i, A set of terminal resource nodes. This is the set of all resource-sharing nodes. 3.The IoT resource sharing method of claim 2, wherein, Solving the objective optimization model includes: The target optimization model is solved using a greedy algorithm-based task allocation algorithm and a task allocation and edge resource scheduling algorithm to obtain the resource providing node corresponding to the maximum benefit.

4. An Internet of Things collaborative resource sharing apparatus, adapted to the Internet of Things resource sharing method of any one of claims 1-3, characterized in that, include: The publishing module is used to publish the task set of resource requesting terminals in the blockchain. The task set includes a task description and the total resource value that the terminal rewards to resource providing nodes. The calculation module is used to calculate the benefits that the task brings to each resource-providing node based on the task description and the total resource value of the terminal reward given to the resource-providing nodes; The output module is used to sum the benefits of each resource providing node and take the resource providing node in the unloading strategy corresponding to the maximum benefit as the current task unloading terminal.

5. An Internet of Things collaborative resource sharing system, adapted to the Internet of Things resource sharing method of any one of claims 1-3, characterized in that, include: Device layer, edge service layer, and blockchain; The resource requesting terminals and resource providing terminals in the device layer, and the resource providing terminals in the edge service layer constitute the consensus nodes in the blockchain; The resource requesting terminal in the device layer publishes a task to the blockchain, and the resource providing terminal in the device layer and / or edge service layer determines the current task unloading terminal based on the task description and the total resource value of the terminal reward to the resource providing node.

6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the Internet of Things resource sharing method as described in any one of claims 1 to 3.

7. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the Internet of Things resource sharing method as described in any one of claims 1 to 3.