CN113778675A - Calculation task distribution system and method based on block chain network - Google Patents
Calculation task distribution system and method based on block chain network Download PDFInfo
- Publication number
- CN113778675A CN113778675A CN202111024482.0A CN202111024482A CN113778675A CN 113778675 A CN113778675 A CN 113778675A CN 202111024482 A CN202111024482 A CN 202111024482A CN 113778675 A CN113778675 A CN 113778675A
- Authority
- CN
- China
- Prior art keywords
- task
- computing
- terminal
- calculation
- initiator
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5072—Grid computing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention provides a system and a method for distributing computing tasks based on a block chain network, which comprises the following steps: the system comprises a task initiating terminal, a plurality of computing terminals, an intelligent contract module and a verification terminal; the task initiating terminal is used for initiating a calculation request task to the intelligent contract module; the intelligent contract module splits the calculation request task, matches the attribute and the difficulty level of the split task small block to a calculation terminal, calculates and outputs a calculation result; the verification terminal is used for verifying the accuracy of the calculation result, and if the accuracy reaches a threshold value, the calculation task is ended; and the intelligent contract module distributes corresponding rewards to the computing terminal according to the contribution degree of the computing terminal. The invention distributes the training tasks by combining user selection and dynamic resources through a task distribution algorithm of an intelligent contract module based on a reinforcement learning method so as to reduce energy consumption. And a deep learning model is adopted to separate training and prediction, so that the time loss caused by excessive nodes is reduced.
Description
Technical Field
The invention relates to the technical field of blockchain networks, in particular to a system and a method for distributing computing tasks based on a blockchain-oriented network.
Background
Mobile Edge Computing (MEC) is mainly to solve the problem of limited resources of Mobile devices, and to offload all or part of compute-intensive tasks to an Edge network server, so as to reduce the execution time of the tasks and the energy consumption of Mobile terminals. The current approach for reducing task latency in edge computing mainly includes two aspects, content caching and task offloading. The content caching is that the content provider caches the commonly used content on the edge node so as to reduce the delay of the content request of the initiator. Task offloading is to consider which tasks are offloaded from the terminal to the edge node at what time, and has reached the goal of completing the computation task in the shortest time, and includes two offloading mechanisms: binary offload and partial offload.
The binary unloading mechanism determines whether the calculation tasks are completely unloaded to the MEC server or are completely processed locally, and the judgment standard is as follows: if the local processing time delay is greater than the sum of the communication time delay and the calculation processing time delay, unloading the local processing time delay to the MEC server; and if the time delay of the local processing is smaller than the sum of the communication time delay and the calculation processing time delay, all the local processing is carried out.
The partial offload mechanism divides the computing task into a plurality of subtasks, with a portion of the subtasks being executed on the local device and a portion of the subtasks being offloaded to the MEC server.
The block chain network distributes the calculation tasks issued by the initiator to each edge node, and records information such as all task distribution processes, task unloading nodes, task consumption calculation capacity and the like through the block chain network. In the prior art, tasks cannot be effectively distributed to matched computing terminals, and if the computing terminals are distributed with computing tasks which cannot be effectively executed, the computing terminals cannot execute the computing tasks, so that the time efficiency of computing processing of a system is delayed, and the computation workload of the system is consumed. The overall calculation amount of some tasks is large, and when the calculation processing is carried out, the consumed system resources are large, so that the calculation processing time is long, and the data processing efficiency of the system is low. And each node in the block chain network needs to be trained and predicted, so that the operation loss of the node is increased, and the data processing time is delayed.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a system for distributing computing tasks based on a blockchain-oriented network, which comprises: the system comprises a task initiating terminal, a plurality of computing terminals, an intelligent contract module and a verification terminal;
the task initiating terminal is used for initiating a calculation request task to the intelligent contract module;
each computing terminal has a different computational training model;
the intelligent contract module is used for collecting a calculation request task initiated by a task initiating terminal in a network in real time, and splitting the calculation request task into small task blocks; matching the attribute and the difficulty degree of the split task small blocks to a computing terminal, computing and outputting a computing result;
the verification terminal is used for verifying the accuracy of the calculation result, and if the accuracy reaches a threshold value, the calculation task is ended;
if the credit score does not reach the threshold value, the credit score of the computing terminal is reduced;
and the intelligent contract module distributes corresponding rewards to the computing terminal according to the contribution degree of the computing terminal.
It is further noted that the contribution degree is determined based on the amount of data that the computing terminal completes and verifies through the task tiles.
It is further noted that the content of the calculation request task includes task deadline, storage space required by the task, reward of the task, and category of the task.
The invention also provides a block chain network-oriented computing task allocation method, which comprises the following steps:
a task initiating terminal acquires a calculation request task triggered by an initiator;
the intelligent contract module collects a calculation request task initiated by a task initiating terminal in a network in real time, and splits the calculation request task into small task blocks;
matching the attribute and the difficulty degree of the split task small blocks to a computing terminal;
the computing terminal receiving the task small block performs computing and outputs a computing result;
the verification terminal verifies the accuracy of the calculation result, and if the accuracy reaches a threshold value, the calculation task is ended;
if the credit score does not reach the threshold value, the credit score of the computing terminal is reduced;
and the intelligent contract module distributes corresponding rewards to the computing terminal according to the contribution degree of the computing terminal.
It should be further noted that the task initiating terminal obtains the task tuple m of the computation request task triggered by the initiatori=<om,dm,dsm,Qm,i>Is represented by the formula, wherein omIs task miThe release time of (1), the deadline of the task by (d)mDenotes, dsmRepresenting the memory space required for the task, QmIndicating the remuneration obtained by the computing terminals completing the task, wherein i represents the category of the task;
the set of computing request tasks of the initiator in the system is { m }1,m2,...,mICalculating that a request task set obeys Poisson distribution, and an initiator local queue also obeys Poisson distribution;
in the system, a macro base station MBS covers K small base stations SBS, which is denoted as K {0,1,2, …, K }, where 0 denotes the MBS;
using tuples<Ck,Sk,Pk>Description of SBSkIn which C iskRepresents SBSkIs calculated by the CPU ofkIndicates its available storage capacity, PkRepresents its transmit power of transmission;
using tuples<Ck,Sk,Pk>N initiators, labeled U ═ 1,2,3, …, N, are served together, each initiator connected to a small base station, and the initiators maintain a blockchain network together.
It is further noted that the initiator uses tuples<cn,sn,dn,pn,pcn>Represents;
wherein c isnThe CPU on behalf of the initiator n calculates the frequency,cn={cn,1,cn,2,...,cn,Idenotes different kinds of CPU calculation frequencies, snStorable capacity on behalf of the sponsor, dnIndicating the amount of local interaction data, p, available to the initiator nnIndicating the transmission transmit power of the initiator n, pcnIndicating a success rate;
computing terminal matching pair mp ═<m,Cm>Represents task m and computing terminal CmA combination of (1);
the computing terminal is the selected initiator and has Cm∈U;
Distribution utility Qm×pcn,QmTask return value and pcnThe product of the initiator success rates; wherein Qm∈(0,1),pcnE (0,1), then there is Qm×pcn∈(0,1)
The task travel time, namely the time for the computing terminal to discover and acquire the task:
wherein r isnAnd (t) is the download transmission rate.
It should be further noted that the initiator training time, i.e. the time taken for the computing terminal to train the model:
wherein sigmaiRepresenting the number of CPU cycles required to execute the i-type unit amount task;
the return time of the initiator, namely the time taken by the computing terminal to return the model:
where λ is the space occupied by the model parameters, rn' (t) is the upload transmission rate;
initiator opportunity cost, cost consumed by the initiator to download, execute, and return tasks;
waiting for an allocated time, i.e. the task release time omTo task allocation time TaThe difference of (a):
the quantity of local interaction data which can be provided by each task initiating terminal is assumed to beThe overall benefit of the matching pair is:
wherein alpha, beta, gamma and eta are weight coefficients,em and emm,n' is a normalized value, and the processing method is as follows:
wherein X is XiSet of values, min (X) is the element with the smallest value in set X, max (X) is the element with the largest value;
the task allocation aims at ensuring that the energy consumption and the time delay are minimized under the QoS limit, namely the optimization aims are as follows:
s.t.cn,t>0
(8)
the task m is distributed before the deadline, otherwise the reward can not be obtained; task miOnly initiators that support class i training can be selected and the assignment cannot be changed once the assignment is complete.
It is further noted that the intelligent contract module manages and coordinates the computation request tasks; collecting computing request task information and distributing each computing request task to a computing terminal;
the intelligent contract module is used for managing and coordinating based on a state space, an action space and a return function of a DQN algorithm;
1) and in each decision time T, the system information monitored and collected by the intelligent contract is as follows:
omand dmThe release time and the deadline of the task;
dsmcalculating the storage space required by the terminal;
Qmthe reward is paid;
i, the category of the task;
cnthe efficiency of the CPU or GPU on different kinds of tasks;
sncalculating the available storage space of the terminal;
danlocal interactive data volume;
pntransmitting a transmit power;
Vncredit points;
Bnthe number of available channels;
the state vector is represented as:
the state vector records not only the ease of task and classification, but also the attributes of the computing terminal.
It should be further noted that the intelligent contract module performs task allocation by selecting a computing terminal capable of executing the split small task blocks, and balancing the difficulty level of the task and the hardware performance and communication environment of the computing terminal;
selecting a training model of the computing terminal from the computing terminals and distributing a proper channel for the training model;
executing the split task small blocks by the selected computing terminals, and considering that the computing terminals use all computing power to carry out model training;
the motion vector is defined as:
at=(Δt,bt) (10).
the selection vectors of all the computing terminals in the set U are shown; whereinIs a binary vector used to indicate whether computing terminal n is selected to perform a task,expressed as:
whereinAnd selecting the computing terminal n as the computing terminal, otherwise, not selecting the computing terminal n.
Is an allocation vector of the spectrum resources of all the computing terminals in the set U, as mentioned in chapter IIIIs the same as (a) in the above description,is the subchannel assigned to the computing terminal n.
Assuming that all computing terminals are honest and cannot be disconnected from the network after being assigned tasks until the execution is finished;
and distributing the reward according to the computing power contribution amount of the computing terminal.
It should be further noted that, when selecting a computing terminal, the computing terminal needs to satisfy the following two constraints:
for each computing terminal in the distributed system, the task is distributed and executed immediately after the last task is completed, and the model submission is completed before the task deadline, so the predicted response time should be less than the QoS, based on the time constraint formula, it can be known that:
if the computing terminal does not support the execution of this type of task, it does not participate in the distributed training, i.e. it does not support the execution of this type of task
cn,i>0 (13)
In each decision cycle of task arrival, performing action a from state s, i.e. selecting computing terminals and allocating resources to them, the system transitions to the next state s';
the intelligent contract module obtains an instantaneous return RtAs an evaluation; based on a comprehensive income formula, a return function of a system executing a certain task is defined as follows:
whereinRepresenting credit points V of all computing terminals in the current networknMaximum ofA value;
the transient reward comprises three parts: the first portion represents a reward for performing the task, and the higher the credit score, the greater the value corresponding to the first portion is;
the second part is in proportion to contributing local interaction data, and the more data quantity representing contribution, the higher probability of being selected is;
the third portion represents the energy consumption to perform the task;
the reward function is for the computing terminal, δtWhen the value is 1, the user has a reward; but if not selected deltatThe corresponding reward is also 0, when it is 0.
According to the technical scheme, the invention has the following advantages:
in the invention, the calculation tasks issued by the user are distributed to each edge node through the block chain network, and the information of all task distribution processes, task unloading nodes, task consumption calculation force and the like is recorded through the block chain network. In the task allocation scheme, a reputation evaluation mechanism of a task participant is set so as to reduce the possibility that the system is attacked maliciously; the training task fragmentation scheme based on the data parallel idea is used for minimizing the task scheduling response time of different types and ensuring the safety of the whole task allocation process; the invention distributes the training tasks by combining user selection and dynamic resources through a task distribution algorithm of an intelligent contract module based on a reinforcement learning method so as to reduce energy consumption.
In order to improve that tasks distributed to all nodes can be completed most efficiently, processing time prediction aiming at all nodes is carried out on each task through a Recurrent Neural Network (RNN) prediction model, and due to the fact that the number of nodes of the whole Network is large, a deep learning model is adopted, training and prediction are separated, and time loss caused by the fact that the nodes are too many is reduced.
The task is effectively distributed to the matched computing terminals, so that the problem that the computing processing timeliness of the system is delayed due to the fact that the computing terminals cannot effectively execute the computing tasks is avoided or reduced. Splitting the task into small task blocks; and matching the attribute and the difficulty degree of the split task small block to a computing terminal. The problems that the overall calculation amount of the task is large, the system resource consumption is large, and the calculation processing time is long are solved.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings used in the description will be briefly introduced, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a system for distributing computing tasks based on a block chain network;
FIG. 2 is a flow diagram of initiating and executing tasks on a blockchain network;
FIG. 3 is a flow diagram of initiating and executing tasks on a blockchain network;
fig. 4 is a flowchart of a calculation task allocation method based on a blockchain-oriented network.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a computing task distribution system based on a block chain network, as shown in fig. 1, comprising: the system comprises a task initiating terminal 1, a plurality of computing terminals 2, an intelligent contract module 3 and a verification terminal 4;
the task initiating terminal 1 is used for initiating a calculation request task to the intelligent contract module 3; each computing terminal 2 has a different computational training model;
the intelligent contract module 3 is used for collecting the calculation request tasks initiated by the task initiating terminal 1 in the network in real time, and splitting the calculation request tasks into small task blocks; matching the attribute and the difficulty degree of the split task small block to a computing terminal 2, computing and outputting a computing result;
the verification terminal 4 is used for verifying the accuracy of the calculation result, and if the accuracy reaches a threshold value, the calculation task is ended; if the credit score does not reach the threshold value, the credit score of the computing terminal 2 is reduced; the intelligent contract module 3 distributes corresponding rewards to the computing terminal 2 according to the contribution degree of the computing terminal 2.
The invention relates to a block chain-oriented calculation task allocation method, which uses a block chain network to establish a trust and consensus mechanism between mobile terminals; predicting the arrival number of tasks and the popularity of task content by using a recurrent neural network; and distributing the computing task and the caching task by using deep reinforcement learning.
The mobile terminal may be implemented in various forms. For example, the terminal described in the embodiments of the present invention may include a mobile terminal such as a mobile phone, a smart phone, a notebook computer, a Digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a Portable Multimedia Player (PMP), a navigation device, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like. In the following, it is assumed that the terminal is a mobile terminal. However, it will be understood by those skilled in the art that the configuration according to the embodiment of the present invention can be applied to a fixed type terminal in addition to elements particularly used for moving purposes.
The task initiating terminal 1, the plurality of computing terminals 2 and the verification terminal 4 in the invention are node terminals in a block chain. All users interact in the blockchain network in a point-to-point communication mode through the blockchain network to complete the resource allocation work.
The task initiator is a user who provides a training task request to the system, and any user who joins the block chain network can initiate the task request. The task is executed by a plurality of computation participants, namely computation terminals 2, each computation participant, namely the computation terminal 2, is trained to obtain different models, and the system processes the models through an aggregation algorithm to obtain a final model result, which is a distributed model training mode. In the process, the verification participants, that is, the verification terminal 4, judge whether the training result is valid by verifying the accuracy of the model provided by each calculation participant, and further determine whether to enter the model parameter during aggregation, wherein the accuracy of the entered model parameter greatly affects the accuracy of the final model. The verification participant must therefore be a high public trust role that is derived from the user. While the roles of the initiator and the computing participant are mostly served by the user.
The intelligent contract module 3 is used as a management module of the system and is used for collecting and monitoring information of the users in real time, and completing operations of locking tokens, selecting the users, allocating resources, returning training results and the like after receiving tasks.
In the present invention, when a user needs to request computational support from other devices to perform deep learning, the process is as shown in fig. 2: the intelligent contract module 3 of the block chain is entrusted as the initiator by the user, the task request is broadcast in the block chain network as a transaction, and the specified amount of tokens for locking the account of the initiator is most compensated. The task content includes an expiration time, a required storage space, a reward, and a category of the task. In addition, the contents and data of the task, such as a training target (accuracy threshold), a data set, a default model, a decision interface, and the like, are stored in an IPFS (Inter-platform File System).
The intelligent contract module 3 collects attributes reported by online users in the network in real time, such as the CPU computing frequency, the available storage capacity, the computing capacity and the like. The data set of the task is divided into small blocks through an intelligent contract, which is related to distributed training of data parallel, and the specific process can be realized through tensierflow multi-GPU parallel. The intelligent contract module 3 selects whether a computing participant is available according to the rules of the attributes of online users in the system and the difficulty of tasks, such as whether a matching user can perform such tasks, and sends task information to the participants.
The computing terminal 2 will access the IPFS to retrieve and execute the tile task via the task address link. During each round of training thereafter:
1) calculating the forward calculation and the backward calculation independently completed by the participants, and obtaining the updating amount of the model parameters;
2) broadcasting the updated parameters to surrounding nodes;
3) and synchronously updating the model parameters according to the aggregation result of the intelligent contract module 3.
The computing terminal 2 writes the work results and the data certificates (digital signatures of the broadcaster and participants from which the certification data came from this deep learning task) on the chain and returns them to the intelligent contract module 3.
The verification terminal 4 verifies the correctness of the work result of the computing terminal 2. The test set is extracted in the task. If the accuracy reaches a threshold, the mandated cost is released as labor before the task is finished. If the threshold is not reached, the credit integral of the computing terminal 2 is clipped. Here, because the test set is much smaller than the training set, the difficulty and delay in verifying the model accuracy is much smaller than that of the training model, and therefore distributed computation is not necessary.
And the intelligent contract module 3 optimizes the verified model according to the joint average algorithm. Finally, the corresponding reward is distributed to the computing terminal 2 according to the size of the contribution (whether the task is completed and the amount of data provided).
The block chain network-oriented computing task distribution system of the present invention can be implemented in hardware, software, firmware or any combination thereof. Various features are described as modules, units or components that may be implemented together in an integrated logic device or separately as discrete but interoperable logic devices or other hardware devices. In some cases, various features of an electronic circuit may be implemented as one or more integrated circuit devices, such as an integrated circuit chip or chipset.
If implemented in hardware, the invention relates to an apparatus, which may be, for example, a processor or an integrated circuit device, such as an integrated circuit chip or chipset. Alternatively or additionally, if implemented in software or firmware, the techniques may implement a data storage medium readable at least in part by a computer, comprising instructions that when executed cause a processor to perform one or more of the above-described methods. For example, a computer-readable data storage medium may store instructions that are executed, such as by a processor.
The code or instructions may be software and/or firmware executed by processing circuitry including one or more processors, such as one or more Digital Signal Processors (DSPs), general purpose microprocessors, Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), or other equivalent integrated or discrete logic circuitry. Thus, the term "processor," as used herein, may refer to any of the foregoing structure or any other structure more suitable for implementing the techniques described herein. In addition, in some aspects, the functionality described in this disclosure may be provided in software modules and hardware modules.
As an embodiment of the invention, the task allocation process is implemented based on an intelligent contract of a block chain, and the specific architecture design is shown in FIG. 3.
The bottom layer is a physical layer and comprises a mobile device, a base station, a block chain data storage and an IPFS file storage service, wherein the block chain data stores metadata of tasks, and the IPFS file storage service stores complete data of the tasks.
And then, a deep learning layer is arranged upwards and comprises a data interface, a training set, a test set and a model training module, the data interface acquires relevant data and parameters of deep learning, the model training is carried out, and finally, the relevant data and parameters are returned to the intelligent contract.
The last layer is a network transmission layer which comprises a network transmission protocol of a block chain and a peer-to-peer network transmission protocol of IPFS, wherein the network transmission protocol of the block chain is responsible for transmitting metadata of tasks, and the transmission protocol of the IPFS is responsible for transmitting complete data of the tasks.
The top layer is an intelligent contract which is converted into a Solidity language available to the Etherhouse and runs on an Etherhouse Virtual Machine (EVM). It comprises three parts: the first part is to monitor user attribute and is responsible for receiving data such as attribute sent by the mobile terminal; the second part is a distributed training scheduling layer which is responsible for coordinating the cooperation among all the participants, aggregating the models of the participants and distributing new models. The third part is a preprocessing part of the system when initiating the task, which is responsible for receiving and preprocessing the task request sent by the initiator, selecting the participants, then sending the task metadata to the participants, and finally returning the training result to the initiator.
Based on the system, the invention also provides a calculation task allocation method based on the block chain network, as shown in fig. 4, the method comprises the following steps:
s101, a task initiating terminal acquires a calculation request task triggered by an initiator;
s102, the intelligent contract module collects a calculation request task initiated by a task initiating terminal in a network in real time, and splits the calculation request task into small task blocks;
s103, matching the attribute and the difficulty degree of the split task small block to a computing terminal;
s104, receiving the computing terminal of the task small block to perform computing, and outputting a computing result;
s105, verifying the accuracy of the calculation result by the verification terminal;
s1051, if the accuracy reaches the threshold, the calculation task is finished;
s1052, if the credit score does not reach the threshold value, the credit score of the computing terminal is reduced;
the task small blocks which do not reach the threshold value can be redistributed to other computing terminals by the intelligent contract module to be processed.
Of course, the processing can also be continued by the computing terminal, and if the threshold is not reached yet, the processing is redistributed to other computing terminals to meet the requirement that the accuracy reaches the threshold.
And S106, the intelligent contract module distributes corresponding rewards to the computing terminal according to the contribution degree of the computing terminal.
Specifically, the task initiating terminal obtains task tuple m of the computation request task triggered by the initiatori=<om,dm,dsm,Qm,i>Is represented by the formula, wherein omIs task miThe release time of (1), the deadline of the task by (d)mDenotes, dsmRepresenting the storage required for the taskSpace, QmIndicating the remuneration obtained by the computing terminals completing the task, wherein i represents the category of the task;
the set of computing request tasks of the initiator in the system is { m }1,m2,...,mICalculating that a request task set obeys Poisson distribution, and an initiator local queue also obeys Poisson distribution;
in the system, a macro base station MBS covers K small base stations SBS, which is denoted as K ═ 0,1, 2.., K }, where 0 denotes the MBS;
using tuples<Ck,Sk,Pk>Description of SBSkIn which C iskRepresents SBSkIs calculated by the CPU ofkIndicates its available storage capacity, PkRepresents its transmit power of transmission;
using tuples<Ck,Sk,Pk>N initiators, labeled U ═ 1,2,3,. and N, are served together, each initiator connected to a small base station, and the initiators maintain a blockchain network together.
Initiator usage tuple<cn,sn,dn,pn,pcn>Represents;
wherein c isnCPU calculation frequency, c, on behalf of initiator nn={cn,1,cn,2,...,cn,IDenotes different kinds of CPU calculation frequencies, snStorable capacity on behalf of the sponsor, dnIndicating the amount of local interaction data, p, available to the initiator nnIndicating the transmission transmit power of the initiator n, pcnIndicating a success rate;
computing terminal matching pair mp ═<m,Cm>Represents task m and computing terminal CmA combination of (1);
the computing terminal is the selected initiator and has Cm∈U;
Distribution utility Qm×pcn,QmTask return value and pcnThe product of the initiator success rates; wherein Qm∈(0,1),pcnE (0,1), then there is Qm×pcn∈(0,1)
The task travel time, namely the time for the computing terminal to discover and acquire the task:
wherein r isnAnd (t) is the download transmission rate.
Initiator training time, i.e. the time taken to compute the terminal training model:
wherein sigmaiRepresenting the number of CPU cycles required to execute the i-type unit amount task;
the return time of the initiator, namely the time taken by the computing terminal to return the model:
where λ is the space occupied by the model parameters, rn' (t) is the upload transmission rate;
initiator opportunity cost, cost consumed by the initiator to download, execute, and return tasks;
waiting for an allocated time, i.e. the task release time omTo task allocation time TaThe difference of (a):
the quantity of local interaction data which can be provided by each task initiating terminal is assumed to beThe overall benefit of the matching pair is:
wherein alpha, beta, gamma and eta are weight coefficients,em and emm,n' is a normalized value, and the processing method is as follows:
wherein X is XiSet of values, min (X) is the element with the smallest value in set X, max (X) is the element with the largest value;
the task allocation aims at ensuring that the energy consumption and the time delay are minimized under the QoS limit, namely the optimization aims are as follows:
s.t.cn,t>0
(8)
the task m is distributed before the deadline, otherwise the reward can not be obtained; task miOnly initiators that support class i training can be selected and the assignment cannot be changed once the assignment is complete.
The task allocation algorithm involved in the method of the invention is a multi-user training task scheduling problem, and generally, the task is regarded as randomly arriving at an intelligent contract. For the whole distributed training system, task allocation needs to be performed after all tasks arrive or tasks are predicted to arrive, otherwise a globally optimal allocation scheme cannot be found. I.e. the assignment of the current task is related to the assignment of the subsequently arriving task. The allocation of the shortest response time of the current task may prolong the response time of the subsequent task, thereby increasing the average response time of the system. The allocation of the maximum profit of the current task may affect the profit of the subsequent task, and the total profit of the system per unit time becomes smaller.
In the invention, the scheduling of the multi-user distributed training task becomes a dynamic planning problem. The prior task allocation has certain influence on the allocation of the subsequent task, and the allocation decision of the current task is only related to task attributes such as required storage space of the current task, so that the task can be allocated to which user set to execute according to the optimization target only by determining the attributes of the current task and the attributes of the users. In practice, each task assignment is considered as a task decision, and a plurality of decision processes are included in the complete scheduling scheme. From the above discussion, the probability of task arrival is considered to be subject to poisson distribution, and the task scheduling Process is considered to be a Markov Decision Process (MDP).
In this scenario, the smart contract acts as an agent responsible for managing and coordinating the relationships between tasks and users. The specific job duty is to collect system state information and make decisions for each request. The state space, action space and reward function based on the DQN algorithm are as follows:
the intelligent contract module manages and coordinates the calculation request task; collecting computing request task information and distributing each computing request task to a computing terminal;
the intelligent contract module is used for managing and coordinating based on a state space, an action space and a return function of a DQN algorithm;
1) and in each decision time T, the system information monitored and collected by the intelligent contract is as follows:
omand dmThe release time and the deadline of the task;
dsmcalculating the storage space required by the terminal;
Qmthe reward is paid;
i, the category of the task;
cnthe efficiency of the CPU or GPU on different kinds of tasks;
sncalculating the available storage space of the terminal;
danlocal interactive data volume;
pntransmitting a transmit power;
Vncredit points;
Bnthe number of available channels;
the state vector is represented as:
the state vector records not only the ease of task and classification, but also the attributes of the computing terminal.
The intelligent contract module balances the difficulty of the tasks and the hardware performance and the communication environment of the computing terminal by selecting the computing terminal capable of executing the split small task blocks to distribute the tasks;
selecting a training model of the computing terminal from the computing terminals and distributing a proper channel for the training model;
executing the split task small blocks by the selected computing terminals, and considering that the computing terminals use all computing power to carry out model training;
the motion vector is defined as:
at=(Δt,bt) (10).
the selection vectors of all the computing terminals in the set U are shown; whereinIs a binary vector used to indicate whether computing terminal n is selected to perform a task,expressed as:
whereinAnd selecting the computing terminal n as the computing terminal, otherwise, not selecting the computing terminal n.
Is an allocation vector of the spectral resources of all computing terminals in the set U, as mentioned in chapter three,is the subchannel assigned to the computing terminal n.
Assuming that all computing terminals are honest and cannot be disconnected from the network after being assigned tasks until the execution is finished;
and distributing the reward according to the computing power contribution amount of the computing terminal.
In the method of the invention, when selecting the computing terminal, the computing terminal needs to satisfy the following two constraint conditions:
for each computing terminal in the distributed system, the task is distributed and executed immediately after the last task is completed, and the model submission is completed before the task deadline, so the predicted response time should be less than the QoS, based on the time constraint formula, it can be known that:
if the computing terminal does not support the execution of this type of task, it does not participate in the distributed training, i.e. it does not support the execution of this type of task
cn,i>0 (13)
In each decision cycle of task arrival, performing action a from state s, i.e. selecting computing terminals and allocating resources to them, the system transitions to the next state s';
the intelligent contract module obtains an instantaneous return RtAs an evaluation; based on a comprehensive income formula, a return function of a system executing a certain task is defined as follows:
whereinRepresenting credit points V of all computing terminals in the current networknMaximum value of (d);
the transient reward comprises three parts: the first portion represents a reward for performing the task, and the higher the credit score, the greater the value corresponding to the first portion is;
the second part is in proportion to contributing local interaction data, and the more data quantity representing contribution, the higher probability of being selected is;
the third portion represents the energy consumption to perform the task;
the reward function is for the computing terminal, δtWhen the value is 1, the user has a reward; but if not selected deltatThe corresponding reward is also 0, when it is 0.
In the invention, the calculation tasks issued by the user are distributed to each edge node through the block chain network, and the information of all task distribution processes, task unloading nodes, task consumption calculation force and the like is recorded through the block chain network. In the task allocation scheme, a reputation evaluation mechanism of a task participant is set so as to reduce the possibility that the system is attacked maliciously; the training task fragmentation scheme based on the data parallel idea is used for minimizing the task scheduling response time of different types and ensuring the safety of the whole task allocation process; the invention distributes the training tasks by combining user selection and dynamic resources through a task distribution algorithm of an intelligent contract module based on a reinforcement learning method so as to reduce energy consumption.
In order to improve that tasks distributed to all nodes can be completed most efficiently, processing time prediction aiming at all nodes is carried out on each task through a Recurrent Neural Network (RNN) prediction model, and due to the fact that the number of nodes of the whole Network is large, a deep learning model is adopted, training and prediction are separated, and time loss caused by the fact that the nodes are too many is reduced.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A system for distributing computing tasks based on a blockchain-oriented network, comprising: the system comprises a task initiating terminal, a plurality of computing terminals, an intelligent contract module and a verification terminal;
the task initiating terminal is used for initiating a calculation request task to the intelligent contract module;
each computing terminal has a different computational training model;
the intelligent contract module is used for collecting a calculation request task initiated by a task initiating terminal in a network in real time, and splitting the calculation request task into small task blocks; matching the attribute and the difficulty degree of the split task small blocks to a computing terminal, computing and outputting a computing result;
the verification terminal is used for verifying the accuracy of the calculation result, and if the accuracy reaches a threshold value, the calculation task is ended;
if the credit score does not reach the threshold value, the credit score of the computing terminal is reduced;
and the intelligent contract module distributes corresponding rewards to the computing terminal according to the contribution degree of the computing terminal.
2. The blockchain network based computing task distribution system of claim 1,
the contribution is determined based on the amount of data that the computing terminal completes and verifies through the task tile.
3. The blockchain network based computing task distribution system of claim 1,
the content of the calculation request task includes task deadline, storage space required by the task, reward of the task, and category of the task.
4. A calculation task distribution method based on a block chain network is characterized by comprising the following steps:
a task initiating terminal acquires a calculation request task triggered by an initiator;
the intelligent contract module collects a calculation request task initiated by a task initiating terminal in a network in real time, and splits the calculation request task into small task blocks;
matching the attribute and the difficulty degree of the split task small blocks to a computing terminal;
the computing terminal receiving the task small block performs computing and outputs a computing result;
the verification terminal verifies the accuracy of the calculation result, and if the accuracy reaches a threshold value, the calculation task is ended;
if the credit score does not reach the threshold value, the credit score of the computing terminal is reduced;
and the intelligent contract module distributes corresponding rewards to the computing terminal according to the contribution degree of the computing terminal.
5. The block chain network-oriented computation task allocation method according to claim 4,
task initiating terminal obtains task tuple m of computing request task triggered by initiatori=<om,dm,dsm,Qm,i>Is shown byMiddle omIs task miThe release time of (1), the deadline of the task by (d)mDenotes, dsmRepresenting the memory space required for the task, QmIndicating the remuneration obtained by the computing terminals completing the task, wherein i represents the category of the task;
the set of computing request tasks of the initiator in the system is { m }1,m2,...,mICalculating that a request task set obeys Poisson distribution, and an initiator local queue also obeys Poisson distribution;
in the system, a macro base station MBS covers K small base stations SBS, which is denoted as K ═ 0,1, 2.., K }, where 0 denotes the MBS;
using tuples<Ck,Sk,Pk>Describes SBSk, wherein CkCPU calculation frequency, S, representing SBSkkIndicates its available storage capacity, PkRepresents its transmit power of transmission;
using tuples<Ck,Sk,Pk>N initiators, labeled U ═ 1,2,3,. and N, are served together, each initiator connected to a small base station, and the initiators maintain a blockchain network together.
6. The block chain network-oriented computation task allocation method according to claim 5,
initiator usage tuple<cn,sn,dn,pn,pcn>Represents;
wherein c isnCPU calculation frequency, c, on behalf of initiator nn={cn,1,cn,2,...,cn,IDenotes different kinds of CPU calculation frequencies, snStorable capacity on behalf of the sponsor, dnIndicating the amount of local interaction data, p, available to the initiator nnIndicating the transmission transmit power of the initiator n, pcnIndicating a success rate;
computing terminal matching pair mp ═<m,Cm>Represents task m and computing terminal CmA combination of (1);
the computing terminal is the selected initiator and has Cm∈U;
Distribution utility Qm×pcn,QmTask return value and pcnThe product of the initiator success rates; wherein Qm∈(0,1),pcnE (0,1), then there is Qm×pcn∈(0,1)
The task travel time, namely the time for the computing terminal to discover and acquire the task:
wherein r isnAnd (t) is the download transmission rate.
7. The blockchain network-oriented computing task assigning method according to claim 6,
initiator training time, i.e. the time taken to compute the terminal training model:
wherein sigmaiRepresenting the number of CPU cycles required to execute the i-type unit amount task;
the return time of the initiator, namely the time taken by the computing terminal to return the model:
where λ is the space occupied by the model parameters, rn' (t) is the upload transmission rate;
initiator opportunity cost, cost consumed by the initiator to download, execute, and return tasks;
waiting for an allocated time, i.e. the task release time omTo task allocation time TaThe difference of (a):
the quantity of local interaction data which can be provided by each task initiating terminal is assumed to beThe overall benefit of the matching pair is:
wherein alpha, beta, gamma and eta are weight coefficients,em and emm,n' is a normalized value, and the processing method is as follows:
wherein X is XiSet of values, min (X) is the element with the smallest value in set X, max (X) is the element with the largest value;
the task allocation aims at ensuring that the energy consumption and the time delay are minimized under the QoS limit, namely the optimization aims are as follows:
the task m is distributed before the deadline, otherwise the reward can not be obtained; task miOnly initiators that support class i training can be selected and the assignment cannot be changed once the assignment is complete.
8. The block chain network-oriented computation task allocation method according to claim 4,
the intelligent contract module manages and coordinates the calculation request task; collecting computing request task information and distributing each computing request task to a computing terminal;
the intelligent contract module is used for managing and coordinating based on a state space, an action space and a return function of a DQN algorithm;
1) and in each decision time T, the system information monitored and collected by the intelligent contract is as follows:
omand dmThe release time and the deadline of the task;
dsmcalculating the storage space required by the terminal;
Qmthe reward is paid;
i, the category of the task;
cnthe efficiency of the CPU or GPU on different kinds of tasks;
sncalculating the available storage space of the terminal;
danlocal interactive data volume;
pntransmitting a transmit power;
Vncredit points;
Bnthe number of available channels;
the state vector is represented as:
the state vector records not only the ease of task and classification, but also the attributes of the computing terminal.
9. The blockchain network-based computing task assigning method according to claim 8,
the intelligent contract module balances the difficulty of the tasks and the hardware performance and the communication environment of the computing terminal by selecting the computing terminal capable of executing the split small task blocks to distribute the tasks;
selecting a training model of the computing terminal from the computing terminals and distributing a proper channel for the training model;
executing the split task small blocks by the selected computing terminals, and considering that the computing terminals use all computing power to carry out model training;
the motion vector is defined as:
at=(Δt,bt) (10).
the selection vectors of all the computing terminals in the set U are shown; whereinIs a binary vector used to indicate whether computing terminal n is selected to perform a task,expressed as:
whereinThe computing terminal n is selected as a computing terminal, otherwise, the computing terminal n is not selected;
is an allocation vector of the spectral resources of all computing terminals in the set U, as mentioned in chapter three,is divided intoA subchannel allocated to the computing terminal n;
assuming that all computing terminals are honest and cannot be disconnected from the network after being assigned tasks until the execution is finished;
and distributing the reward according to the computing power contribution amount of the computing terminal.
10. The blockchain network-based computing task assigning method according to claim 9,
when selecting a computing terminal, the computing terminal needs to satisfy the following two constraints:
for each computing terminal in the distributed system, the task is distributed and executed immediately after the last task is completed, and the model submission is completed before the task deadline, so the predicted response time should be less than the QoS, based on the time constraint formula, it can be known that:
if the computing terminal does not support the execution of this type of task, it does not participate in the distributed training, i.e. it does not support the execution of this type of task
cn,i>0 (13)
In each decision cycle of task arrival, performing action a from state s, i.e. selecting computing terminals and allocating resources to them, the system transitions to the next state s';
the intelligent contract module obtains an instantaneous return RtAs an evaluation; based on a comprehensive income formula, a return function of a system executing a certain task is defined as follows:
whereinRepresenting all computing terminals in the current networkEnd credit score VnMaximum value of (d);
the transient reward comprises three parts: the first portion represents a reward for performing the task, and the higher the credit score, the greater the value corresponding to the first portion is;
the second part is in proportion to contributing local interaction data, and the more data quantity representing contribution, the higher probability of being selected is;
the third portion represents the energy consumption to perform the task;
the reward function is for the computing terminal, δtWhen the value is 1, the user has a reward; but if not selected deltatThe corresponding reward is also 0, when it is 0.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111024482.0A CN113778675A (en) | 2021-09-02 | 2021-09-02 | Calculation task distribution system and method based on block chain network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111024482.0A CN113778675A (en) | 2021-09-02 | 2021-09-02 | Calculation task distribution system and method based on block chain network |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113778675A true CN113778675A (en) | 2021-12-10 |
Family
ID=78840685
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111024482.0A Withdrawn CN113778675A (en) | 2021-09-02 | 2021-09-02 | Calculation task distribution system and method based on block chain network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113778675A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114140033A (en) * | 2022-01-29 | 2022-03-04 | 北京新唐思创教育科技有限公司 | Service personnel allocation method and device, electronic equipment and storage medium |
CN116506444A (en) * | 2023-06-28 | 2023-07-28 | 北京科技大学 | Block chain stable slicing method based on deep reinforcement learning and reputation mechanism |
-
2021
- 2021-09-02 CN CN202111024482.0A patent/CN113778675A/en not_active Withdrawn
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114140033A (en) * | 2022-01-29 | 2022-03-04 | 北京新唐思创教育科技有限公司 | Service personnel allocation method and device, electronic equipment and storage medium |
CN114140033B (en) * | 2022-01-29 | 2022-04-12 | 北京新唐思创教育科技有限公司 | Service personnel allocation method and device, electronic equipment and storage medium |
CN116506444A (en) * | 2023-06-28 | 2023-07-28 | 北京科技大学 | Block chain stable slicing method based on deep reinforcement learning and reputation mechanism |
CN116506444B (en) * | 2023-06-28 | 2023-10-17 | 北京科技大学 | Block chain stable slicing method based on deep reinforcement learning and reputation mechanism |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Lu et al. | Optimization of lightweight task offloading strategy for mobile edge computing based on deep reinforcement learning | |
Li et al. | An online incentive mechanism for collaborative task offloading in mobile edge computing | |
CN111010434B (en) | Optimized task unloading method based on network delay and resource management | |
CN110941667A (en) | Method and system for calculating and unloading in mobile edge calculation network | |
CN107734558A (en) | A kind of control of mobile edge calculations and resource regulating method based on multiserver | |
WO2023116460A1 (en) | Multi-user multi-task computing offloading method and system in mobile edge computing environment | |
CN113037877B (en) | Optimization method for time-space data and resource scheduling under cloud edge architecture | |
CN107295109A (en) | Task unloading and power distribution joint decision method in self-organizing network cloud computing | |
CN111163519A (en) | Wireless body area network resource allocation and task unloading algorithm with maximized system benefits | |
CN102662764B (en) | A kind of dynamic cloud computational resource optimizing distribution method based on SMDP | |
CN110519370B (en) | Edge computing resource allocation method based on facility site selection problem | |
CN109474681A (en) | Resource allocation methods, system and the server system of mobile edge calculations server | |
Chen et al. | Latency minimization for mobile edge computing networks | |
CN111614754B (en) | Fog-calculation-oriented cost-efficiency optimized dynamic self-adaptive task scheduling method | |
Huang et al. | Enabling DNN acceleration with data and model parallelization over ubiquitous end devices | |
CN102857548A (en) | Mobile cloud computing resource optimal allocation method | |
CN113778675A (en) | Calculation task distribution system and method based on block chain network | |
CN111949409A (en) | Method and system for unloading calculation tasks in electric wireless heterogeneous network | |
CN107566535B (en) | Self-adaptive load balancing method based on concurrent access timing sequence rule of Web map service | |
CN117135131A (en) | Task resource demand perception method for cloud edge cooperative scene | |
CN114449490A (en) | Multi-task joint computing unloading and resource allocation method based on D2D communication | |
Tianze et al. | Consumption considered optimal scheme for task offloading in mobile edge computing | |
Zhang et al. | Service pricing and selection for IoT applications offloading in the multi-mobile edge computing systems | |
Li | Optimization of task offloading problem based on simulated annealing algorithm in MEC | |
CN110956500A (en) | Method and system for reducing advertisement request time consumption in advertisement real-time bidding system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20211210 |
|
WW01 | Invention patent application withdrawn after publication |