Disclosure of Invention
In order to solve the problem that the unloading result is unreliable in the task unloading in the edge calculation, the invention provides a high-reliability task unloading system and method based on a block chain in the edge calculation. The unloading technical scheme comprises a priority-based unloading method in a block chain and an unloading result verification method based on a game theory. The entire offload policy is deployed in blockchain intelligent contracts to ensure visibility and traceability of the entire offload process.
In order to achieve the purpose, the invention adopts the following technical scheme:
an edge computing task unloading system based on a block chain comprises a wireless network equipment unit and an MEC server unit. The wireless network equipment unit comprises a plurality of Internet of things equipment connected through a network.
The wireless network equipment unit comprises a plurality of Internet of things equipment, such as Internet of things sensors, and the Internet of things equipment collects data information of various Internet of things application programs from a physical environment and forwards task information to the MEC server unit to execute task calculation;
the MEC server unit comprises a plurality of MEC servers and is used for realizing a consensus mechanism of the block chain and realizing signing registration and task unloading of wireless network equipment according to an intelligent contract arranged in a block chain network on the MEC servers.
Further, the wireless network device unit completes the signing and registration of the internet of things device to the block chain network on the MEC server, and the registration authentication information is stored in the intelligent contract.
Further, the internet of things device in the wireless network device forwards data information collected from the physical device or uploaded by the user to an intelligent contract in the block chain network on the MEC server.
Furthermore, an intelligent contract in the MEC server unit selects a proper MEC server to unload the task according to the uploaded task information through a priority-based task unloading method.
Further, cross validation is carried out on the calculation result through an unloading result validation method based on the game theory in the intelligent contract. The intelligent closing date in the MEC server unit records the unloading process and the verification of the calculation result in the blockchain.
Further, the MEC server unit returns the calculation result to the internet of things device that sends the task and the data information.
The invention relates to a block chain-based edge computing task unloading method, which comprises the following steps:
s1, uploading unloading task information to an intelligent contract of a block chain through Internet of things equipment;
s2, selecting a proper edge server to unload the task according to the task information to be unloaded by using a priority-based unloading method;
preferably, assuming that the task set M uploaded by the wireless network device is {1, 2., M }, the task set may represent a set of different types of computing tasks, and is used to describe the set of different types of computing tasks
Attribute, u, describing the offload task i
i Is the size of the data uploaded by task i, c
i Indicating the number of CPU cycles required to complete task i, z
i Data size, t, representing output result
i Represents the maximum delay tolerance of the computing task, which represents the maximum delay that the task can tolerate.
The tasks in the priority queue PQ are ordered from small to large according to the task delay tolerance, and the order of the tasks in the queue is dynamically adjusted according to the newly added task. And the tasks are put into a priority queue from the tail of the queue, and the first task of the queue is selected in the priority queue for unloading each time.
Further preferably, the respective unloading time delay of each MEC server in the communication transmission range of the Internet of things equipment is calculated, the MEC server with the optimal time delay is selected for task unloading calculation, and the MEC server with the suboptimal time delay is selected for cross validation of the calculation result. And after calculating the task unloading result, the MEC server records all the results into an intelligent contract deployed in the block chain.
S3, cross-verifying the calculation result through an unloading result verification method based on a game theory in the intelligent contract;
preferably, reasonable trading rules are formulated by allowing two MEC servers to complete the same task, so that rational MEC servers cannot collude and cheat each other. In the absence of collusion, cross-validation can be performed by examining the results of two MECs. The method proves the game in the intelligent contract through the extended form of the game. The game algorithm is realized by deploying the game on an Etherhouse intelligent contract and combining transaction rules in the intelligent contract. Thus, the customer only needs to pay two MEC servers a fee and a small transaction fee to be able to use the smart contract to effect the calculation.
The game in the method represents the possible behaviors of the game party in the form of decision trees through the expansion form of the game so as to solve the Nash equilibrium. Here, the user is denoted as Client, and the uninstalling MEC server is denoted as U 1 Verify MEC server as U 2 The intelligent contract is specifically introduced as follows:
verifying that the intelligent contract initiator is a Client, and verifying the MEC server U 2 Sign up the contract, U 2 The task offload results need to be sent in the validation contract. When U is turned 2 And if dishonest behavior occurs, a third-party trusted authority is introduced to verify the unloading result. Suppose that when the task is completed, the user pays w for the MEC server, the computing cost required by the MEC server is c, the deposit for the task is d, and the verification cost of the third-party trusted authority is e.
Under normal reasonable circumstances, the following relationship is clearly true:
w ≧ c-the edge server gains revenue is typically greater than its computational cost.
e >2w the third party trusted authority computing task cost should be greater than the amount the user needs to pay to both MEC servers. Otherwise, the MEC server is not needed, and the client only uses the third-party trusted computer to calculate.
If an MEC server is dishonest, e is paid by the MEC server, and a honest customer need only hire two MEC servers plus the transaction cost of the intelligent contract. In addition, to satisfy the ideal nash balance, a constraint d > c + e is set in the smart contract.
Preferably, any node of the extended game tree represents each possible state in the game play. The game starts from the only initial node, the path to the terminal node is determined by the action taken by the MEC server, and the game is ended, and the MEC server obtains corresponding benefits. Each non-terminal node only belongs to one MEC server participating in the game; the participant selects its possible actions at the node, each possible action passing from node to node through an edge. The game is divided into three stages in total: first stage, verifying MEC server U 2 Discovery of U 1 A dishonest behavior occurs, which may or may not be optionally reported; second stage, by uninstalling MEC server U 1 Selecting actions, uninstalling MEC server U 1 The correct calculation result or the wrong calculation result is returned; the third stage, by verifying the MEC server U 2 Selecting action, verifying MEC server U 2 Either the correct calculation or the incorrect calculation is selected to be returned. According to the transaction rule in the intelligent contract, the MEC servers of both parties obtain the highest income for the MEC servers, U 2 Will choose not to report and U 1 And U 2 The correct calculation results are returned, the final nash equilibrium point is reached, and the gains of w-c are all obtained.
And S4, verifying and recording the unloading process and the calculation result in a block chain, and transmitting the result of task unloading back to the wireless network equipment unit.
The technical scheme of the invention for high-reliability task unloading based on the block chain in the edge calculation has the following advantages: by using a block chain technology, the traceability and visibility of the unloading process of the edge computing task are ensured; by the task unloading method based on the priority, the requirements of users with different time delay requirements on the current unloading task can be more reasonably met; by the aid of the unloading result verification method based on the game theory, correctness and verifiability of calculation results are guaranteed, and accordingly quality of task unloading is improved.
Detailed Description
The embodiments of the present invention are illustrated below by specific examples. Other advantages and effects of the present invention will be readily apparent to those skilled in the art from the disclosure herein. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be noted that the features in the following embodiments and examples may be combined with each other without conflict.
The invention provides a high-reliability task unloading system and method based on a block chain in edge calculation, aiming at the defects of task unloading in the existing edge calculation.
Example one
The embodiment provides a block chain-based edge computing task offloading system, as shown in fig. 1, which includes a wireless network device unit and an MEC server unit. The wireless network equipment unit consists of a plurality of pieces of Internet of things equipment; the MEC server unit is composed of a plurality of MEC servers.
And the wireless network equipment unit is used for acquiring task data collected by the user and the wireless sensor and forwarding the data information to the MEC server unit with the intelligent contract.
The wireless network equipment is composed of internet of things equipment, comprises various sensors, cameras and the like, is usually deployed in various different environments such as intelligent automobiles, buildings, streets and the like, and the data of the wireless network equipment is mainly used in system applications such as intelligent transportation and intelligent buildings. Since the wireless network device itself has limited computing power and cannot process the collected data, the task needs to be offloaded to a device with computing power and a certain storage space.
And the MEC server unit is used for realizing a consensus mechanism of the block chain and realizing signing registration and task unloading of the wireless network equipment according to an intelligent contract arranged in the block chain network on the MEC server. The block chain network consists of a plurality of MEC servers, and block chain link points are deployed on a plurality of edge computing nodes.
Edge server nodes can be divided into proxy MEC server nodes and normal MEC server nodes. The proxy MEC server node is responsible for deploying intelligent contracts in the blockchain network and adding or changing unloading strategies. And the common MEC server unit is responsible for calculating and processing the task information and data uploaded by the wireless network equipment unit.
Each MEC server can interact with the intelligent contracts on the block chain, the tasks are unloaded to the MEC servers through the unloading strategies in the intelligent contracts, and the processes from the selection of the proper MEC server to the task unloading process and the verification of the calculation result are recorded in the block chain so as to facilitate tracing.
Fig. 2 shows a flow chart of highly reliable task offloading based on block chains according to this embodiment, which includes the following steps:
s1, uploading unloading task information to an intelligent contract of a block chain through Internet of things equipment.
And S2, selecting a proper edge server to unload the task according to the task information needing to be unloaded by using a priority-based unloading method.
And S3, cross-verifying the calculation result by an unloading result verification method based on a game theory in the intelligent contract.
And S4, verifying and recording the unloading process and the calculation result in a block chain, and transmitting the result of task unloading back to the wireless network equipment unit.
In step S1, the wireless network device unit uploads the task information to the intelligent contract in the block chain network, records the task upload information in the block chain, and selects the MEC server for task offloading according to the task offloading policy in the intelligent contract.
In step S2, in the unloading system, an unloading policy method plays a key role. Currently, the design of conventional task offloading strategies takes into account a number of factors, such as: the distance between the internet of things equipment and the MEC server, the rental cost of the MEC server, the computing capacity of the MEC server and the like. In this embodiment, a method for offloading based on priority in a block chain is provided, specifically, assuming that a task set M ═ 1, 2.. multidata, M } uploaded by a wireless network device, the task set may represent a set of different types of computing tasks, and is used to use the set to represent a set of different types of computing tasks
Attribute, u, describing the offload task i
i Is the size of the data uploaded by task i, c
i Indicating the number of CPU cycles required to complete task i, z
i Data size, t, representing output result
i Represents the maximum delay tolerance of the computing task, which represents the maximum delay that the task can tolerate.
In the model, Frequency Division Multiple Access (FDMA) is adopted for data communication between the wireless network device and the MEC server. FDMA techniques allow multiple users to transmit data over a single communication channel (e.g., coaxial cable or microwave beam) by dividing the bandwidth of the channel into separate non-overlapping frequency subchannels and assigning each subchannel to a separate user. A user may transmit data by modulating it on a carrier at the frequency of the subchannel. In FDMA technology, a channel is divided into a number of sub-channels, each of which has a radio propagation rate that is related to the channel bandwidth and channel fading. Therefore, the task offload transmission rate between network devices in each layer in the model can be expressed as:
wherein H i For channel gain, H i =d i r ,d i Distance from invalid network equipment unit to MEC server unit, r is channel fading factor, B i Is the bandwidth of the channel, P i Is the average power of the signal transmitted by the channel, and N is the power of gaussian noise inside the channel.
Depending on the task offload transfer rate, the task data transfer delay may be expressed as
Task computation latency for offloading of tasks to MEC servers can be expressed as
Wherein f is i The frequency is calculated for the MEC server.
The MEC server returning the task computation results back to the delay may be expressed as
The total time delay for task offloading can be expressed as
t=t 1 +t 2 +t 3
The tasks in the priority queue PQ are ordered from small to large according to the task delay tolerance, and the order of the tasks in the queue is dynamically adjusted according to the newly added task. And the tasks are put into a priority queue from the tail of the queue, and the first task of the queue is selected in the priority queue for unloading each time.
Further, by calculating the respective unloading time delay of each MEC server in the communication transmission range of the Internet of things equipment, the MEC server with the optimal time delay is selected for task unloading calculation, and the MEC server with the suboptimal time delay is selected for cross validation of the calculation result. And after calculating the task unloading result, the MEC server records all the results into an intelligent contract deployed in the block chain.
In step S3, the calculation result is cross-verified by the unloading result verification method based on the game theory in the intelligent contract. Specifically, two MEC servers complete the same task, and reasonable transaction rules are formulated, so that the rational MEC servers cannot mutually collude and cheat. In the absence of collusion, cross-validation can be performed by examining the results of two MECs. The method proves the game in the intelligent contract through the extended form of the game. The game algorithm is realized by deploying the game on an Etherhouse intelligent contract and combining transaction rules in the intelligent contract. Thus, the customer only needs to pay two MEC servers a fee and a small transaction fee to be able to use the smart contract to effect the calculation.
The following are the currency variables that the present example will use in contracts, all of which are non-negative.
c, the cost of the computing task of the edge server.
And e, calling a third-party trusted authority to recalculate tasks and solve the dispute of the cost of the problem.
The margin calculates the deposit that needs to be paid to the customer in order to obtain the job.
w the amount the customer agrees to pay the edge server to complete the task.
Under normal reasonable circumstances, the following relationship is clearly true:
w ≧ c-the edge server gains revenue is typically greater than its computational cost.
e >2w the third party trusted authority computing task cost should be greater than the amount the user needs to pay to both MEC servers. Otherwise, the MEC server is not needed, and the client only uses the third-party trusted computer to calculate.
If dishonest behaviour occurs, e is paid by the MEC server and a honest customer only needs to hire two MEC servers plus the transaction cost of the intelligent contract. In addition, to satisfy the ideal nash balance, a constraint d > c + e is set in the smart contract.
The main difficulty in designing the game algorithm is how to avoid the counter-act. The client may make collusion less desirable by providing extra rewards to the honest MEC servers and altering the balance. However, once the dishonest MEC servers know what the customer has provided, they can create counterpulses to collude that it is established again. This cycle can be continued endlessly.
To escape the cycle, the gaming method does not counter collusion, but instead incentivizes the MEC server to report collusion. If the intelligent contract is signed and collusion is reported, a third-party trusted authority intervenes to verify the calculation result and decide who cheats. A counterpcontract is meaningless because, once a third party trusted authority is involved, the revenue of one MEC server depends only on whether it is dishonest, and not on the behaviour of another MEC server.
According to the unloading result verification method based on the game theory, the game expresses the possible behaviors of game parties in the form of decision trees through the expansion form of the game so as to solve Nash equilibrium. The user is marked as Client, and the uninstalling MEC server is marked as U 1 Verify MEC server as U 2 .. The intelligent contract is specifically introduced as follows:
verifying that the intelligent contract initiator is a Client and the MEC server U needs to be verified 2 Sign up the contract, U 2 The task offload results need to be sent in the validation contract. When U is turned 2 And if dishonest behavior occurs, a third-party trusted authority is introduced to verify the unloading result.
Fig. 3 is a schematic diagram illustrating an unloading result verification method based on an extended game tree according to this embodiment.
Specifically, any node V of the extended game tree in the figure represents each of the game progressesA possible state. Game is from a unique initial node V 0 Initially, the MEC server takes action to determine the path to the terminal node, and at the end of the game, the MEC server receives the corresponding benefit. Each non-terminal node only belongs to one MEC server participating in the game; the participant selects its possible actions at the node, each possible action passing from node to node through an edge. The game is divided into three stages in total: a first stage when the game is in V 0 State, validation MEC Server U 2 Discovery of U 1 A dishonest behavior occurs, which may or may not be optionally reported; second stage, by uninstalling MEC server U 1 Selecting actions, uninstalling MEC server U 1 The correct calculation result or the wrong calculation result is returned; the third stage, by verifying the MEC server U 2 Selecting action, verifying MEC server U 2 Either the correct calculation or the incorrect calculation is selected to be returned. According to the transaction rule in the intelligent contract, the MEC servers of both parties obtain the highest income for the MEC servers, U 2 Will choose not to report and U 1 And U 2 The correct calculation results are returned, the final nash equilibrium point is reached, and the gains of w-c are all obtained.
In summary, the invention provides a high-reliability task unloading system and method based on a block chain. The system architecture of the present invention supports mobility of networked devices and allows them to join or leave at any time; by using a block chain technology, the traceability and visibility of the unloading process of the edge computing task are ensured; by the task unloading method based on the priority, the requirements of users with different time delay requirements on the current unloading task can be more reasonably met; by the aid of the unloading result verification method based on the game theory, correctness and verifiability of calculation results and quality of unloading tasks are guaranteed.
The embodiments described above are merely preferred possible embodiments of the invention and the technical principles applied. Those skilled in the art may supplement or modify the embodiments described or substitute them in other ways. Therefore, although the objects and advantages of the present invention will be made clearer by the above embodiments, the present invention is not limited to the above embodiments only. The description is not to be construed as limiting the invention.